From 4e9bce12432492aa7a7c2121d9fae1640606ace5 Mon Sep 17 00:00:00 2001 From: Joel Peshkin Date: Sun, 11 Apr 2021 11:21:58 +0200 Subject: Add support for stack-protector Add support for stack protector for UBOOT, SPL, and TPL as well as new pytest for stackprotector Signed-off-by: Joel Peshkin Adjust UEFI build flags. Signed-off-by: Heinrich Schuchardt --- scripts/Makefile.spl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index ca988224da..c69525fa74 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -67,6 +67,12 @@ include $(srctree)/scripts/Makefile.lib KBUILD_CFLAGS += -ffunction-sections -fdata-sections LDFLAGS_FINAL += --gc-sections +ifeq ($(CONFIG_$(SPL_TPL_)STACKPROTECTOR),y) +KBUILD_CFLAGS += -fstack-protector-strong +else +KBUILD_CFLAGS += -fno-stack-protector +endif + # FIX ME cpp_flags := $(KBUILD_CPPFLAGS) $(PLATFORM_CPPFLAGS) $(UBOOTINCLUDE) \ $(NOSTDINC_FLAGS) -- cgit v1.2.3