commit:     b758c765940eb06ad8f58ae003180cbaad4e4888
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 12 08:40:03 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Sep 12 08:40:50 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=b758c765

sys-devel/gcc: add 10.3.0

Bug: https://bugs.gentoo.org/799170
Package-Manager: Portage-3.0.21-prefix, Repoman-3.0.3
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/gcc/Manifest                             |   4 +
 .../gcc/files/gcc-10.3.0-clang-bootstrap.patch     | 142 +++++++++++++++++++++
 sys-devel/gcc/gcc-10.3.0-r2.ebuild                 | 114 +++++++++++++++++
 3 files changed, 260 insertions(+)

diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
index a36c33e58f..4ecccea056 100644
--- a/sys-devel/gcc/Manifest
+++ b/sys-devel/gcc/Manifest
@@ -1,7 +1,11 @@
 DIST ecj-4.5.jar 1470676 BLAKE2B 
793c10ba09fd8040c0e1181204141aea16780c9c9088e07126e00da2b510af2ad6f58d876357d7e98cbb02d783a3be434469d5de1df134ccb8cc508e45028d80
 SHA512 
d4e1bf7538ace56e3d69fa91da5bbd16c272923b4de0a9d8dee23ea2b75f9f38c603de72fc4061df49285c450b63f3df211cee5270e9fffc5447445d1a9c9e4e
 DIST gcc-10.2.0-patches-6.tar.bz2 24103 BLAKE2B 
f719012f86136ad9c4ea1397548caca6e69687534599a88cc25fe0e4f83dd7fd34c07375fa6e612e2b430e078c1a59913160cce07312e94fa1ce575a33e5457b
 SHA512 
61d97dba29024c7a22806689ebf33f5cb9ce099230bcc344f2865b976c3fdfd8ebec5962eaffd0156de75eca58499ba785867bd4a4ac92c6f799ab1bee8844a1
 DIST gcc-10.2.0.tar.xz 75004144 BLAKE2B 
1d79397330354e61439283cac96a109bf78ffc726265442e6d3ec131f107589ab7349d6612836edd8c8512f7bcc1d901a65a0d5d925d28a5bf3ef5cc3f9787ee
 SHA512 
42ae38928bd2e8183af445da34220964eb690b675b1892bbeb7cd5bb62be499011ec9a93397dba5e2fb681afadfc6f2767d03b9035b44ba9be807187ae6dc65e
+DIST gcc-10.3.0-patches-3.tar.bz2 18935 BLAKE2B 
13eaf1e055b5b63069aed1575ed93f6bc822b5e3f2181ddfc88f4e7ff801f58997cd131b2efd79b90469b1f861db994feb2adcaecacf165442078f76e233fd9a
 SHA512 
c3d6a6f32863cc0ff7c877314ff0c00a892e473f64d16b82d46b4a77aa97c3e7a575492d27f0d423acb2621c86c9a49bca0e26e45bda9e697495444fcac85084
+DIST gcc-10.3.0.tar.xz 76692288 BLAKE2B 
ac7898f5eb8a7c5f151a526d1bb38913a68b50a65e4d010ac09fa20b6c801c671c790d780f23ccb8e4ecdfc686f4aa588082ccc9eb5c80c7b0e30788f824c1eb
 SHA512 
2b2dd7453d48a398c29eaebd1422b70341001b8c90a62aee51e83344e7fdd8a8e45f82a4a9165bd7edc76dada912c932f4b6632c5636760fec4c5d7e402b3f86
 DIST gcc-11.0.0-patches-6.tar.bz2 12744 BLAKE2B 
05e8d8b87cd1069bc6c03a6cbd61e5414148b7c6467e5b2ebf03af1493075280d8f1a5a123148f786724e3f813ef7fbb5f2728598ab4ab7879b4e649f592156b
 SHA512 
9e873a40eca07e471a9832ed062575063144554ca306b60a9b5f7da61fa1f148a13fd5ea933c852d105931e452de1c6ab3cd7baf4f80da17b9d81eeb36c5b3fd
+DIST gcc-11.1.0-patches-1.tar.bz2 12130 BLAKE2B 
4d763b83dba7875bbbe8bbb9b6c392791ba97037d17347548604ffa7c70b32fdafcd45b0722ae40aa3aa8cbb34b9f3e3aa399d0096e35e74f75b174aad0c032e
 SHA512 
e4e363c6a81bbc423ec36b6c57801ea2a70961ee7d7d0333924c7012b2b6fd4008f53e9208b5d1f6025f9e74a95d46c121b4b8909827070b46091228688996a4
+DIST gcc-11.1.0.tar.xz 78877216 BLAKE2B 
fe617e776b0270d11adea21b5c37d889de90865c19ab82d1c37bbd5c5b9c583a98c174606c4f893ca4950a4233e2a58aae93ad6aa7ad33d4e78a31c72371c1ed
 SHA512 
fd6bba0f67ff48069d03073d1a9b5e896383b1cfc9dde008e868e60a9ec5014a837d56af0ecbf467b3fb9b37ec74a676e819a18b44393a0a3c4280175b5d7ad8
 DIST gcc-4.1.2-patches-1.5.tar.bz2 53576 BLAKE2B 
16dcbf8bac85c3e95a8526ffd504f298ac09fbd79d8ee9f633782ffcd177eb0de256dc8ff36d45dc40dd8582b712e2ea0cd3b2063e3205d51cc022ad7befa7cc
 SHA512 
3c7c15f740ec80aaa6f9c1ad77daeb2a2527f1719fbcc5d96d956e1fe1f24da961b1b030cf2bb631f1a0cc970f6462823e9a78441c9fd6b57f3645b04cd6a362
 DIST gcc-4.1.2-uclibc-patches-1.0.tar.bz2 20980 BLAKE2B 
cfc7dd4c7a0b1ed80c491d4ad56b05b05ff308fdbed2faa1b9f15b10c0f7834ee4ffcb0df1619f959f7a1a5f315305b550665c232404a8a3306e3e615539a0c8
 SHA512 
57789f4236a3085136afa83be3cef677bd813afd258d67bfdbecd2058f497cd459366d5515044c0208ab753946dc951dac6a3889752ca6dae836d837c22ce33b
 DIST gcc-4.1.2.tar.bz2 39707720 BLAKE2B 
966b6a64c118456c7fb66eb2ad0dd84b1d53ad88dcbd146f446ef097a6975f5d6a7f1bcbbc4bfcd4e48b00eeb8054728e412db3d9818cff1f195e37859a4e510
 SHA512 
b97d3b72a3b0355611d5090b2c715b7a774f0e466a89326a0226c2809d12dfafb2d7c5a7af54bd5e00c135bbb6596f535e1a484740f7f1f691e8a57e6f0425cc

diff --git a/sys-devel/gcc/files/gcc-10.3.0-clang-bootstrap.patch 
b/sys-devel/gcc/files/gcc-10.3.0-clang-bootstrap.patch
new file mode 100644
index 0000000000..b79f421695
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-10.3.0-clang-bootstrap.patch
@@ -0,0 +1,142 @@
+Noticed when looking through git logs for Darwin but wasn't
+sure until I saw it in macports as well:
+https://raw.githubusercontent.com/macports/macports-ports/master/lang/gcc10/files/patch-gcc10-i686-clang-bootstrap-fix.diff
+https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=54258e22b0846aaa6bd3265f592feb161eecda75
+
+From 54258e22b0846aaa6bd3265f592feb161eecda75 Mon Sep 17 00:00:00 2001
+From: Iain Sandoe <[email protected]>
+Date: Sat, 3 Jul 2021 15:42:16 +0100
+Subject: [PATCH] Darwin, config: Revise host config fragment.
+
+There were two uses for the Darwin host config fragment:
+
+The first is to arrange for targets that support mdynamic-no-pic
+to be built with that enabled (since it makes a significant
+difference to the compiler performance).  We can be more specific
+in the application of this, since it only applies to 32b hosts
+plus powerpc64-darwin9.
+
+The second was to work around a tool bug where -fno-PIE was not
+propagated to the link stage.  This second use is redundant,
+since the buggy toolchain cannot bootstrap current GCC sources
+anyway.
+
+This makes the host fragment more specific and reduces the number
+of toolchains for which it is included which reduces clutter in
+configure lines.
+
+Signed-off-by: Iain Sandoe <[email protected]>
+
+config/ChangeLog:
+
+       * mh-darwin: Make this specific to handling the
+       mdynamic-no-pic case.
+
+ChangeLog:
+
+       * configure: Regenerate.
+       * configure.ac: Adjust cases for which it is necessary to
+       include the Darwin host config fragment.
+---
+ config/mh-darwin | 57 ++++++++++++++++++++++++++++--------------------
+ configure        |  2 +-
+ configure.ac     |  2 +-
+ 3 files changed, 35 insertions(+), 26 deletions(-)
+
+diff --git a/config/mh-darwin b/config/mh-darwin
+index 148b73038c3..fb2bb5ad1d9 100644
+--- a/config/mh-darwin
++++ b/config/mh-darwin
+@@ -1,29 +1,38 @@
+ # The -mdynamic-no-pic ensures that the compiler executable is built without
+-# position-independent-code -- the usual default on Darwin. This fix speeds
+-# compiles by 3-5%.  Don't add it if the compiler doesn't also support
+-# -mno-dynamic-no-pic to undo it.
+-DARWIN_MDYNAMIC_NO_PIC := \
+-`case ${host} in i?86-*-darwin* | powerpc-*-darwin*) \
+-   $(CC) -S -xc /dev/null -o /dev/null -mno-dynamic-no-pic 2>/dev/null \
+-   && echo -mdynamic-no-pic ;; esac`
+-DARWIN_GCC_MDYNAMIC_NO_PIC := \
+-`case ${host} in i?86-*-darwin* | powerpc-*-darwin*) \
+-   $(CC) -S -xc /dev/null -o /dev/null -mno-dynamic-no-pic 2>/dev/null \
+-   || echo -mdynamic-no-pic ;; esac`
++# position-independent-code -- the usual default on Darwin. This speeds 
compiles
++# by 8-20% (measurements made against GCC-11).
++# However, we cannot add it unless the bootstrap compiler supports
++# -mno-dynamic-no-pic to undo it, since libiberty, at least, needs this.
+ 
+-# ld on Darwin versions >= 10.7 defaults to PIE executables. Disable this for
+-# gcc components, since it is incompatible with our pch implementation.
+-DARWIN_NO_PIE := `case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; 
esac;`
++#Â We use Werror, since some versions of clang report unknown command line 
flags
++# as a warning only.
+ 
+-BOOT_CFLAGS += $(DARWIN_MDYNAMIC_NO_PIC)
+-BOOT_LDFLAGS += $(DARWIN_NO_PIE)
++# We only need to determine this for the host tool used to build stage1 (or a
++# non-bootstrapped compiler), later stages will be built by GCC which supports
++# the required flags.
+ 
+-# Similarly, for cross-compilation.
+-STAGE1_CFLAGS += $(DARWIN_MDYNAMIC_NO_PIC)
+-STAGE1_LDFLAGS += $(DARWIN_NO_PIE)
++BOOTSTRAP_TOOL_CAN_USE_MDYNAMIC_NO_PIC := $(shell \
++  $(CC) -S -xc /dev/null -o /dev/null -Werror -mno-dynamic-no-pic 2>/dev/null 
\
++  && echo true)
+ 
+-# Without -mno-dynamic-no-pic support, add -mdynamic-no-pic just to later
+-# stages when we know it is built with gcc.
+-STAGE2_CFLAGS += $(DARWIN_GCC_MDYNAMIC_NO_PIC)
+-STAGE3_CFLAGS += $(DARWIN_GCC_MDYNAMIC_NO_PIC)
+-STAGE4_CFLAGS += $(DARWIN_GCC_MDYNAMIC_NO_PIC)
++@if gcc-bootstrap
++ifeq (${BOOTSTRAP_TOOL_CAN_USE_MDYNAMIC_NO_PIC},true)
++STAGE1_CFLAGS += -mdynamic-no-pic
++else
++STAGE1_CFLAGS += -fPIC
++endif
++# Add -mdynamic-no-pic to later stages when we know it is built with GCC.
++BOOT_CFLAGS += -mdynamic-no-pic
++@endif gcc-bootstrap
++
++@unless gcc-bootstrap
++ifeq (${BOOTSTRAP_TOOL_CAN_USE_MDYNAMIC_NO_PIC},true)
++# FIXME: we should also enable this for cross and non-bootstrap builds but
++# that needs amendment to libcc1.
++# CFLAGS += -mdynamic-no-pic
++# CXXFLAGS += -mdynamic-no-pic
++else
++CFLAGS += -fPIC
++CXXFLAGS += -fPIC
++endif
++@endunless gcc-bootstrap
+diff --git a/configure b/configure
+index 732d1870b3d..85ab9915402 100755
+--- a/configure
++++ b/configure
+@@ -4074,7 +4074,7 @@ fi
+   hppa*-*)
+     host_makefile_frag="config/mh-pa"
+     ;;
+-  *-*-darwin*)
++  i?86-*-darwin[89]* | i?86-*-darwin1[0-7]* | powerpc*-*-darwin*)
+     host_makefile_frag="config/mh-darwin"
+     ;;
+   powerpc-*-aix*)
+diff --git a/configure.ac b/configure.ac
+index 041ee249bac..1df038b04f3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1318,7 +1318,7 @@ case "${host}" in
+   hppa*-*)    
+     host_makefile_frag="config/mh-pa"
+     ;;
+-  *-*-darwin*)
++  i?86-*-darwin[[89]]* | i?86-*-darwin1[[0-7]]* | powerpc*-*-darwin*)
+     host_makefile_frag="config/mh-darwin"
+     ;;
+   powerpc-*-aix*)
+-- 
+2.27.0
+
+

diff --git a/sys-devel/gcc/gcc-10.3.0-r2.ebuild 
b/sys-devel/gcc/gcc-10.3.0-r2.ebuild
new file mode 100644
index 0000000000..b1e30bf1e1
--- /dev/null
+++ b/sys-devel/gcc/gcc-10.3.0-r2.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+PATCH_VER="3"
+
+inherit toolchain
+
+KEYWORDS="~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos 
~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+
+RDEPEND=""
+BDEPEND="
+       kernel_linux? ( ${CATEGORY}/binutils )
+       kernel_Darwin? (
+               || ( ${CATEGORY}/binutils-apple ${CATEGORY}/native-cctools )
+       )"
+
+src_prepare() {
+       has_version '>=sys-libs/glibc-2.32-r1' && rm -v 
"${WORKDIR}/patch/23_all_disable-riscv32-ABIs.patch"
+       toolchain_src_prepare
+
+       if use elibc_Cygwin; then
+               sed -e 
'/0001-share-mingw-fset-stack-executable-with-cygwin.patch/d' \
+                       -i "${WORKDIR}/gcc-${CYGWINPORTS_GITREV}/gcc.cygport" 
|| die
+       fi
+
+       # make sure 64-bits native targets don't screw up the linker paths
+       eapply -p0 "${FILESDIR}"/no-libs-for-startfile.patch
+       if use prefix; then
+               eapply -p0 "${FILESDIR}"/4.5.2/prefix-search-dirs.patch
+               # try /usr/lib32 in 32bit profile on x86_64-linux (needs
+               # --enable-multilib), but this does make sense in prefix only
+               eapply -p0 "${FILESDIR}"/${PN}-4.8.3-linux-x86-on-amd64.patch
+       fi
+
+       # make it have correct install_names on Darwin
+       eapply -p1 "${FILESDIR}"/4.3.3/darwin-libgcc_s-installname.patch
+
+       if [[ ${CHOST} == *-darwin* ]] ; then
+               # Backport another bootstrapping fix when building with Clang
+               eapply -p1 "${FILESDIR}"/gcc-10.3.0-clang-bootstrap.patch
+       fi
+
+       if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+               # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44107
+               sed -i -e 's|^ifeq (/usr/lib,|ifneq (/usr/lib,|' \
+                       libgcc/config/t-slibgcc-darwin || die
+       fi
+
+       # up macosx-version-min from 10.4 to 10.6 on Catalina, bug #767415
+       if [[ ${CHOST} == *-darwin19 ]] ; then
+               sed -i -e 's/=10.4/=10.6/' libgcc/config/t-darwin || die
+       fi
+
+       find .  -name "configure" | xargs \
+       sed -i -e '/^\s*10\.\*)/N' \
+               -e '/^\s*10\.\*)\s*_lt_dar_allow_undefined/s/10\.\*/10.*|11.*/' 
|| die
+
+       # fix interoperation with Xcode 12.5, bug #799170
+       eapply -p1 "${FILESDIR}"/${PN}-10.2.0-xcode-12.5.patch
+}
+
+src_configure() {
+       local myconf=()
+       case ${CTARGET}:" ${USE} " in
+               powerpc*-darwin*)
+                       # bug #381179
+                       filter-flags "-mcpu=*" "-mtune=*"
+                       # bug #657522
+                       # A bug in configure checks whether -no-pie works, but 
the
+                       # compiler doesn't pass -no-pie onto the linker if 
-fno-PIE
+                       # isn't passed, so the configure check always finds 
-no-pie
+                       # is accepted.  (Likewise, when -fno-PIE is passed, the
+                       # compiler passes -no_pie onto the linker.)
+                       # Since our linker doesn't grok this, avoid above 
checks to
+                       # be run
+                       # NOTE: later ld64 does grok -no_pie, not -no-pie (as 
checked)
+                       export gcc_cv_c_no_fpie=no
+                       export gcc_cv_no_pie=no
+               ;;
+               *-darwin20)
+                       # use sysroot with the linker, #756160
+                       export gcc_cv_ld_sysroot=yes
+                       ;;
+               *-solaris*)
+                       # todo: some magic for native vs. GNU linking?
+                       myconf+=( --with-gnu-ld --with-gnu-as 
--enable-largefile )
+                       # Solaris 11 defines this in its headers, but that 
causes a
+                       # mismatch whilst compiling, bug #657514
+                       export ac_cv_func_aligned_alloc=no
+                       export ac_cv_func_memalign=no
+                       export ac_cv_func_posix_memalign=no
+               ;;
+               i[34567]86-*-linux*:*" prefix "*)
+                       # to allow the linux-x86-on-amd64.patch become useful, 
we need
+                       # to enable multilib, even if there is just one 
multilib option.
+                       myconf+=( --enable-multilib )
+                       if [[ ${CBUILD:-${CHOST}} == "${CHOST}" ]]; then
+                               # we might be on x86_64-linux, but don't do 
cross-compile, so
+                               # tell the host-compiler to really create 
32bits (for stage1)
+                               # (real x86-linux-gcc also accept -m32).
+                               append-flags -m32
+                       fi
+               ;;
+       esac
+
+       # Since GCC 4.1.2 some non-posix (?) /bin/sh compatible code is used, at
+       # least on Solaris, and AIX /bin/sh is way too slow,
+       # so force it to use $BASH (that portage uses) - it can't be EPREFIX
+       # in case that doesn't exist yet
+       export CONFIG_SHELL="${CONFIG_SHELL:-${BASH}}"
+       toolchain_src_configure "${myconf[@]}"
+}

Reply via email to