endchoice
+config BR2_SSP_OPTION
+ string
+ default "-fstack-protector" if BR2_SSP_REGULAR
+ default "-fstack-protector-strong" if BR2_SSP_STRONG
+ default "-fstack-protector-all" if BR2_SSP_ALL
+
comment "Stack Smashing Protection needs a toolchain w/ SSP"
depends on !BR2_TOOLCHAIN_HAS_SSP
#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
TOOLCHAIN_WRAPPER_ARGS += -DBR_SYSROOT='"$(STAGING_SUBDIR)"'
TOOLCHAIN_WRAPPER_OPTS = \
+ $(call qstrip,$(BR2_SSP_OPTION)) \
$(call qstrip,$(BR2_TARGET_OPTIMIZATION))
# We create a list like '"-mfoo", "-mbar", "-mbarfoo"' so that each flag is a
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) \