gcc: musl comes with its own SSP, so use it instead of libssp
authorSteven Barth <cyrus@openwrt.org>
Sat, 20 Jun 2015 17:37:20 +0000 (17:37 +0000)
committerSteven Barth <cyrus@openwrt.org>
Sat, 20 Jun 2015 17:37:20 +0000 (17:37 +0000)
Signed-off-by: Steven Barth <steven@midlink.org>
SVN-Revision: 46071

toolchain/gcc/final/Makefile
toolchain/gcc/patches/4.8-linaro/030-always-link-ssp-noshared.patch [new file with mode: 0644]

index 3fb5ccf..1212d14 100644 (file)
@@ -16,6 +16,10 @@ ifneq ($(CONFIG_GCC_VERSION_4_5)$(CONFIG_GCC_VERSION_4_6),)
        --with-libelf=$(TOPDIR)/staging_dir/host
 endif
 
        --with-libelf=$(TOPDIR)/staging_dir/host
 endif
 
+ifdef CONFIG_USE_MUSL
+  GCC_MAKE += gcc_cv_libc_provides_ssp=yes
+endif
+
 ifneq ($(CONFIG_SJLJ_EXCEPTIONS),)
   GCC_CONFIGURE += \
        --enable-sjlj-exceptions
 ifneq ($(CONFIG_SJLJ_EXCEPTIONS),)
   GCC_CONFIGURE += \
        --enable-sjlj-exceptions
diff --git a/toolchain/gcc/patches/4.8-linaro/030-always-link-ssp-noshared.patch b/toolchain/gcc/patches/4.8-linaro/030-always-link-ssp-noshared.patch
new file mode 100644 (file)
index 0000000..1208e73
--- /dev/null
@@ -0,0 +1,11 @@
+--- gcc-4.7.4.org/gcc/gcc.c
++++ gcc-4.7.4/gcc/gcc.c
+@@ -603,7 +603,7 @@
+ #ifndef LINK_SSP_SPEC
+ #ifdef TARGET_LIBC_PROVIDES_SSP
+-#define LINK_SSP_SPEC "%{fstack-protector:}"
++#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared}"
+ #else
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp}"
+ #endif