aboutsummaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
authorGravatar Matt Weber <matthew.weber@rockwellcollins.com>2018-09-17 16:21:50 -0500
committerGravatar Peter Korsgaard <peter@korsgaard.com>2018-10-20 12:51:21 +0200
commitf10822d151085bcbfecd0ecf2542ac5f5623fd9d (patch)
tree05c1285719dd04dcc2ecdf7ece9f8f49d79fa271 /toolchain
parent7484c1c3b8065d6f2f5a67607e9917ecfea022eb (diff)
downloadbuildroot-f10822d151085bcbfecd0ecf2542ac5f5623fd9d.tar.gz
buildroot-f10822d151085bcbfecd0ecf2542ac5f5623fd9d.tar.bz2
toolchain/toolchain-wrapper: add BR2_SSP_* support
Migrate the stack protection flag management into the wrapper. Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/toolchain-wrapper.c9
-rw-r--r--toolchain/toolchain-wrapper.mk8
2 files changed, 17 insertions, 0 deletions
diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
index c73a0cc079..e9c5cd9d32 100644
--- a/toolchain/toolchain-wrapper.c
+++ b/toolchain/toolchain-wrapper.c
@@ -98,6 +98,15 @@ static char *predef_args[] = {
#if defined(BR_MIPS_TARGET_BIG_ENDIAN) || defined(BR_ARC_TARGET_BIG_ENDIAN)
"-EB",
#endif
+#ifdef BR_SSP_REGULAR
+ "-fstack-protector",
+#endif
+#ifdef BR_SSP_STRONG
+ "-fstack-protector-strong",
+#endif
+#ifdef BR_SSP_ALL
+ "-fstack-protector-all",
+#endif
#ifdef BR_ADDITIONAL_CFLAGS
BR_ADDITIONAL_CFLAGS
#endif
diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk
index 99d303975c..613f5f6c56 100644
--- a/toolchain/toolchain-wrapper.mk
+++ b/toolchain/toolchain-wrapper.mk
@@ -51,6 +51,14 @@ else ifeq ($(BR2_RELRO_FULL),y)
TOOLCHAIN_WRAPPER_ARGS += -DBR2_RELRO_FULL
endif
+ifeq ($(BR2_SSP_REGULAR),y)
+TOOLCHAIN_WRAPPER_ARGS += -DBR_SSP_REGULAR
+else ifeq ($(BR2_SSP_STRONG),y)
+TOOLCHAIN_WRAPPER_ARGS += -DBR_SSP_STRONG
+else ifeq ($(BR2_SSP_ALL),y)
+TOOLCHAIN_WRAPPER_ARGS += -DBR_SSP_ALL
+endif
+
define TOOLCHAIN_WRAPPER_BUILD
$(HOSTCC) $(HOST_CFLAGS) $(TOOLCHAIN_WRAPPER_ARGS) \
-s -Wl,--hash-style=$(TOOLCHAIN_WRAPPER_HASH_STYLE) \