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 <daniel@octaforge.org>
This commit is contained in:
John 2020-08-09 22:36:02 +02:00 committed by q66
parent d4ba149f7c
commit 8024e29364
7 changed files with 96 additions and 160 deletions

View file

@ -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

View file

@ -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 @@

View file

@ -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

View file

@ -1,76 +0,0 @@
From 47467f3ab0fb2f2fcede81060fe8bb339d0909eb Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
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

View file

@ -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"

View file

@ -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<libgnarl/s-intman__posix.adb \
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
g-sercom.adb<libgnat/g-sercom__linux.adb \
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
+ s-tsmona.adb<libgnat/s-tsmona.adb \
a-exetim.adb<libgnarl/a-exetim__posix.adb \
a-exetim.ads<libgnarl/a-exetim__default.ads \
s-linux.ads<libgnarl/s-linux.ads \
@@ -2073,7 +2073,7 @@
@@ -2083,7 +2083,7 @@
s-osinte.adb<libgnarl/s-osinte__posix.adb \
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
g-sercom.adb<libgnat/g-sercom__linux.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
+ s-tsmona.adb<libgnat/s-tsmona.adb \
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
system.ads<libgnat/system-linux-ppc.ads
@@ -2102,7 +2102,7 @@
@@ -2112,7 +2112,7 @@
endif
# ARM linux, GNU eabi
@ -153,18 +153,18 @@ index 0d12f7e..a063b47 100644
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<libgnarl/a-intnam__linux.ads \
s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
@@ -2297,7 +2297,7 @@
@@ -2305,7 +2305,7 @@
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix-noaltstack.ads \
g-sercom.adb<libgnat/g-sercom__linux.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
+ s-tsmona.adb<libgnat/s-tsmona.adb \
$(ATOMICS_TARGET_PAIRS) \
$(ATOMICS_BUILTINS_TARGET_PAIRS) \
system.ads<libgnat/system-linux-ia64.ads
@@ -2394,7 +2394,7 @@
@@ -2401,7 +2401,7 @@
s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
s-taspri.ads<libgnarl/s-taspri__posix.ads \
g-sercom.adb<libgnat/g-sercom__linux.adb \
$(TRASYM_DWARF_UNIX_PAIRS) \
- s-tsmona.adb<libgnat/s-tsmona__linux.adb \
+ s-tsmona.adb<libgnat/s-tsmona.adb \

View file

@ -1,28 +1,33 @@
# Template file for 'gcc'
_majorver=9
_minorver=${_majorver}.3
_majorver=10
_minorver=${_majorver}.2
_patchver=${_minorver}.1
_gmp_version=6.2.0
_mpfr_version=4.0.2
_mpfr_version=4.1.0
_mpc_version=1.1.0
_isl_version=0.21
pkgname=gcc
version=${_minorver}.0
revision=9
# we are using a 10-stable git snapshot alpine is using in order
# to get regression fixes not yet incorporate into a stable release
# it should be possible to switch back to stable with 10.3 or 11
version=${_patchver}pre1
wrksrc=gcc-${version/pre/_pre}
revision=1
short_desc="GNU Compiler Collection"
maintainer="Enno Boland <gottox@voidlinux.org>"
homepage="http://gcc.gnu.org"
license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
# *-musl builders have issues fetching https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
distfiles="
${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz
https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz
https://gmplib.org/download/gmp/gmp-${_gmp_version}.tar.xz
https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
${GNU_SITE}/mpfr/mpfr-${_mpfr_version}.tar.xz
${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
checksum="71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1
checksum="772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526
1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f
6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
@ -33,10 +38,12 @@ replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
_have_gccgo=yes
# MIPS does not have libucontext yet
# no support for ppcle in gccgo (missing GOARCH and stuff)
# MIPS is untested and does not have go in crosstoolchains
# 32-bit PowerPC seems weirdly broken since the 10.x release
# 32-bit little endian PowerPC has no support at all (no GOARCH)
case "$XBPS_TARGET_MACHINE" in
mips*-musl|ppcle*) _have_gccgo=no ;;
ppc64*) ;;
mips*-musl|ppc*) _have_gccgo=no ;;
esac
if [ "$CHROOT_READY" ]; then
@ -171,6 +178,10 @@ post_extract() {
pre_configure() {
# _FORTIFY_SOURCE needs an optimization level.
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
# Do not run fixincludes
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
case "$XBPS_TARGET_MACHINE" in
*-musl)
patch -p0 -i ${FILESDIR}/libgnarl-musl.patch
@ -331,16 +342,16 @@ do_install() {
# Make version a symlink of major version to make all versions
# from the same series work automagically.
mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver}
ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_minorver} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}
# Ditto for c++ headers.
mv ${DESTDIR}/usr/include/c++/${version} \
mv ${DESTDIR}/usr/include/c++/${_patchver} \
${DESTDIR}/usr/include/c++/${_minorver}
ln -sfr ${DESTDIR}/usr/include/c++/${_minorver} \
${DESTDIR}/usr/include/c++/${version}
${DESTDIR}/usr/include/c++/${_patchver}
# cc symlink
ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
@ -349,7 +360,7 @@ do_install() {
# lto plugin symlink
vmkdir usr/lib/bfd-plugins
ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${version}/liblto_plugin.so \
ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_patchver}/liblto_plugin.so \
${DESTDIR}/usr/lib/bfd-plugins
# Remove "fixed" header
@ -364,8 +375,8 @@ do_install() {
rm -f ${DESTDIR}/usr/lib/*.py
# Remove more python stuff.
if [ -d ${DESTDIR}/usr/share/gcc-${version}/python ]; then
rm -rf ${DESTDIR}/usr/share/gcc-${version}/python
if [ -d ${DESTDIR}/usr/share/gcc-${_patchver}/python ]; then
rm -rf ${DESTDIR}/usr/share/gcc-${_patchver}/python
fi
# Install c89 and c99 wrappers and its manpages, from NetBSD.
@ -438,7 +449,7 @@ gcc-fortran_package() {
if [ "$CROSS_BUILD" ]; then
# A number of OMP modules are not built when cross
# compiling gcc. Copy them from the cross compiler.
local src="/usr/lib/gcc/${_triplet}/${version}/finclude"
local src="/usr/lib/gcc/${_triplet}/${_patchver}/finclude"
local dst="usr/lib/gcc/${_triplet}/${_minorver}/finclude"
for f in omp_lib.f90 omp_lib.h omp_lib.mod omp_lib_kinds.mod \
openacc.f90 openacc.mod openacc_kinds.mod openacc_lib.h; do
@ -697,8 +708,8 @@ libstdc++-devel_package() {
depends="libstdc++>=${_minorver}"
short_desc+=" - Standard C++ Library - development files"
pkg_install() {
vmove "usr/lib/libstdc++.*a"
vmove "usr/lib/libsupc++.*"
vmove "usr/lib/libstdc++*.a"
vmove "usr/lib/libsupc++.a"
vmove usr/include/c++
}
}