projects/linux·blob master · refs

14 lines · 891 B

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 -ggdb \
9 -W -Wall -Wextra -Wundef -Wwrite-strings \
10 $(call cc-option,-fno-stack-protector) $(call cc-option,-Wmissing-prototypes) \
11 $(call cc-option,--start-no-unused-arguments) -no-pie $(call cc-option,--end-no-unused-arguments) \
12 $(_CFLAGS_STACKPROTECTOR) $(_CFLAGS_SANITIZER)
13
14NOLIBC_TEST_SOURCES := nolibc-test.c nolibc-test-linkage.c nolibc-test-ignore-errno.c