summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJoel Peshkin <joel.peshkin@broadcom.com>2021-04-11 12:21:58 +0300
committerTom Rini <trini@konsulko.com>2021-04-20 14:31:12 +0300
commit4e9bce12432492aa7a7c2121d9fae1640606ace5 (patch)
treeca4ff1ffa3d447d51e945ce4cd9f75f6e80babe9 /Makefile
parent1598c83ecec64619379834ec21de8efe2536ac3d (diff)
downloadu-boot-4e9bce12432492aa7a7c2121d9fae1640606ace5.tar.xz
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 <joel.peshkin@broadcom.com> Adjust UEFI build flags. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index e423f6de74..3fc9777b0b 100644
--- a/Makefile
+++ b/Makefile
@@ -676,7 +676,12 @@ else
KBUILD_CFLAGS += -O2
endif
+ifeq ($(CONFIG_STACKPROTECTOR),y)
+KBUILD_CFLAGS += $(call cc-option,-fstack-protector-strong)
+CFLAGS_EFI += $(call cc-option,-fno-stack-protector)
+else
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
+endif
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks)
# disable stringop warnings in gcc 8+