diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch index 9729a49f09c..8a692c0d664 100644 --- a/srcpkgs/gcc/files/libssp-musl.patch +++ b/srcpkgs/gcc/files/libssp-musl.patch @@ -1,5 +1,9 @@ ---- gcc-6.1.0/gcc/gcc.c.orig -+++ gcc-6.1.0/gcc/gcc.c +First part taken from Alpine. + +Second part added to prevent gccgo from thinking it can -fsplit-stack on musl. + +--- a/gcc/gcc.c ++++ b/gcc/gcc.c @@ -876,9 +876,8 @@ #endif @@ -11,3 +15,29 @@ #else #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ "|fstack-protector-strong|fstack-protector-explicit" \ +--- a/gcc/config/i386/gnu-user-common.h ++++ b/gcc/config/i386/gnu-user-common.h +@@ -64,9 +64,3 @@ along with GCC; see the file COPYING3. If not see + + /* Static stack checking is supported by means of probes. */ + #define STACK_CHECK_STATIC_BUILTIN 1 +- +-/* We only build the -fsplit-stack support in libgcc if the +- assembler has full support for the CFI directives. */ +-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE +-#define TARGET_CAN_SPLIT_STACK +-#endif +--- a/gcc/config/i386/gnu.h ++++ b/gcc/config/i386/gnu.h +@@ -40,11 +40,6 @@ along with GCC. If not, see . + /* i386 glibc provides __stack_chk_guard in %gs:0x14. */ + #define TARGET_THREAD_SSP_OFFSET 0x14 + +-/* We only build the -fsplit-stack support in libgcc if the +- assembler has full support for the CFI directives. */ +-#if HAVE_GAS_CFI_PERSONALITY_DIRECTIVE +-#define TARGET_CAN_SPLIT_STACK +-#endif + /* We steal the last transactional memory word. */ + #define TARGET_THREAD_SPLIT_STACK_OFFSET 0x30 + #endif diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template index ae3947b47bf..ead6f05a498 100644 --- a/srcpkgs/gcc/template +++ b/srcpkgs/gcc/template @@ -36,11 +36,13 @@ _have_gccgo=yes # MIPS does not have libucontext yet # no support for ppcle in gccgo (missing GOARCH and stuff) case "$XBPS_TARGET_MACHINE" in - i686-musl|mips*-musl|ppcle*) _have_gccgo=no ;; + mips*-musl|ppcle*) _have_gccgo=no ;; esac if [ "$CHROOT_READY" ]; then hostmakedepends="tar texinfo perl flex" +else + _have_gccgo=no fi makedepends="zlib-devel" depends="binutils libgcc-devel-${version}_${revision} @@ -75,12 +77,13 @@ fi if [ "$CHROOT_READY" ]; then subpackages+=" gcc-fortran libgfortran-devel libgfortran" subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc" - if [ "$_have_gccgo" = "yes" ]; then - subpackages+=" gcc-go gcc-go-tools libgo-devel libgo" - # we need this for gcc-go on musl - if [ "$XBPS_TARGET_LIBC" = "musl" ]; then - makedepends+=" libucontext-devel" - fi +fi + +if [ "$_have_gccgo" = "yes" ]; then + subpackages+=" gcc-go gcc-go-tools libgo-devel libgo" + # we need this for gcc-go on musl + if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + makedepends+=" libucontext-devel" fi fi @@ -245,18 +248,15 @@ do_configure() { _args+=" --enable-fast-character" fi - if [ "$_have_gccgo" = "yes" -a -n "$CHROOT_READY" ]; then + if [ "$_have_gccgo" = "yes" ]; then _langs+=",go" fi - case "$XBPS_TARGET_MACHINE" in - *-musl) _args+=" --disable-libsanitizer";; - esac - case "$XBPS_TARGET_MACHINE" in - *-musl) _args+=" --disable-symvers" - _args+=" libat_cv_have_ifunc=no" - ;; - esac + if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + _args+=" --disable-libsanitizer" + _args+=" --disable-symvers" + _args+=" libat_cv_have_ifunc=no" + fi case "$XBPS_TARGET_MACHINE" in ppc*) _args+=" --disable-vtable-verify";;