Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/riscv:master commit in: sys-devel/gcc/files/4.1.0/, sys-devel/gcc/files/, sys-devel/gcc/, ...
Date: Wed, 02 Sep 2020 19:25:23
Message-Id: 1599074571.67f00f792a4b7cf8ab7f55bd0c0fac5099326861.dilfridge@gentoo
1 commit: 67f00f792a4b7cf8ab7f55bd0c0fac5099326861
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 2 19:22:51 2020 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 2 19:22:51 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/riscv.git/commit/?id=67f00f79
7
8 sys-devel/gcc: Copy from main tree
9
10 Package-Manager: Portage-2.3.103, Repoman-2.3.23
11 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
12
13 sys-devel/gcc/Manifest | 2 +
14 .../gcc/files/3.3.4/libffi-without-libgcj.patch | 22 ++++++
15 .../files/3.4.3/libffi-nogcj-lib-path-fix.patch | 40 ++++++++++
16 .../gcc/files/3.4.3/libffi-without-libgcj.patch | 40 ++++++++++
17 .../gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch | 63 ++++++++++++++++
18 .../gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch | 40 ++++++++++
19 .../gcc-4.1.0-fast-math-i386-Os-workaround.patch | 64 ++++++++++++++++
20 sys-devel/gcc/files/gcc-4.9.4-bootstrap.patch | 66 ++++++++++++++++
21 sys-devel/gcc/files/gcc-9.2.0-neg-insn-cost.patch | 29 ++++++++
22 sys-devel/gcc/files/gcc-configure-LANG.patch | 64 ++++++++++++++++
23 sys-devel/gcc/files/gcc-configure-texinfo.patch | 16 ++++
24 sys-devel/gcc/files/gcc-spec-env-r1.patch | 87 ++++++++++++++++++++++
25 sys-devel/gcc/files/gcc-spec-env.patch | 42 +++++++++++
26 sys-devel/gcc/gcc-10.2.0-r1.ebuild | 13 ++++
27 sys-devel/gcc/metadata.xml | 36 +++++++++
28 15 files changed, 624 insertions(+)
29
30 diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
31 new file mode 100644
32 index 0000000..ac1a8f2
33 --- /dev/null
34 +++ b/sys-devel/gcc/Manifest
35 @@ -0,0 +1,2 @@
36 +DIST gcc-10.2.0-patches-2.tar.bz2 17701 BLAKE2B bed0cf2dcb6b2e35dbd86c43db617cfa0a0973b3d55bd6e12baf9e6495afd0fec855fefd223172c23f11449769996c18359abacfac36f62681310c861d5d2850 SHA512 6ebf5875ecc9f10dea67d4793fcc47178ddd6abe8959fc0390c6ff967fba7318013b4bf251abf451999b86697e97390c8698685b12086956c8e6bc2e97708bc9
37 +DIST gcc-10.2.0.tar.xz 75004144 BLAKE2B 1d79397330354e61439283cac96a109bf78ffc726265442e6d3ec131f107589ab7349d6612836edd8c8512f7bcc1d901a65a0d5d925d28a5bf3ef5cc3f9787ee SHA512 42ae38928bd2e8183af445da34220964eb690b675b1892bbeb7cd5bb62be499011ec9a93397dba5e2fb681afadfc6f2767d03b9035b44ba9be807187ae6dc65e
38
39 diff --git a/sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch b/sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch
40 new file mode 100644
41 index 0000000..507d42f
42 --- /dev/null
43 +++ b/sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch
44 @@ -0,0 +1,22 @@
45 +--- configure.in.old 2004-06-26 07:01:06.000000000 +0200
46 ++++ configure.in 2004-06-26 07:02:55.000000000 +0200
47 +@@ -52,8 +52,7 @@
48 + host_tools="texinfo byacc flex bison binutils ld gas gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool grep diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils snavigator libtool gettext zip fastjar"
49 +
50 + # libgcj represents the runtime libraries only used by gcj.
51 +-libgcj="target-libffi \
52 +- target-boehm-gc \
53 ++libgcj="target-boehm-gc \
54 + target-zlib \
55 + target-qthreads \
56 + target-libjava"
57 +@@ -66,7 +65,8 @@
58 + target-newlib \
59 + ${libstdcxx_version} \
60 + target-libf2c \
61 +- ${libgcj}
62 ++ ${libgcj} \
63 ++ target-libffi \
64 + target-libobjc"
65 +
66 + # these tools are built using the target libs, and are intended to run only
67
68 diff --git a/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch b/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch
69 new file mode 100644
70 index 0000000..b5195e4
71 --- /dev/null
72 +++ b/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch
73 @@ -0,0 +1,40 @@
74 +diff -ur gcc-3.4.3/libffi/Makefile.in gcc-3.4.3-ffi-fixes/libffi/Makefile.in
75 +--- gcc-3.4.3/libffi/Makefile.in 2003-11-22 08:41:32.000000000 -0500
76 ++++ gcc-3.4.3-ffi-fixes/libffi/Makefile.in 2004-11-28 17:31:50.000000000 -0500
77 +@@ -89,7 +89,7 @@
78 + libffi_basedir = @libffi_basedir@
79 + tool_include_dir = @tool_include_dir@
80 + toolexecdir = @toolexecdir@
81 +-toolexeclibdir = @toolexeclibdir@
82 ++toolexeclibdir = @toolexeclibdir@/@gcc_version@
83 +
84 + AUTOMAKE_OPTIONS = cygnus
85 +
86 +diff -ur gcc-3.4.3/libffi/configure gcc-3.4.3-ffi-fixes/libffi/configure
87 +--- gcc-3.4.3/libffi/configure 2004-05-18 05:08:39.000000000 -0400
88 ++++ gcc-3.4.3-ffi-fixes/libffi/configure 2004-11-28 17:48:19.000000000 -0500
89 +@@ -3800,8 +3800,8 @@
90 + toolexecdir='$(exec_prefix)/$(target_alias)'
91 + toolexeclibdir='$(toolexecdir)/lib'
92 + else
93 +- toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
94 +- toolexeclibdir='$(libdir)'
95 ++ toolexecdir='$(libdir)/gcc/$(target_alias)'
96 ++ toolexeclibdir='$(libdir)/gcc/$(target_alias)/$(gcc-version)'
97 + fi
98 + multi_os_directory=`$CC -print-multi-os-directory`
99 + case $multi_os_directory in
100 +diff -ur gcc-3.4.3/libffi/configure.in gcc-3.4.3-ffi-fixes/libffi/configure.in
101 +--- gcc-3.4.3/libffi/configure.in 2004-04-27 01:10:19.000000000 -0400
102 ++++ gcc-3.4.3-ffi-fixes/libffi/configure.in 2004-11-28 17:40:30.000000000 -0500
103 +@@ -225,8 +225,8 @@
104 + toolexecdir='$(exec_prefix)/$(target_alias)'
105 + toolexeclibdir='$(toolexecdir)/lib'
106 + else
107 +- toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
108 +- toolexeclibdir='$(libdir)'
109 ++ toolexecdir='$(libdir)/gcc/$(target_alias)'
110 ++ toolexeclibdir='$(libdir)/gcc/$(target_alias)/$(gcc_version)'
111 + fi
112 + multi_os_directory=`$CC -print-multi-os-directory`
113 + case $multi_os_directory in
114
115 diff --git a/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch b/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch
116 new file mode 100644
117 index 0000000..b270a06
118 --- /dev/null
119 +++ b/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch
120 @@ -0,0 +1,40 @@
121 +--- configure.in.orig 2004-08-03 00:53:36.000000000 +0200
122 ++++ configure.in 2004-08-03 00:52:35.000000000 +0200
123 +@@ -136,8 +136,7 @@
124 + host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
125 +
126 + # libgcj represents the runtime libraries only used by gcj.
127 +-libgcj="target-libffi \
128 +- target-boehm-gc \
129 ++libgcj="target-boehm-gc \
130 + target-zlib \
131 + target-qthreads \
132 + target-libjava"
133 +@@ -150,6 +150,7 @@
134 + target-libstdc++-v3 \
135 + target-libf2c \
136 + ${libgcj} \
137 ++ target-libffi \
138 + target-libobjc"
139 +
140 + # these tools are built using the target libraries, and are intended to
141 +--- configure~ 2004-08-28 02:31:04.000000000 +0200
142 ++++ configure 2004-08-28 10:55:28.000000000 +0200
143 +@@ -876,8 +876,7 @@
144 + host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
145 +
146 + # libgcj represents the runtime libraries only used by gcj.
147 +-libgcj="target-libffi \
148 +- target-boehm-gc \
149 ++libgcj="target-boehm-gc \
150 + target-zlib \
151 + target-qthreads \
152 + target-libjava"
153 +@@ -891,6 +890,7 @@
154 + target-libstdc++-v3 \
155 + target-libf2c \
156 + ${libgcj} \
157 ++ target-libffi \
158 + target-libobjc"
159 +
160 + # these tools are built using the target libraries, and are intended to
161
162 diff --git a/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch b/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch
163 new file mode 100644
164 index 0000000..0389543
165 --- /dev/null
166 +++ b/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch
167 @@ -0,0 +1,63 @@
168 +Some notes on the 'bootstrap with or without libc headers' debate:
169 +http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
170 +http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
171 +
172 +--- gcc/config/sh/linux.h
173 ++++ gcc/config/sh/linux.h
174 +@@ -145,6 +145,7 @@
175 + /* Do code reading to identify a signal frame, and set the frame
176 + state data appropriately. See unwind-dw2.c for the structs. */
177 +
178 ++#ifndef inhibit_libc
179 + #ifdef IN_LIBGCC2
180 + #include <signal.h>
181 + #include <sys/ucontext.h>
182 +@@ -295,6 +296,7 @@
183 +
184 + #endif /* defined (__SH5__) */
185 + #endif /* IN_LIBGCC2 */
186 ++#endif /* inhibit_libc */
187 +
188 + /* For SH3 and SH4, we use a slot of the unwind frame which correspond
189 + to a fake register number 16 as a placeholder for the return address
190 +--- gcc/config/i386/linux.h
191 ++++ gcc/config/i386/linux.h
192 +@@ -208,6 +208,7 @@
193 + /* Do code reading to identify a signal frame, and set the frame
194 + state data appropriately. See unwind-dw2.c for the structs. */
195 +
196 ++#ifndef inhibit_libc
197 + #ifdef IN_LIBGCC2
198 + /* There's no sys/ucontext.h for some (all?) libc1, so no
199 + signal-turned-exceptions for them. There's also no configure-run for
200 +@@ -272,3 +273,4 @@
201 + } while (0)
202 + #endif /* not USE_GNULIBC_1 */
203 + #endif /* IN_LIBGCC2 */
204 ++#endif /* inhibit_libc */
205 +--- gcc/config/alpha/linux.h
206 ++++ gcc/config/alpha/linux.h
207 +@@ -73,6 +73,7 @@
208 + /* Do code reading to identify a signal frame, and set the frame
209 + state data appropriately. See unwind-dw2.c for the structs. */
210 +
211 ++#ifndef inhibit_libc
212 + #ifdef IN_LIBGCC2
213 + #include <signal.h>
214 + #include <sys/ucontext.h>
215 +@@ -122,3 +123,4 @@
216 + (FS)->retaddr_column = 64; \
217 + goto SUCCESS; \
218 + } while (0)
219 ++#endif /* inhibit_libc */
220 +--- gcc/config.gcc
221 ++++ gcc/config.gcc
222 +@@ -321,7 +321,7 @@
223 + need_64bit_hwint=yes
224 + ;;
225 + # Note the 'l'; we need to be able to match e.g. "shle" or "shl".
226 +-sh[123456789l]*-*-*)
227 ++sh[123456789lbe]*-*-*)
228 + cpu_type=sh
229 + need_64bit_hwint=yes
230 + ;;
231
232 diff --git a/sys-devel/gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch
233 new file mode 100644
234 index 0000000..523caa4
235 --- /dev/null
236 +++ b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch
237 @@ -0,0 +1,40 @@
238 +Some notes on the 'bootstrap with or without libc headers' debate:
239 +http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
240 +http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
241 +
242 +--- gcc/unwind-dw2.c
243 ++++ gcc/unwind-dw2.c
244 +@@ -253,9 +253,11 @@
245 + }
246 + #endif
247 +
248 ++#ifndef inhibit_libc
249 + #ifdef MD_UNWIND_SUPPORT
250 + #include MD_UNWIND_SUPPORT
251 + #endif
252 ++#endif
253 +
254 + /* Extract any interesting information from the CIE for the translation
255 + unit F belongs to. Return a pointer to the byte after the augmentation,
256 +--- gcc/configure
257 ++++ gcc/configure
258 +@@ -12857,7 +12857,7 @@ then
259 + | powerpc*-*-*,powerpc64*-*-*)
260 + CROSS="$CROSS -DNATIVE_CROSS" ;;
261 + esac
262 +-elif test "x$TARGET_SYSTEM_ROOT" != x; then
263 ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
264 + SYSTEM_HEADER_DIR=$build_system_header_dir
265 + fi
266 +
267 +--- gcc/configure.ac
268 ++++ gcc/configure.ac
269 +@@ -1717,7 +1717,7 @@ then
270 + | powerpc*-*-*,powerpc64*-*-*)
271 + CROSS="$CROSS -DNATIVE_CROSS" ;;
272 + esac
273 +-elif test "x$TARGET_SYSTEM_ROOT" != x; then
274 ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
275 + SYSTEM_HEADER_DIR=$build_system_header_dir
276 + fi
277 +
278
279 diff --git a/sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch
280 new file mode 100644
281 index 0000000..6090d66
282 --- /dev/null
283 +++ b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch
284 @@ -0,0 +1,64 @@
285 +workaround for lame stack packing on i386 ...
286 +
287 + - build gcc with -Os (crtfastmath.o to be specific)
288 + - crtfastmath.o is installed into gcc libdir
289 + - run gcc with -ffast-math and get crtfastmath.o linked in
290 + - resulting compiled app segfaults due to init code in
291 + crtfastmath.o that has mis-aligned structure on stack
292 +
293 +http://bugs.gentoo.org/147020
294 +http://gcc.gnu.org/PR28621
295 +
296 +this is supposed to be fixed in current 4.1 branch, but i'm unable to get
297 +the fix to work so until i can figure out what i'm doing wrong, we'll use
298 +this workaround for now.
299 +
300 +--- gcc-4.1.1/gcc/config/i386/crtfastmath.c
301 ++++ gcc-4.1.1/gcc/config/i386/crtfastmath.c
302 +@@ -37,6 +37,23 @@
303 + #define FXSAVE (1 << 24)
304 + #define SSE (1 << 25)
305 +
306 ++struct
307 ++{
308 ++ unsigned short int cwd;
309 ++ unsigned short int swd;
310 ++ unsigned short int twd;
311 ++ unsigned short int fop;
312 ++ long int fip;
313 ++ long int fcs;
314 ++ long int foo;
315 ++ long int fos;
316 ++ long int mxcsr;
317 ++ long int mxcsr_mask;
318 ++ long int st_space[32];
319 ++ long int xmm_space[32];
320 ++ long int padding[56];
321 ++} __attribute__ ((aligned (16))) fxsave;
322 ++
323 + static void __attribute__((constructor))
324 + set_fast_math (void)
325 + {
326 +@@ -75,22 +92,6 @@
327 + if (edx & FXSAVE)
328 + {
329 + /* Check if DAZ is available. */
330 +- struct
331 +- {
332 +- unsigned short int cwd;
333 +- unsigned short int swd;
334 +- unsigned short int twd;
335 +- unsigned short int fop;
336 +- long int fip;
337 +- long int fcs;
338 +- long int foo;
339 +- long int fos;
340 +- long int mxcsr;
341 +- long int mxcsr_mask;
342 +- long int st_space[32];
343 +- long int xmm_space[32];
344 +- long int padding[56];
345 +- } __attribute__ ((aligned (16))) fxsave;
346 +
347 + __builtin_memset (&fxsave, 0, sizeof (fxsave));
348 +
349
350 diff --git a/sys-devel/gcc/files/gcc-4.9.4-bootstrap.patch b/sys-devel/gcc/files/gcc-4.9.4-bootstrap.patch
351 new file mode 100644
352 index 0000000..aed1ad0
353 --- /dev/null
354 +++ b/sys-devel/gcc/files/gcc-4.9.4-bootstrap.patch
355 @@ -0,0 +1,66 @@
356 +From 41a4aa66eac45c8862a79351647ec06dd03bd1f5 Mon Sep 17 00:00:00 2001
357 +From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
358 +Date: Sat, 13 Dec 2014 11:24:37 +0000
359 +Subject: [PATCH] PR bootstrap/64023 * Makefile.tpl
360 + (EXTRA_TARGET_FLAGS): Set STAGE1_LDFLAGS to POSTSTAGE1_LDFLAGS and
361 + STAGE1_LIBS to POSTSTAGE1_LIBS. Add -B to libstdc++-v3/src/.libs and
362 + libstdc++-v3/libsupc++/.libs to CXX. * Makefile.in: Regenerated.
363 +
364 +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218705 138bc75d-0d04-0410-961f-82ee72b054a4
365 +---
366 + ChangeLog | 9 +++++++++
367 + Makefile.in | 6 +++++-
368 + Makefile.tpl | 6 +++++-
369 + 3 files changed, 19 insertions(+), 2 deletions(-)
370 +
371 +diff --git a/Makefile.in b/Makefile.in
372 +index ba5ae4c2ecb..8ffc313f157 100644
373 +--- a/Makefile.in
374 ++++ b/Makefile.in
375 +@@ -835,7 +835,9 @@ EXTRA_TARGET_FLAGS = \
376 + 'AS=$(COMPILER_AS_FOR_TARGET)' \
377 + 'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
378 + 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
379 +- 'CXX=$$(CXX_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
380 ++ 'CXX=$$(CXX_FOR_TARGET) -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
381 ++ -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
382 ++ $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
383 + 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
384 + 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
385 + 'GCJ=$$(GCJ_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
386 +@@ -853,6 +855,8 @@ EXTRA_TARGET_FLAGS = \
387 + 'WINDRES=$$(WINDRES_FOR_TARGET)' \
388 + 'WINDMC=$$(WINDMC_FOR_TARGET)' \
389 + 'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \
390 ++ 'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \
391 ++ 'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \
392 + "TFLAGS=$$TFLAGS"
393 +
394 + TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
395 +diff --git a/Makefile.tpl b/Makefile.tpl
396 +index dcbc6b1b143..bb8227eaafa 100644
397 +--- a/Makefile.tpl
398 ++++ b/Makefile.tpl
399 +@@ -641,7 +641,9 @@ EXTRA_TARGET_FLAGS = \
400 + 'AS=$(COMPILER_AS_FOR_TARGET)' \
401 + 'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
402 + 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
403 +- 'CXX=$$(CXX_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
404 ++ 'CXX=$$(CXX_FOR_TARGET) -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
405 ++ -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
406 ++ $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
407 + 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
408 + 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
409 + 'GCJ=$$(GCJ_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
410 +@@ -659,6 +661,8 @@ EXTRA_TARGET_FLAGS = \
411 + 'WINDRES=$$(WINDRES_FOR_TARGET)' \
412 + 'WINDMC=$$(WINDMC_FOR_TARGET)' \
413 + 'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \
414 ++ 'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \
415 ++ 'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \
416 + "TFLAGS=$$TFLAGS"
417 +
418 + TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
419 +--
420 +2.15.0
421 +
422
423 diff --git a/sys-devel/gcc/files/gcc-9.2.0-neg-insn-cost.patch b/sys-devel/gcc/files/gcc-9.2.0-neg-insn-cost.patch
424 new file mode 100644
425 index 0000000..7a6bebd
426 --- /dev/null
427 +++ b/sys-devel/gcc/files/gcc-9.2.0-neg-insn-cost.patch
428 @@ -0,0 +1,29 @@
429 +https://bugs.gentoo.org/707958
430 +https://gcc.gnu.org/PR88879
431 +
432 +Subject: [PATCH] sel-sched: allow negative insn priority (PR 88879)
433 +From: Alexander Monakov <amonakov@××××××.ru>
434 +
435 + PR rtl-optimization/88879
436 + * sel-sched.c (sel_target_adjust_priority): Remove assert.
437 +
438 +From-SVN: r271039
439 +---
440 + gcc/ChangeLog | 5 +++++
441 + gcc/sel-sched.c | 2 --
442 + 2 files changed, 5 insertions(+), 2 deletions(-)
443 +
444 +--- a/gcc/sel-sched.c
445 ++++ b/gcc/sel-sched.c
446 +@@ -3331,8 +3331,6 @@ sel_target_adjust_priority (expr_t expr)
447 + else
448 + new_priority = priority;
449 +
450 +- gcc_assert (new_priority >= 0);
451 +-
452 + /* If the priority has changed, adjust EXPR_PRIORITY_ADJ accordingly. */
453 + EXPR_PRIORITY_ADJ (expr) = new_priority - EXPR_PRIORITY (expr);
454 +
455 +--
456 +2.25.0
457 +
458
459 diff --git a/sys-devel/gcc/files/gcc-configure-LANG.patch b/sys-devel/gcc/files/gcc-configure-LANG.patch
460 new file mode 100644
461 index 0000000..d1b1b03
462 --- /dev/null
463 +++ b/sys-devel/gcc/files/gcc-configure-LANG.patch
464 @@ -0,0 +1,64 @@
465 +The LANG vars aren't reset early enough so when sed tries to use [a-zA-Z] in
466 +option parsing, it may break.
467 +
468 +http://bugs.gentoo.org/103483
469 +
470 +--- configure
471 ++++ configure
472 +@@ -54,6 +54,19 @@
473 + infodir='${prefix}/info'
474 + mandir='${prefix}/man'
475 +
476 ++# NLS nuisances.
477 ++for as_var in \
478 ++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
479 ++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
480 ++ LC_TELEPHONE LC_TIME
481 ++do
482 ++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
483 ++ eval $as_var=C; export $as_var
484 ++ else
485 ++ unset $as_var
486 ++ fi
487 ++done
488 ++
489 + # Initialize some other variables.
490 + subdirs=
491 + MFLAGS= MAKEFLAGS=
492 +@@ -452,16 +463,6 @@
493 + esac
494 + done
495 +
496 +-# NLS nuisances.
497 +-# Only set these to C if already set. These must not be set unconditionally
498 +-# because not all systems understand e.g. LANG=C (notably SCO).
499 +-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
500 +-# Non-C LC_CTYPE values break the ctype check.
501 +-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
502 +-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
503 +-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
504 +-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
505 +-
506 + # confdefs.h avoids OS command line length limits that DEFS can exceed.
507 + rm -rf conftest* confdefs.h
508 + # AIX cpp loses on an empty file, so make sure it contains at least a newline.
509 +@@ -1850,6 +1850,19 @@
510 + # Compiler output produced by configure, useful for debugging
511 + # configure, is in ./config.log if it exists.
512 +
513 ++# NLS nuisances.
514 ++for as_var in \
515 ++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
516 ++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
517 ++ LC_TELEPHONE LC_TIME
518 ++do
519 ++ if (set +x; test -z "`(eval \$as_var=C; export \$as_var) 2>&1`"); then
520 ++ eval \$as_var=C; export \$as_var
521 ++ else
522 ++ unset \$as_var
523 ++ fi
524 ++done
525 ++
526 + ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
527 + for ac_option
528 + do
529
530 diff --git a/sys-devel/gcc/files/gcc-configure-texinfo.patch b/sys-devel/gcc/files/gcc-configure-texinfo.patch
531 new file mode 100644
532 index 0000000..99e9099
533 --- /dev/null
534 +++ b/sys-devel/gcc/files/gcc-configure-texinfo.patch
535 @@ -0,0 +1,16 @@
536 +Chances are quite good that the installed makeinfo is sufficient.
537 +So ignore false positives where the makeinfo installed is so new
538 +that it violates the cheesy version grep.
539 +
540 +http://bugs.gentoo.org/198182
541 +
542 +--- a/configure
543 ++++ b/configure
544 +@@ -3573,6 +3573,6 @@
545 + :
546 + else
547 +- MAKEINFO="$MISSING makeinfo"
548 ++ :
549 + fi
550 + ;;
551 +
552
553 diff --git a/sys-devel/gcc/files/gcc-spec-env-r1.patch b/sys-devel/gcc/files/gcc-spec-env-r1.patch
554 new file mode 100644
555 index 0000000..a589268
556 --- /dev/null
557 +++ b/sys-devel/gcc/files/gcc-spec-env-r1.patch
558 @@ -0,0 +1,87 @@
559 +2013-08-22 Magnus Granberg <zorry@g.o>
560 +
561 + * gcc/gcc.c (main): Add support for external spec file via the GCC_SPECS env var
562 + and move the process of the user specifed specs.
563 +
564 + This allows us to easily control pie/ssp defaults with gcc-config profiles.
565 + Original patch by Rob Holland
566 + Extended to support multiple entries separated by ':' by Kevin F. Quinn
567 + Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
568 + Modified to process the GCC_SPECS env var befor DRIVER_SELF_SPECS by Magnus Granberg
569 +
570 +--- gcc-4.8-20130210/gcc/gcc.c 2013-02-05 16:55:31.000000000 +0100
571 ++++ gcc-4.8-20130210-work/gcc/gcc.c 2013-07-26 02:32:14.625089864 +0200
572 +@@ -6427,6 +6428,48 @@ main (int argc, char **argv)
573 + do_option_spec (option_default_specs[i].name,
574 + option_default_specs[i].spec);
575 +
576 ++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
577 ++ /* Add specs listed in GCC_SPECS. Note; in the process of separating
578 ++ * each spec listed, the string is overwritten at token boundaries
579 ++ * (':') with '\0', an effect of strtok_r().
580 ++ */
581 ++ specs_file = getenv ("GCC_SPECS");
582 ++ if (specs_file && (strlen(specs_file) > 0))
583 ++ {
584 ++ char *spec, *saveptr;
585 ++ for (spec=strtok_r(specs_file,":",&saveptr);
586 ++ spec!=NULL;
587 ++ spec=strtok_r(NULL,":",&saveptr))
588 ++ {
589 ++ struct user_specs *user = (struct user_specs *)
590 ++ xmalloc (sizeof (struct user_specs));
591 ++ user->next = (struct user_specs *) 0;
592 ++ user->filename = spec;
593 ++ if (user_specs_tail)
594 ++ user_specs_tail->next = user;
595 ++ else
596 ++ user_specs_head = user;
597 ++ user_specs_tail = user;
598 ++ }
599 ++ }
600 ++#endif
601 ++ /* Process any user specified specs in the order given on the command
602 ++ * line. */
603 ++ for (uptr = user_specs_head; uptr; uptr = uptr->next)
604 ++ {
605 ++ char *filename = find_a_file (&startfile_prefixes, uptr->filename,
606 ++ R_OK, true);
607 ++ read_specs (filename ? filename : uptr->filename, false, true);
608 ++ }
609 ++ /* Process any user self specs. */
610 ++ {
611 ++ struct spec_list *sl;
612 ++ for (sl = specs; sl; sl = sl->next)
613 ++ if (sl->name_len == sizeof "self_spec" - 1
614 ++ && !strcmp (sl->name, "self_spec"))
615 ++ do_self_spec (*sl->ptr_spec);
616 ++ }
617 ++
618 + /* Process DRIVER_SELF_SPECS, adding any new options to the end
619 + of the command line. */
620 +
621 +@@ -6535,24 +6578,6 @@ main (int argc, char **argv)
622 + PREFIX_PRIORITY_LAST, 0, 1);
623 + }
624 +
625 +- /* Process any user specified specs in the order given on the command
626 +- line. */
627 +- for (uptr = user_specs_head; uptr; uptr = uptr->next)
628 +- {
629 +- char *filename = find_a_file (&startfile_prefixes, uptr->filename,
630 +- R_OK, true);
631 +- read_specs (filename ? filename : uptr->filename, false, true);
632 +- }
633 +-
634 +- /* Process any user self specs. */
635 +- {
636 +- struct spec_list *sl;
637 +- for (sl = specs; sl; sl = sl->next)
638 +- if (sl->name_len == sizeof "self_spec" - 1
639 +- && !strcmp (sl->name, "self_spec"))
640 +- do_self_spec (*sl->ptr_spec);
641 +- }
642 +-
643 + if (compare_debug)
644 + {
645 + enum save_temps save;
646
647 diff --git a/sys-devel/gcc/files/gcc-spec-env.patch b/sys-devel/gcc/files/gcc-spec-env.patch
648 new file mode 100644
649 index 0000000..57e7567
650 --- /dev/null
651 +++ b/sys-devel/gcc/files/gcc-spec-env.patch
652 @@ -0,0 +1,42 @@
653 + Add support for external spec file via the GCC_SPECS env var. This
654 + allows us to easily control pie/ssp defaults with gcc-config profiles.
655 +
656 + Original patch by Rob Holland
657 + Extended to support multiple entries separated by ':' by Kevin F. Quinn
658 + Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
659 +
660 +--- gcc-4/gcc/gcc.c
661 ++++ gcc-4/gcc/gcc.c
662 +@@ -6482,6 +6482,32 @@
663 +
664 + /* Process any user specified specs in the order given on the command
665 + line. */
666 ++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
667 ++ /* Add specs listed in GCC_SPECS. Note; in the process of separating
668 ++ * each spec listed, the string is overwritten at token boundaries
669 ++ * (':') with '\0', an effect of strtok_r().
670 ++ */
671 ++ specs_file = getenv ("GCC_SPECS");
672 ++ if (specs_file && (strlen(specs_file) > 0))
673 ++ {
674 ++ char *spec, *saveptr;
675 ++ for (spec=strtok_r(specs_file,":",&saveptr);
676 ++ spec!=NULL;
677 ++ spec=strtok_r(NULL,":",&saveptr))
678 ++ {
679 ++ struct user_specs *user = (struct user_specs *)
680 ++ xmalloc (sizeof (struct user_specs));
681 ++
682 ++ user->next = (struct user_specs *) 0;
683 ++ user->filename = spec;
684 ++ if (user_specs_tail)
685 ++ user_specs_tail->next = user;
686 ++ else
687 ++ user_specs_head = user;
688 ++ user_specs_tail = user;
689 ++ }
690 ++ }
691 ++#endif
692 + for (uptr = user_specs_head; uptr; uptr = uptr->next)
693 + {
694 + char *filename = find_a_file (&startfile_prefixes, uptr->filename,
695
696 diff --git a/sys-devel/gcc/gcc-10.2.0-r1.ebuild b/sys-devel/gcc/gcc-10.2.0-r1.ebuild
697 new file mode 100644
698 index 0000000..79c0680
699 --- /dev/null
700 +++ b/sys-devel/gcc/gcc-10.2.0-r1.ebuild
701 @@ -0,0 +1,13 @@
702 +# Copyright 1999-2020 Gentoo Authors
703 +# Distributed under the terms of the GNU General Public License v2
704 +
705 +EAPI="7"
706 +
707 +PATCH_VER="2"
708 +
709 +inherit toolchain
710 +
711 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
712 +
713 +RDEPEND=""
714 +BDEPEND="${CATEGORY}/binutils"
715
716 diff --git a/sys-devel/gcc/metadata.xml b/sys-devel/gcc/metadata.xml
717 new file mode 100644
718 index 0000000..6161017
719 --- /dev/null
720 +++ b/sys-devel/gcc/metadata.xml
721 @@ -0,0 +1,36 @@
722 +<?xml version="1.0" encoding="UTF-8"?>
723 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
724 +<pkgmetadata>
725 + <maintainer type="project">
726 + <email>toolchain@g.o</email>
727 + <name>Gentoo Toolchain Project</name>
728 + </maintainer>
729 + <use>
730 + <flag name="ada">Build the ADA language (GNAT) frontend</flag>
731 + <flag name="d">Enable support for the D programming language</flag>
732 + <flag name="fixed-point">Enable fixed-point arithmetic support for MIPS targets
733 + in gcc (Warning: significantly increases compile time!)</flag>
734 + <flag name="go">Build the GCC Go language frontend.</flag>
735 + <flag name="graphite">Add support for the framework for loop
736 + optimizations based on a polyhedral intermediate representation</flag>
737 + <flag name="jit">Enable libgccjit so other applications can embed gcc for Just-In-Time compilation.
738 + This will slow down the compiler a bit as it forces all of the toolchain to be shared libs.</flag>
739 + <flag name="libssp">Build SSP support into a dedicated library rather than use the
740 + code in the C library (DO NOT ENABLE THIS IF YOU DON'T KNOW WHAT IT DOES)</flag>
741 + <flag name="lto">Build using Link Time Optimizations (LTO)</flag>
742 + <flag name="nptl">Enable support for Native POSIX Threads Library, the new threading module (requires linux-2.6 or better usually)</flag>
743 + <flag name="objc">Build support for the Objective C code language</flag>
744 + <flag name="objc++">Build support for the Objective C++ language</flag>
745 + <flag name="objc-gc">Build support for the Objective C code language Garbage
746 + Collector</flag>
747 + <flag name="pgo">Build GCC using Profile Guided Optimization (PGO)</flag>
748 + <flag name="sanitize">Build support for various sanitizer functions (ASAN/TSAN/etc...)</flag>
749 + <flag name="ssp">Build packages with stack smashing protector on by default</flag>
750 + <flag name="systemtap">enable systemtap static probe points</flag>
751 + <flag name="vtv">Build support for virtual table verification (a C++ hardening feature)</flag>
752 + </use>
753 + <upstream>
754 + <remote-id type="cpe">cpe:/a:gnu:gcc</remote-id>
755 + <remote-id type="sourceforge">dgcc</remote-id>
756 + </upstream>
757 +</pkgmetadata>