Fix SSP related build failures
cover Fix SSP related build failures
Hello,
This set of patches aim at fixing the SSP related build failures that occur with uClibc configurations that don't have SSP support enabled.
The original problem starts when uClibc-ng recently changed the glibc minor version it pretends to be. Due to this change, gcc know believe that uClibc always has SSP support (because the corresponding glibc minor version always has SSP support). This was causing build failures in programs such as "sudo", which are using SSP support:
http://autobuild.buildroot.org/results/778/778e6309ba834cc70f8243a4f6c664c0bcaeb7c5/
In order to fix this, we explicitly pass the appropriate autoconf variable to gcc to tell whether the C library has SSP support or not. It was already done during gcc-initial (because the C library isn't available at that time), but is now also done at gcc-final time.
It was tested with:
- internal toolchain with glibc. SSP support is properly generated, and 'sudo' is indeed using it.
- internal toolchain with uClibc and SSP enabled. Same test: sudo builds fine, and uses SSP.
- internal toolchain with uClibc, SSP disabled. Same test: sudo builds fine, but of course doesn't use SSP support.
- internal toolchain with musl. SSP support is properly generated, and 'sudo' is using it.
Best regards,
Thomas
Thomas Petazzoni (3):
toolchain: like glibc, musl always provides SSP support
gcc: pass explicit gcc_cv_libc_provides_ssp also to gcc-final
gcc: simplify musl patches for SSP support
package/gcc/4.7.4/900-musl-support.patch | 36 ---------------------------- package/gcc/4.8.5/900-musl-support.patch | 36 ---------------------------- package/gcc/4.9.3/900-musl-support.patch | 36 ---------------------------- package/gcc/5.2.0/904-musl-libc-config.patch | 36 ---------------------------- package/gcc/gcc-final/gcc-final.mk | 2 ++ package/gcc/gcc-initial/gcc-initial.mk | 5 +--- package/gcc/gcc.mk | 10 ++++++++ toolchain/Config.in | 1 + 8 files changed, 14 insertions(+), 148 deletions(-)
Signature · 1 line
2.6.2
PATCH 1/3 toolchain: like glibc, musl always provides SSP support
Make sure BR2_TOOLCHAIN_USES_MUSL selects BR2_TOOLCHAIN_HAS_SSP since musl always provides SSP support (like glibc).
--- toolchain/Config.in | 1 + 1 file changed, 1 insertion(+)
toolchain/Config.in +1 -0
@@ -27,6 +27,7 @@ config BR2_TOOLCHAIN_USES_MUSL select BR2_TOOLCHAIN_HAS_THREADS select BR2_TOOLCHAIN_HAS_THREADS_DEBUG select BR2_TOOLCHAIN_HAS_THREADS_NPTL + select BR2_TOOLCHAIN_HAS_SSP choice prompt "Toolchain type"
Signature · 1 line
2.6.2
PATCH 1/3 toolchain: like glibc, musl always provides SSP support
Thomas, All,
On 2015-10-17 15:09 +0200, Thomas Petazzoni spake thusly:
Quoted 4 lines
Make sure
BR2_TOOLCHAIN_USES_MUSLselectsBR2_TOOLCHAIN_HAS_SSPsince musl always provides SSP support (like glibc).Signed-off-by Thomas Petazzoni <[email protected]>
Regards,
Yann E. MORIN.
Quoted 23 lines
--- toolchain/Config.in | 1 + 1 file changed, 1 insertion(+)toolchain/Config.in +1
-0@@ -27,6 +27,7 @@ config BR2_TOOLCHAIN_USES_MUSL select BR2_TOOLCHAIN_HAS_THREADS select BR2_TOOLCHAIN_HAS_THREADS_DEBUG select BR2_TOOLCHAIN_HAS_THREADS_NPTL + select BR2_TOOLCHAIN_HAS_SSP choice prompt "Toolchain type"Signature · 6 lines
2.6.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 2/3 gcc: pass explicit gcc_cv_libc_provides_ssp also to gcc-final
In reply to Thomas PetazzoniDuring the gcc-initial build, we already pass gcc_cv_libc_provides_ssp=yes explicitly when SSP support will be available in the C library: at this point in time the C library is not yet built, so gcc cannot detect if it will support SSP or not.
However, it turns out that there are some situations for which it is also useful to tell gcc explicitly whether the SSP support is available or not: the gcc logic to decide whether uClibc has SSP support or not is broken since uClibc-ng bumped the glibc version it pretends to be.
So, this commit makes sure that we explicitly pass gcc_cv_libc_provides_ssp both to gcc-initial and gcc-final, and that we're always passing either 'yes' or 'no'.
Fixes:
http://autobuild.buildroot.org/results/778/778e6309ba834cc70f8243a4f6c664c0bcaeb7c5/
--- package/gcc/gcc-final/gcc-final.mk | 2 ++ package/gcc/gcc-initial/gcc-initial.mk | 5 +---- package/gcc/gcc.mk | 10 ++++++++++ 3 files changed, 13 insertions(+), 4 deletions(-)
package/gcc/gcc-final/gcc-final.mk +2 -0
@@ -85,6 +85,8 @@ HOST_GCC_FINAL_CONF_OPTS += \ HOST_GCC_FINAL_CONF_ENV = \ $(HOST_GCC_COMMON_CONF_ENV) +HOST_GCC_FINAL_MAKE_OPTS += $(HOST_GCC_COMMON_MAKE_OPTS) + # Make sure we have 'cc' define HOST_GCC_FINAL_CREATE_CC_SYMLINKS if [ ! -e $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc ]; then \
package/gcc/gcc-initial/gcc-initial.mk +1 -4
@@ -51,10 +51,7 @@ HOST_GCC_INITIAL_CONF_OPTS = \ HOST_GCC_INITIAL_CONF_ENV = \ $(HOST_GCC_COMMON_CONF_ENV) -# We need to tell gcc that the C library will be providing the ssp -# support, as it can't guess it since the C library hasn't been built -# yet (we're gcc-initial). -HOST_GCC_INITIAL_MAKE_OPTS = $(if $(BR2_TOOLCHAIN_HAS_SSP),gcc_cv_libc_provides_ssp=yes) all-gcc +HOST_GCC_INITIAL_MAKE_OPTS = $(HOST_GCC_COMMON_MAKE_OPTS) all-gcc HOST_GCC_INITIAL_INSTALL_OPTS = install-gcc ifeq ($(BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE),y)
package/gcc/gcc.mk +10 -0
@@ -238,6 +238,16 @@ endif HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_CROSS_PATH_SUFFIX='".br_real"' +# For gcc-initial, we need to tell gcc that the C library will be +# providing the ssp support, as it can't guess it since the C library +# hasn't been built yet. +# +# For gcc-final, the gcc logic to detect whether SSP support is +# available or not in the C library is not working properly for +# uClibc, so let's be explicit as well. +HOST_GCC_COMMON_MAKE_OPTS = \ + gcc_cv_libc_provides_ssp=$(if $(BR2_TOOLCHAIN_HAS_SSP),yes,no) + ifeq ($(BR2_CCACHE),y) HOST_GCC_COMMON_CCACHE_HASH_FILES += $(DL_DIR)/$(GCC_SOURCE) # Cfr. PATCH_BASE_DIRS in .stamp_patched, but we catch both versioned and
Signature · 1 line
2.6.2
PATCH 2/3 gcc: pass explicit gcc_cv_libc_provides_ssp also to gcc-final
Thomas, All,
On 2015-10-17 15:09 +0200, Thomas Petazzoni spake thusly:
Quoted 15 lines
During the gcc-initial build, we already pass gcc_cv_libc_provides_ssp=yes explicitly when SSP support will be available in the C library: at this point in time the C library is not yet built, so gcc cannot detect if it will support SSP or not.
However, it turns out that there are some situations for which it is also useful to tell gcc explicitly whether the SSP support is available or not: the gcc logic to decide whether uClibc has SSP support or not is broken since uClibc-ng bumped the glibc version it pretends to be.
So, this commit makes sure that we explicitly pass
gcc_cv_libc_provides_sspboth to gcc-initial and gcc-final, and that we're always passing either 'yes' or 'no'.
Quoted 5 lines
Fixes:
http://autobuild.buildroot.org/results/778/778e6309ba834cc70f8243a4f6c664c0bcaeb7c5/Signed-off-by Thomas Petazzoni <[email protected]>
Regards,
Yann E. MORIN.
Quoted 63 lines
--- package/gcc/gcc-final/gcc-final.mk | 2 ++ package/gcc/gcc-initial/gcc-initial.mk | 5 +---- package/gcc/gcc.mk | 10 ++++++++++ 3 files changed, 13 insertions(+), 4 deletions(-)package/gcc/gcc-final/gcc-final.mk +2
-0@@ -85,6 +85,8 @@ HOST_GCC_FINAL_CONF_OPTS += \ HOST_GCC_FINAL_CONF_ENV = \ $(HOST_GCC_COMMON_CONF_ENV) +HOST_GCC_FINAL_MAKE_OPTS += $(HOST_GCC_COMMON_MAKE_OPTS) + # Make sure we have 'cc' define HOST_GCC_FINAL_CREATE_CC_SYMLINKS if [ ! -e $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc ]; then \package/gcc/gcc-initial/gcc-initial.mk +1
-4@@ -51,10 +51,7 @@ HOST_GCC_INITIAL_CONF_OPTS = \ HOST_GCC_INITIAL_CONF_ENV = \ $(HOST_GCC_COMMON_CONF_ENV) -# We need to tell gcc that the C library will be providing the ssp -# support, as it can't guess it since the C library hasn't been built -# yet (we're gcc-initial). -HOST_GCC_INITIAL_MAKE_OPTS = $(if $(BR2_TOOLCHAIN_HAS_SSP),gcc_cv_libc_provides_ssp=yes) all-gcc +HOST_GCC_INITIAL_MAKE_OPTS = $(HOST_GCC_COMMON_MAKE_OPTS) all-gcc HOST_GCC_INITIAL_INSTALL_OPTS = install-gcc ifeq ($(BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE),y)package/gcc/gcc.mk +10
-0@@ -238,6 +238,16 @@ endif HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS += -DBR_CROSS_PATH_SUFFIX='".br_real"' +# For gcc-initial, we need to tell gcc that the C library will be +# providing the ssp support, as it can't guess it since the C library +# hasn't been built yet. +# +# For gcc-final, the gcc logic to detect whether SSP support is +# available or not in the C library is not working properly for +# uClibc, so let's be explicit as well. +HOST_GCC_COMMON_MAKE_OPTS = \ + gcc_cv_libc_provides_ssp=$(if $(BR2_TOOLCHAIN_HAS_SSP),yes,no) + ifeq ($(BR2_CCACHE),y) HOST_GCC_COMMON_CCACHE_HASH_FILES += $(DL_DIR)/$(GCC_SOURCE) # Cfr. PATCH_BASE_DIRS in .stamp_patched, but we catch both versioned andSignature · 6 lines
2.6.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 3/3 gcc: simplify musl patches for SSP support
In reply to Thomas PetazzoniNow that we are always explicitly passing gcc_cv_libc_provides_ssp, there is no longer any reason to modify the gcc configure/configure.ac to take into account the musl case. When a musl toolchain is being built, BR2_TOOLCHAIN_HAS_SSP is always 'y', and therefore gcc_cv_libc_provides_ssp=yes is always passed when building gcc-initial and gcc-final.
--- package/gcc/4.7.4/900-musl-support.patch | 36 ---------------------------- package/gcc/4.8.5/900-musl-support.patch | 36 ---------------------------- package/gcc/4.9.3/900-musl-support.patch | 36 ---------------------------- package/gcc/5.2.0/904-musl-libc-config.patch | 36 ---------------------------- 4 files changed, 144 deletions(-)
package/gcc/4.7.4/900-musl-support.patch +0 -36
@@ -323,24 +323,6 @@ Index: b/gcc/configure =================================================================== --- a/gcc/configure +++ b/gcc/configure -@@ -26791,6 +26791,9 @@ - else - gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - # glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -26824,6 +26827,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail" @@ -26906,6 +26910,9 @@ gcc_cv_target_dl_iterate_phdr=no fi
@@ -355,24 +337,6 @@ Index: b/gcc/configure.ac =================================================================== --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -4669,6 +4669,9 @@ - gcc_cv_libc_provides_ssp, - [gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - [# glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -4702,6 +4705,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], @@ -4767,6 +4771,9 @@ gcc_cv_target_dl_iterate_phdr=no fi
package/gcc/4.8.5/900-musl-support.patch +0 -36
@@ -486,24 +486,6 @@ Index: b/gcc/configure =================================================================== --- a/gcc/configure +++ b/gcc/configure -@@ -26821,6 +26821,9 @@ - else - gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - # glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -26854,6 +26857,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail" @@ -26936,6 +26940,9 @@ gcc_cv_target_dl_iterate_phdr=no fi
@@ -518,24 +500,6 @@ Index: b/gcc/configure.ac =================================================================== --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -4750,6 +4750,9 @@ - gcc_cv_libc_provides_ssp, - [gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - [# glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -4783,6 +4786,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], @@ -4848,6 +4852,9 @@ gcc_cv_target_dl_iterate_phdr=no fi
package/gcc/4.9.3/900-musl-support.patch +0 -36
@@ -452,24 +452,6 @@ Index: b/gcc/configure =================================================================== --- a/gcc/configure +++ b/gcc/configure -@@ -27328,6 +27328,9 @@ - else - gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - # glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -27360,6 +27363,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail" @@ -27449,6 +27453,9 @@ gcc_cv_target_dl_iterate_phdr=no fi
@@ -484,24 +466,6 @@ Index: b/gcc/configure.ac =================================================================== --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -5016,6 +5016,9 @@ - gcc_cv_libc_provides_ssp, - [gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - # glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -5042,6 +5045,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], @@ -5108,6 +5112,9 @@ gcc_cv_target_dl_iterate_phdr=no fi
package/gcc/5.2.0/904-musl-libc-config.patch +0 -36
@@ -225,24 +225,6 @@ Index: b/gcc/configure =================================================================== --- a/gcc/configure +++ b/gcc/configure -@@ -27681,6 +27681,9 @@ - else - gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - # glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -27713,6 +27716,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail" @@ -27809,6 +27813,9 @@ gcc_cv_target_dl_iterate_phdr=no fi
@@ -257,24 +239,6 @@ Index: b/gcc/configure.ac =================================================================== --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -5199,6 +5199,9 @@ - gcc_cv_libc_provides_ssp, - [gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - # glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -5225,6 +5228,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], @@ -5298,6 +5302,9 @@ gcc_cv_target_dl_iterate_phdr=no fi
Signature · 1 line
2.6.2
PATCH 3/3 gcc: simplify musl patches for SSP support
Thomas, All,
On 2015-10-17 15:09 +0200, Thomas Petazzoni spake thusly:
Quoted 8 lines
Now that we are always explicitly passing
gcc_cv_libc_provides_ssp, there is no longer any reason to modify the gcc configure/configure.ac to take into account the musl case. When a musl toolchain is being built,BR2_TOOLCHAIN_HAS_SSPis always 'y', and therefore gcc_cv_libc_provides_ssp=yes is always passed when building gcc-initial and gcc-final.Signed-off-by Thomas Petazzoni <[email protected]>
Regards,
Yann E. MORIN.
Quoted 230 lines
--- package/gcc/4.7.4/900-musl-support.patch | 36 ---------------------------- package/gcc/4.8.5/900-musl-support.patch | 36 ---------------------------- package/gcc/4.9.3/900-musl-support.patch | 36 ---------------------------- package/gcc/5.2.0/904-musl-libc-config.patch | 36 ---------------------------- 4 files changed, 144 deletions(-)package/gcc/4.7.4/900-musl-support.patch +0
-36@@ -323,24 +323,6 @@ Index: b/gcc/configure =================================================================== --- a/gcc/configure +++ b/gcc/configure -@@ -26791,6 +26791,9 @@ - else - gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - # glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -26824,6 +26827,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail" @@ -26906,6 +26910,9 @@ gcc_cv_target_dl_iterate_phdr=no fi@@ -355,24 +337,6 @@ Index: b/gcc/configure.ac =================================================================== --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -4669,6 +4669,9 @@ - gcc_cv_libc_provides_ssp, - [gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - [# glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -4702,6 +4705,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], @@ -4767,6 +4771,9 @@ gcc_cv_target_dl_iterate_phdr=no fipackage/gcc/4.8.5/900-musl-support.patch +0
-36@@ -486,24 +486,6 @@ Index: b/gcc/configure =================================================================== --- a/gcc/configure +++ b/gcc/configure -@@ -26821,6 +26821,9 @@ - else - gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - # glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -26854,6 +26857,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail" @@ -26936,6 +26940,9 @@ gcc_cv_target_dl_iterate_phdr=no fi@@ -518,24 +500,6 @@ Index: b/gcc/configure.ac =================================================================== --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -4750,6 +4750,9 @@ - gcc_cv_libc_provides_ssp, - [gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - [# glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -4783,6 +4786,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], @@ -4848,6 +4852,9 @@ gcc_cv_target_dl_iterate_phdr=no fipackage/gcc/4.9.3/900-musl-support.patch +0
-36@@ -452,24 +452,6 @@ Index: b/gcc/configure =================================================================== --- a/gcc/configure +++ b/gcc/configure -@@ -27328,6 +27328,9 @@ - else - gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - # glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -27360,6 +27363,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail" @@ -27449,6 +27453,9 @@ gcc_cv_target_dl_iterate_phdr=no fi@@ -484,24 +466,6 @@ Index: b/gcc/configure.ac =================================================================== --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -5016,6 +5016,9 @@ - gcc_cv_libc_provides_ssp, - [gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - # glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -5042,6 +5045,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], @@ -5108,6 +5112,9 @@ gcc_cv_target_dl_iterate_phdr=no fipackage/gcc/5.2.0/904-musl-libc-config.patch +0
-36@@ -225,24 +225,6 @@ Index: b/gcc/configure =================================================================== --- a/gcc/configure +++ b/gcc/configure -@@ -27681,6 +27681,9 @@ - else - gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - # glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -27713,6 +27716,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail" @@ -27809,6 +27813,9 @@ gcc_cv_target_dl_iterate_phdr=no fi@@ -257,24 +239,6 @@ Index: b/gcc/configure.ac =================================================================== --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -5199,6 +5199,9 @@ - gcc_cv_libc_provides_ssp, - [gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - # glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -5225,6 +5228,7 @@ - # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], @@ -5298,6 +5302,9 @@ gcc_cv_target_dl_iterate_phdr=no fiSignature · 6 lines
2.6.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
cover Fix SSP related build failures
In reply to Thomas PetazzoniHello,
Quoted 4 lines · Thomas Petazzoni
Thomas Petazzoni (3):
toolchain: like glibc, musl always provides SSP support
gcc: pass explicitgcc_cv_libc_provides_sspalso to gcc-final
gcc: simplify musl patches for SSP support
Thanks to Yann's review, I've applied those patches.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com