xref: /tools/testing/selftests/nolibc/Makefile.include
  • Home
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • current directory
1# SPDX-License-Identifier: GPL-2.0
2
3__CFLAGS_STACKPROTECTOR = $(call cc-option,-fstack-protector-all) $(call cc-option,-mstack-protector-guard=global)
4_CFLAGS_STACKPROTECTOR ?= $(call try-run, \
5	echo 'void foo(void) {}' | $(CC) -x c - -o - -S $(CLANG_CROSS_FLAGS) $(__CFLAGS_STACKPROTECTOR) | grep -q __stack_chk_guard, \
6	$(__CFLAGS_STACKPROTECTOR))
7_CFLAGS_SANITIZER ?= $(call cc-option,-fsanitize=undefined -fsanitize-trap=all)
8CFLAGS_NOLIBC_TEST  ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 -W -Wall -Wextra \
9		$(call cc-option,-fno-stack-protector) $(call cc-option,-Wmissing-prototypes) \
10		$(_CFLAGS_STACKPROTECTOR) $(_CFLAGS_SANITIZER)
11

Last Index update Fri Aug 22 10:33:58 CST 2025