From 8024e2936456bac1020a1f463adbfbc99eca863b Mon Sep 17 00:00:00 2001 From: John Date: Sun, 9 Aug 2020 22:36:02 +0200 Subject: [PATCH] gcc: update to 10.2.1pre1. Changed by q66: we're now using an upstream snapshot from alpine; this should allow us to get an assortment of regression fixes without having to patch them in also libssp fixes for musl, and typo fixes for libstdc++-devel pkg function also drop gccgo on 32-bit powerpc Co-authored-by: q66 --- common/shlibs | 8 +- srcpkgs/gcc/files/gccgo-musl.patch | 40 +++++----- srcpkgs/gcc/files/libssp-musl.patch | 29 ++++++- srcpkgs/gcc/patches/0010-ldbl128-config.patch | 76 ------------------- srcpkgs/gcc/patches/invalid_tls_model.patch | 26 ------- srcpkgs/gcc/patches/musl-ada.patch | 22 +++--- srcpkgs/gcc/template | 55 ++++++++------ 7 files changed, 96 insertions(+), 160 deletions(-) delete mode 100644 srcpkgs/gcc/patches/0010-ldbl128-config.patch delete mode 100644 srcpkgs/gcc/patches/invalid_tls_model.patch diff --git a/common/shlibs b/common/shlibs index e98f088266b..e030495fd63 100644 --- a/common/shlibs +++ b/common/shlibs @@ -57,7 +57,7 @@ libcc1plugin.so.0 gcc-6.2.1_1 libitm.so.1 libitm-4.7.3_1 liblto_plugin.so.0 gcc-4.7.3_1 libgcc_s.so.1 libgcc-4.4.0_1 -libgo.so.14 libgo-9.1.0_1 +libgo.so.16 libgo-10.2.0_1 libmpx.so.2 libmpx-6.2.1_1 libmpxwrappers.so.2 libmpx-6.2.1_1 libperl.so.5.32 perl-5.32.0_1 @@ -863,8 +863,8 @@ libgdkmm-2.4.so.1 gtkmm2-2.24.0_1 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1 libquadmath.so.0 libquadmath-4.4.0_1 libgfortran.so.5 libgfortran-8.2.0_1 -libgnarl-9.so libada-9.1.0_1 -libgnat-9.so libada-9.1.0_1 +libgnarl-10.so libada-10.2.0_1 +libgnat-10.so libada-10.2.0_1 libmozjs185.so.1.0 js-1.8.5_1 libwebp.so.7 libwebp-0.6.0_1 libwebpmux.so.3 libwebp-0.6.0_1 @@ -1732,7 +1732,7 @@ libextractor_common.so.1 libextractor-1.1_1 libpano13.so.3 libpano13-2.9.19_1 libubsan.so.1 libsanitizer-8.2.0_1 libtsan.so.0 libsanitizer-6.3.0_1 -libasan.so.5 libsanitizer-8.2.0_1 +libasan.so.6 libsanitizer-10.2.0_1 liblsan.so.0 libsanitizer-6.3.0_1 libvtv.so.0 libvtv-6.3.0_1 libatomic.so.1 libatomic-4.9.0_1 diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch index cc3ed7d17ae..9b3f3af9b7f 100644 --- a/srcpkgs/gcc/files/gccgo-musl.patch +++ b/srcpkgs/gcc/files/gccgo-musl.patch @@ -162,30 +162,30 @@ URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc fi if test "${GOOS}" = "aix"; then ---- libgo/runtime/go-signal.c -+++ libgo/runtime/go-signal.c -@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused))) - #endif - #ifdef __PPC__ - #ifdef __linux__ +--- libgo/runtime/go-signal.c 2020-07-23 08:35:19.004402840 +0200 ++++ - 2020-08-09 21:35:54.352886232 +0200 +@@ -224,7 +224,11 @@ + #elif defined(__alpha__) && defined(__linux__) + ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.sc_pc; + #elif defined(__PPC__) && defined(__linux__) - ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip; -+ #ifdef __PPC64__ -+ ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32]; -+ #else -+ ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32]; -+ #endif - #endif - #ifdef _AIX ++ #ifdef __PPC64__ ++ ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32]; ++ #else ++ ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32]; ++ #endif + #elif defined(__PPC__) && defined(_AIX) ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar; -@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u - #endif - #endif - --#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) -+#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__) - #ifdef __linux__ + #elif defined(__aarch64__) && defined(__linux__) +@@ -333,7 +337,7 @@ + runtime_printf("sp %X\n", m->sc_regs[30]); + runtime_printf("pc %X\n", m->sc_pc); + } +-#elif defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__linux__) ++#elif defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__linux__) && defined(__GLIBC__) { mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext; + int i; --- libgo/sysinfo.c +++ libgo/sysinfo.c @@ -73,9 +73,6 @@ diff --git a/srcpkgs/gcc/files/libssp-musl.patch b/srcpkgs/gcc/files/libssp-musl.patch index 8d47b442aa1..e0b84f9acc9 100644 --- a/srcpkgs/gcc/files/libssp-musl.patch +++ b/srcpkgs/gcc/files/libssp-musl.patch @@ -4,9 +4,16 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl. --- gcc/gcc.c +++ gcc/gcc.c -@@ -876,9 +876,8 @@ +@@ -874,10 +874,15 @@ proper position among the other output files. */ + #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}" #endif ++#ifdef ENABLE_DEFAULT_SSP ++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} " ++#else ++#define NO_SSP_SPEC "" ++#endif ++ #ifndef LINK_SSP_SPEC #ifdef TARGET_LIBC_PROVIDES_SSP -#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ @@ -15,6 +22,26 @@ Second part added to prevent gccgo from thinking it can -fsplit-stack on musl. #else #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ "|fstack-protector-strong|fstack-protector-explicit" \ +@@ -1155,7 +1160,7 @@ static const char *cc1_options = + %{-version:--version}\ + %{-help=*:--help=%*}\ + %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\ +- %{fsyntax-only:-o %j} %{-param*}\ ++ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\ + %{coverage:-fprofile-arcs -ftest-coverage}\ + %{fprofile-arcs|fprofile-generate*|coverage:\ + %{!fprofile-update=single:\ +--- gcc/params.opt ++++ gcc/params.opt +@@ -853,7 +853,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim + The maximum number of SSA_NAME assignments to follow in determining a value. + + -param=ssp-buffer-size= +-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization ++Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization + The lower bound for a buffer to be considered for stack smashing protection. + + -param=stack-clash-protection-guard-size= --- gcc/config/i386/gnu-user-common.h +++ gcc/config/i386/gnu-user-common.h @@ -64,9 +64,3 @@ along with GCC; see the file COPYING3. If not see diff --git a/srcpkgs/gcc/patches/0010-ldbl128-config.patch b/srcpkgs/gcc/patches/0010-ldbl128-config.patch deleted file mode 100644 index 35869dd5d0f..00000000000 --- a/srcpkgs/gcc/patches/0010-ldbl128-config.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 47467f3ab0fb2f2fcede81060fe8bb339d0909eb Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy -Date: Wed, 28 Feb 2018 00:54:05 +0000 -Subject: [PATCH 10/12] ldbl128 config - ---- - gcc/configure | 13 +++++++++++++ - gcc/configure.ac | 16 ++++++++++++++-- - 2 files changed, 27 insertions(+), 2 deletions(-) - -diff --git gcc/configure gcc/configure -index 6121e163259..07ff8597d48 100755 ---- gcc/configure -+++ gcc/configure -@@ -29309,6 +29309,15 @@ if test "${with_long_double_128+set}" = set; then : - withval=$with_long_double_128; gcc_cv_target_ldbl128="$with_long_double_128" - else - -+ case "$target" in -+ s390*-*-linux-musl*) -+ gcc_cv_target_ldbl128=yes -+ ;; -+ powerpc*-*-linux-musl*) -+ gcc_cv_target_ldbl128=no -+ ;; -+ *) -+ - if test $glibc_version_major -gt 2 \ - || ( test $glibc_version_major -eq 2 && test $glibc_version_minor -ge 4 ); then : - gcc_cv_target_ldbl128=yes -@@ -29320,6 +29329,10 @@ else - && gcc_cv_target_ldbl128=yes - - fi -+ -+ ;; -+ esac -+ - fi - - ;; -diff --git gcc/configure.ac gcc/configure.ac -index b066cc609e1..6c15ed898c0 100644 ---- gcc/configure.ac -+++ gcc/configure.ac -@@ -5971,13 +5971,25 @@ case "$target" in - AC_ARG_WITH(long-double-128, - [AS_HELP_STRING([--with-long-double-128], - [use 128-bit long double by default])], -- gcc_cv_target_ldbl128="$with_long_double_128", -+ gcc_cv_target_ldbl128="$with_long_double_128", [ -+ case "$target" in -+ s390*-*-linux-musl*) -+ gcc_cv_target_ldbl128=yes -+ ;; -+ powerpc*-*-linux-musl*) -+ gcc_cv_target_ldbl128=no -+ ;; -+ *)] - [GCC_GLIBC_VERSION_GTE_IFELSE([2], [4], [gcc_cv_target_ldbl128=yes], [ - [gcc_cv_target_ldbl128=no - grep '^[ ]*#[ ]*define[ ][ ]*__LONG_DOUBLE_MATH_OPTIONAL' \ - $target_header_dir/bits/wordsize.h > /dev/null 2>&1 \ - && gcc_cv_target_ldbl128=yes -- ]])]) -+ ]])] -+ [ -+ ;; -+ esac -+ ]) - ;; - esac - if test x$gcc_cv_target_ldbl128 = xyes; then --- -2.17.1 - diff --git a/srcpkgs/gcc/patches/invalid_tls_model.patch b/srcpkgs/gcc/patches/invalid_tls_model.patch deleted file mode 100644 index 598cde5cb3a..00000000000 --- a/srcpkgs/gcc/patches/invalid_tls_model.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- libgomp/configure.tgt 2018-11-08 18:13:04.000000000 +0100 -+++ libgomp/configure.tgt 2019-06-29 20:06:31.972950350 +0200 -@@ -10,23 +10,6 @@ - # XCFLAGS Add extra compile flags to use. - # XLDFLAGS Add extra link flags to use. - --# Optimize TLS usage by avoiding the overhead of dynamic allocation. --if test $gcc_cv_have_tls = yes ; then -- case "${target}" in -- -- *-*-k*bsd*-gnu*) -- ;; -- -- *-*-linux* | *-*-gnu*) -- XCFLAGS="${XCFLAGS} -ftls-model=initial-exec -DUSING_INITIAL_EXEC_TLS" -- ;; -- -- *-*-rtems*) -- XCFLAGS="${XCFLAGS} -ftls-model=local-exec" -- ;; -- esac --fi -- - # Since we require POSIX threads, assume a POSIX system by default. - config_path="posix" - diff --git a/srcpkgs/gcc/patches/musl-ada.patch b/srcpkgs/gcc/patches/musl-ada.patch index 5e91b0476a3..61823684da5 100644 --- a/srcpkgs/gcc/patches/musl-ada.patch +++ b/srcpkgs/gcc/patches/musl-ada.patch @@ -124,27 +124,27 @@ index 0d12f7e..a063b47 100644 #endif #if defined (_WIN32) ---- gcc/ada/Makefile.rtl 2019-05-14 21:18:45.217455681 +0200 -+++ gcc/ada/Makefile.rtl 2019-05-14 21:21:30.686464218 +0200 -@@ -1521,7 +1521,7 @@ +--- gcc/ada/Makefile.rtl 2020-07-23 08:35:17.052381336 +0200 ++++ - 2020-08-09 19:38:24.230351406 +0200 +@@ -1533,7 +1533,7 @@ + s-intman.adb