Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: sys-devel/gcc/files/, sys-devel/gcc/
Date: Sun, 12 Sep 2021 08:41:17
Message-Id: 1631436050.b758c765940eb06ad8f58ae003180cbaad4e4888.sam@gentoo
1 commit: b758c765940eb06ad8f58ae003180cbaad4e4888
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 12 08:40:03 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 12 08:40:50 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=b758c765
7
8 sys-devel/gcc: add 10.3.0
9
10 Bug: https://bugs.gentoo.org/799170
11 Package-Manager: Portage-3.0.21-prefix, Repoman-3.0.3
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 sys-devel/gcc/Manifest | 4 +
15 .../gcc/files/gcc-10.3.0-clang-bootstrap.patch | 142 +++++++++++++++++++++
16 sys-devel/gcc/gcc-10.3.0-r2.ebuild | 114 +++++++++++++++++
17 3 files changed, 260 insertions(+)
18
19 diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
20 index a36c33e58f..4ecccea056 100644
21 --- a/sys-devel/gcc/Manifest
22 +++ b/sys-devel/gcc/Manifest
23 @@ -1,7 +1,11 @@
24 DIST ecj-4.5.jar 1470676 BLAKE2B 793c10ba09fd8040c0e1181204141aea16780c9c9088e07126e00da2b510af2ad6f58d876357d7e98cbb02d783a3be434469d5de1df134ccb8cc508e45028d80 SHA512 d4e1bf7538ace56e3d69fa91da5bbd16c272923b4de0a9d8dee23ea2b75f9f38c603de72fc4061df49285c450b63f3df211cee5270e9fffc5447445d1a9c9e4e
25 DIST gcc-10.2.0-patches-6.tar.bz2 24103 BLAKE2B f719012f86136ad9c4ea1397548caca6e69687534599a88cc25fe0e4f83dd7fd34c07375fa6e612e2b430e078c1a59913160cce07312e94fa1ce575a33e5457b SHA512 61d97dba29024c7a22806689ebf33f5cb9ce099230bcc344f2865b976c3fdfd8ebec5962eaffd0156de75eca58499ba785867bd4a4ac92c6f799ab1bee8844a1
26 DIST gcc-10.2.0.tar.xz 75004144 BLAKE2B 1d79397330354e61439283cac96a109bf78ffc726265442e6d3ec131f107589ab7349d6612836edd8c8512f7bcc1d901a65a0d5d925d28a5bf3ef5cc3f9787ee SHA512 42ae38928bd2e8183af445da34220964eb690b675b1892bbeb7cd5bb62be499011ec9a93397dba5e2fb681afadfc6f2767d03b9035b44ba9be807187ae6dc65e
27 +DIST gcc-10.3.0-patches-3.tar.bz2 18935 BLAKE2B 13eaf1e055b5b63069aed1575ed93f6bc822b5e3f2181ddfc88f4e7ff801f58997cd131b2efd79b90469b1f861db994feb2adcaecacf165442078f76e233fd9a SHA512 c3d6a6f32863cc0ff7c877314ff0c00a892e473f64d16b82d46b4a77aa97c3e7a575492d27f0d423acb2621c86c9a49bca0e26e45bda9e697495444fcac85084
28 +DIST gcc-10.3.0.tar.xz 76692288 BLAKE2B ac7898f5eb8a7c5f151a526d1bb38913a68b50a65e4d010ac09fa20b6c801c671c790d780f23ccb8e4ecdfc686f4aa588082ccc9eb5c80c7b0e30788f824c1eb SHA512 2b2dd7453d48a398c29eaebd1422b70341001b8c90a62aee51e83344e7fdd8a8e45f82a4a9165bd7edc76dada912c932f4b6632c5636760fec4c5d7e402b3f86
29 DIST gcc-11.0.0-patches-6.tar.bz2 12744 BLAKE2B 05e8d8b87cd1069bc6c03a6cbd61e5414148b7c6467e5b2ebf03af1493075280d8f1a5a123148f786724e3f813ef7fbb5f2728598ab4ab7879b4e649f592156b SHA512 9e873a40eca07e471a9832ed062575063144554ca306b60a9b5f7da61fa1f148a13fd5ea933c852d105931e452de1c6ab3cd7baf4f80da17b9d81eeb36c5b3fd
30 +DIST gcc-11.1.0-patches-1.tar.bz2 12130 BLAKE2B 4d763b83dba7875bbbe8bbb9b6c392791ba97037d17347548604ffa7c70b32fdafcd45b0722ae40aa3aa8cbb34b9f3e3aa399d0096e35e74f75b174aad0c032e SHA512 e4e363c6a81bbc423ec36b6c57801ea2a70961ee7d7d0333924c7012b2b6fd4008f53e9208b5d1f6025f9e74a95d46c121b4b8909827070b46091228688996a4
31 +DIST gcc-11.1.0.tar.xz 78877216 BLAKE2B fe617e776b0270d11adea21b5c37d889de90865c19ab82d1c37bbd5c5b9c583a98c174606c4f893ca4950a4233e2a58aae93ad6aa7ad33d4e78a31c72371c1ed SHA512 fd6bba0f67ff48069d03073d1a9b5e896383b1cfc9dde008e868e60a9ec5014a837d56af0ecbf467b3fb9b37ec74a676e819a18b44393a0a3c4280175b5d7ad8
32 DIST gcc-4.1.2-patches-1.5.tar.bz2 53576 BLAKE2B 16dcbf8bac85c3e95a8526ffd504f298ac09fbd79d8ee9f633782ffcd177eb0de256dc8ff36d45dc40dd8582b712e2ea0cd3b2063e3205d51cc022ad7befa7cc SHA512 3c7c15f740ec80aaa6f9c1ad77daeb2a2527f1719fbcc5d96d956e1fe1f24da961b1b030cf2bb631f1a0cc970f6462823e9a78441c9fd6b57f3645b04cd6a362
33 DIST gcc-4.1.2-uclibc-patches-1.0.tar.bz2 20980 BLAKE2B cfc7dd4c7a0b1ed80c491d4ad56b05b05ff308fdbed2faa1b9f15b10c0f7834ee4ffcb0df1619f959f7a1a5f315305b550665c232404a8a3306e3e615539a0c8 SHA512 57789f4236a3085136afa83be3cef677bd813afd258d67bfdbecd2058f497cd459366d5515044c0208ab753946dc951dac6a3889752ca6dae836d837c22ce33b
34 DIST gcc-4.1.2.tar.bz2 39707720 BLAKE2B 966b6a64c118456c7fb66eb2ad0dd84b1d53ad88dcbd146f446ef097a6975f5d6a7f1bcbbc4bfcd4e48b00eeb8054728e412db3d9818cff1f195e37859a4e510 SHA512 b97d3b72a3b0355611d5090b2c715b7a774f0e466a89326a0226c2809d12dfafb2d7c5a7af54bd5e00c135bbb6596f535e1a484740f7f1f691e8a57e6f0425cc
35
36 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
37 new file mode 100644
38 index 0000000000..b79f421695
39 --- /dev/null
40 +++ b/sys-devel/gcc/files/gcc-10.3.0-clang-bootstrap.patch
41 @@ -0,0 +1,142 @@
42 +Noticed when looking through git logs for Darwin but wasn't
43 +sure until I saw it in macports as well:
44 +https://raw.githubusercontent.com/macports/macports-ports/master/lang/gcc10/files/patch-gcc10-i686-clang-bootstrap-fix.diff
45 +https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=54258e22b0846aaa6bd3265f592feb161eecda75
46 +
47 +From 54258e22b0846aaa6bd3265f592feb161eecda75 Mon Sep 17 00:00:00 2001
48 +From: Iain Sandoe <iain@×××××××××.uk>
49 +Date: Sat, 3 Jul 2021 15:42:16 +0100
50 +Subject: [PATCH] Darwin, config: Revise host config fragment.
51 +
52 +There were two uses for the Darwin host config fragment:
53 +
54 +The first is to arrange for targets that support mdynamic-no-pic
55 +to be built with that enabled (since it makes a significant
56 +difference to the compiler performance). We can be more specific
57 +in the application of this, since it only applies to 32b hosts
58 +plus powerpc64-darwin9.
59 +
60 +The second was to work around a tool bug where -fno-PIE was not
61 +propagated to the link stage. This second use is redundant,
62 +since the buggy toolchain cannot bootstrap current GCC sources
63 +anyway.
64 +
65 +This makes the host fragment more specific and reduces the number
66 +of toolchains for which it is included which reduces clutter in
67 +configure lines.
68 +
69 +Signed-off-by: Iain Sandoe <iain@×××××××××.uk>
70 +
71 +config/ChangeLog:
72 +
73 + * mh-darwin: Make this specific to handling the
74 + mdynamic-no-pic case.
75 +
76 +ChangeLog:
77 +
78 + * configure: Regenerate.
79 + * configure.ac: Adjust cases for which it is necessary to
80 + include the Darwin host config fragment.
81 +---
82 + config/mh-darwin | 57 ++++++++++++++++++++++++++++--------------------
83 + configure | 2 +-
84 + configure.ac | 2 +-
85 + 3 files changed, 35 insertions(+), 26 deletions(-)
86 +
87 +diff --git a/config/mh-darwin b/config/mh-darwin
88 +index 148b73038c3..fb2bb5ad1d9 100644
89 +--- a/config/mh-darwin
90 ++++ b/config/mh-darwin
91 +@@ -1,29 +1,38 @@
92 + # The -mdynamic-no-pic ensures that the compiler executable is built without
93 +-# position-independent-code -- the usual default on Darwin. This fix speeds
94 +-# compiles by 3-5%. Don't add it if the compiler doesn't also support
95 +-# -mno-dynamic-no-pic to undo it.
96 +-DARWIN_MDYNAMIC_NO_PIC := \
97 +-`case ${host} in i?86-*-darwin* | powerpc-*-darwin*) \
98 +- $(CC) -S -xc /dev/null -o /dev/null -mno-dynamic-no-pic 2>/dev/null \
99 +- && echo -mdynamic-no-pic ;; esac`
100 +-DARWIN_GCC_MDYNAMIC_NO_PIC := \
101 +-`case ${host} in i?86-*-darwin* | powerpc-*-darwin*) \
102 +- $(CC) -S -xc /dev/null -o /dev/null -mno-dynamic-no-pic 2>/dev/null \
103 +- || echo -mdynamic-no-pic ;; esac`
104 ++# position-independent-code -- the usual default on Darwin. This speeds compiles
105 ++# by 8-20% (measurements made against GCC-11).
106 ++# However, we cannot add it unless the bootstrap compiler supports
107 ++# -mno-dynamic-no-pic to undo it, since libiberty, at least, needs this.
108 +
109 +-# ld on Darwin versions >= 10.7 defaults to PIE executables. Disable this for
110 +-# gcc components, since it is incompatible with our pch implementation.
111 +-DARWIN_NO_PIE := `case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;`
112 ++#Â We use Werror, since some versions of clang report unknown command line flags
113 ++# as a warning only.
114 +
115 +-BOOT_CFLAGS += $(DARWIN_MDYNAMIC_NO_PIC)
116 +-BOOT_LDFLAGS += $(DARWIN_NO_PIE)
117 ++# We only need to determine this for the host tool used to build stage1 (or a
118 ++# non-bootstrapped compiler), later stages will be built by GCC which supports
119 ++# the required flags.
120 +
121 +-# Similarly, for cross-compilation.
122 +-STAGE1_CFLAGS += $(DARWIN_MDYNAMIC_NO_PIC)
123 +-STAGE1_LDFLAGS += $(DARWIN_NO_PIE)
124 ++BOOTSTRAP_TOOL_CAN_USE_MDYNAMIC_NO_PIC := $(shell \
125 ++ $(CC) -S -xc /dev/null -o /dev/null -Werror -mno-dynamic-no-pic 2>/dev/null \
126 ++ && echo true)
127 +
128 +-# Without -mno-dynamic-no-pic support, add -mdynamic-no-pic just to later
129 +-# stages when we know it is built with gcc.
130 +-STAGE2_CFLAGS += $(DARWIN_GCC_MDYNAMIC_NO_PIC)
131 +-STAGE3_CFLAGS += $(DARWIN_GCC_MDYNAMIC_NO_PIC)
132 +-STAGE4_CFLAGS += $(DARWIN_GCC_MDYNAMIC_NO_PIC)
133 ++@if gcc-bootstrap
134 ++ifeq (${BOOTSTRAP_TOOL_CAN_USE_MDYNAMIC_NO_PIC},true)
135 ++STAGE1_CFLAGS += -mdynamic-no-pic
136 ++else
137 ++STAGE1_CFLAGS += -fPIC
138 ++endif
139 ++# Add -mdynamic-no-pic to later stages when we know it is built with GCC.
140 ++BOOT_CFLAGS += -mdynamic-no-pic
141 ++@endif gcc-bootstrap
142 ++
143 ++@unless gcc-bootstrap
144 ++ifeq (${BOOTSTRAP_TOOL_CAN_USE_MDYNAMIC_NO_PIC},true)
145 ++# FIXME: we should also enable this for cross and non-bootstrap builds but
146 ++# that needs amendment to libcc1.
147 ++# CFLAGS += -mdynamic-no-pic
148 ++# CXXFLAGS += -mdynamic-no-pic
149 ++else
150 ++CFLAGS += -fPIC
151 ++CXXFLAGS += -fPIC
152 ++endif
153 ++@endunless gcc-bootstrap
154 +diff --git a/configure b/configure
155 +index 732d1870b3d..85ab9915402 100755
156 +--- a/configure
157 ++++ b/configure
158 +@@ -4074,7 +4074,7 @@ fi
159 + hppa*-*)
160 + host_makefile_frag="config/mh-pa"
161 + ;;
162 +- *-*-darwin*)
163 ++ i?86-*-darwin[89]* | i?86-*-darwin1[0-7]* | powerpc*-*-darwin*)
164 + host_makefile_frag="config/mh-darwin"
165 + ;;
166 + powerpc-*-aix*)
167 +diff --git a/configure.ac b/configure.ac
168 +index 041ee249bac..1df038b04f3 100644
169 +--- a/configure.ac
170 ++++ b/configure.ac
171 +@@ -1318,7 +1318,7 @@ case "${host}" in
172 + hppa*-*)
173 + host_makefile_frag="config/mh-pa"
174 + ;;
175 +- *-*-darwin*)
176 ++ i?86-*-darwin[[89]]* | i?86-*-darwin1[[0-7]]* | powerpc*-*-darwin*)
177 + host_makefile_frag="config/mh-darwin"
178 + ;;
179 + powerpc-*-aix*)
180 +--
181 +2.27.0
182 +
183 +
184
185 diff --git a/sys-devel/gcc/gcc-10.3.0-r2.ebuild b/sys-devel/gcc/gcc-10.3.0-r2.ebuild
186 new file mode 100644
187 index 0000000000..b1e30bf1e1
188 --- /dev/null
189 +++ b/sys-devel/gcc/gcc-10.3.0-r2.ebuild
190 @@ -0,0 +1,114 @@
191 +# Copyright 1999-2021 Gentoo Authors
192 +# Distributed under the terms of the GNU General Public License v2
193 +
194 +EAPI="7"
195 +
196 +PATCH_VER="3"
197 +
198 +inherit toolchain
199 +
200 +KEYWORDS="~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
201 +
202 +RDEPEND=""
203 +BDEPEND="
204 + kernel_linux? ( ${CATEGORY}/binutils )
205 + kernel_Darwin? (
206 + || ( ${CATEGORY}/binutils-apple ${CATEGORY}/native-cctools )
207 + )"
208 +
209 +src_prepare() {
210 + has_version '>=sys-libs/glibc-2.32-r1' && rm -v "${WORKDIR}/patch/23_all_disable-riscv32-ABIs.patch"
211 + toolchain_src_prepare
212 +
213 + if use elibc_Cygwin; then
214 + sed -e '/0001-share-mingw-fset-stack-executable-with-cygwin.patch/d' \
215 + -i "${WORKDIR}/gcc-${CYGWINPORTS_GITREV}/gcc.cygport" || die
216 + fi
217 +
218 + # make sure 64-bits native targets don't screw up the linker paths
219 + eapply -p0 "${FILESDIR}"/no-libs-for-startfile.patch
220 + if use prefix; then
221 + eapply -p0 "${FILESDIR}"/4.5.2/prefix-search-dirs.patch
222 + # try /usr/lib32 in 32bit profile on x86_64-linux (needs
223 + # --enable-multilib), but this does make sense in prefix only
224 + eapply -p0 "${FILESDIR}"/${PN}-4.8.3-linux-x86-on-amd64.patch
225 + fi
226 +
227 + # make it have correct install_names on Darwin
228 + eapply -p1 "${FILESDIR}"/4.3.3/darwin-libgcc_s-installname.patch
229 +
230 + if [[ ${CHOST} == *-darwin* ]] ; then
231 + # Backport another bootstrapping fix when building with Clang
232 + eapply -p1 "${FILESDIR}"/gcc-10.3.0-clang-bootstrap.patch
233 + fi
234 +
235 + if [[ ${CHOST} == powerpc*-darwin* ]] ; then
236 + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44107
237 + sed -i -e 's|^ifeq (/usr/lib,|ifneq (/usr/lib,|' \
238 + libgcc/config/t-slibgcc-darwin || die
239 + fi
240 +
241 + # up macosx-version-min from 10.4 to 10.6 on Catalina, bug #767415
242 + if [[ ${CHOST} == *-darwin19 ]] ; then
243 + sed -i -e 's/=10.4/=10.6/' libgcc/config/t-darwin || die
244 + fi
245 +
246 + find . -name "configure" | xargs \
247 + sed -i -e '/^\s*10\.\*)/N' \
248 + -e '/^\s*10\.\*)\s*_lt_dar_allow_undefined/s/10\.\*/10.*|11.*/' || die
249 +
250 + # fix interoperation with Xcode 12.5, bug #799170
251 + eapply -p1 "${FILESDIR}"/${PN}-10.2.0-xcode-12.5.patch
252 +}
253 +
254 +src_configure() {
255 + local myconf=()
256 + case ${CTARGET}:" ${USE} " in
257 + powerpc*-darwin*)
258 + # bug #381179
259 + filter-flags "-mcpu=*" "-mtune=*"
260 + # bug #657522
261 + # A bug in configure checks whether -no-pie works, but the
262 + # compiler doesn't pass -no-pie onto the linker if -fno-PIE
263 + # isn't passed, so the configure check always finds -no-pie
264 + # is accepted. (Likewise, when -fno-PIE is passed, the
265 + # compiler passes -no_pie onto the linker.)
266 + # Since our linker doesn't grok this, avoid above checks to
267 + # be run
268 + # NOTE: later ld64 does grok -no_pie, not -no-pie (as checked)
269 + export gcc_cv_c_no_fpie=no
270 + export gcc_cv_no_pie=no
271 + ;;
272 + *-darwin20)
273 + # use sysroot with the linker, #756160
274 + export gcc_cv_ld_sysroot=yes
275 + ;;
276 + *-solaris*)
277 + # todo: some magic for native vs. GNU linking?
278 + myconf+=( --with-gnu-ld --with-gnu-as --enable-largefile )
279 + # Solaris 11 defines this in its headers, but that causes a
280 + # mismatch whilst compiling, bug #657514
281 + export ac_cv_func_aligned_alloc=no
282 + export ac_cv_func_memalign=no
283 + export ac_cv_func_posix_memalign=no
284 + ;;
285 + i[34567]86-*-linux*:*" prefix "*)
286 + # to allow the linux-x86-on-amd64.patch become useful, we need
287 + # to enable multilib, even if there is just one multilib option.
288 + myconf+=( --enable-multilib )
289 + if [[ ${CBUILD:-${CHOST}} == "${CHOST}" ]]; then
290 + # we might be on x86_64-linux, but don't do cross-compile, so
291 + # tell the host-compiler to really create 32bits (for stage1)
292 + # (real x86-linux-gcc also accept -m32).
293 + append-flags -m32
294 + fi
295 + ;;
296 + esac
297 +
298 + # Since GCC 4.1.2 some non-posix (?) /bin/sh compatible code is used, at
299 + # least on Solaris, and AIX /bin/sh is way too slow,
300 + # so force it to use $BASH (that portage uses) - it can't be EPREFIX
301 + # in case that doesn't exist yet
302 + export CONFIG_SHELL="${CONFIG_SHELL:-${BASH}}"
303 + toolchain_src_configure "${myconf[@]}"
304 +}