Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gcc-patches:master commit in: 9.4.0/gentoo/
Date: Tue, 01 Jun 2021 17:56:18
Message-Id: 1622566828.7f7f80a650607c3090ae0790b8daef88434da681.slyfox@gentoo
1 commit: 7f7f80a650607c3090ae0790b8daef88434da681
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 1 17:00:28 2021 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 1 17:00:28 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7f7f80a6
7
8 9.4.0: cut 1 patchset, a copy of 9.3.0 patches
9
10 The only change compared to 9.3.0 is removal
11 of early backported paches.
12
13 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
14
15 9.4.0/gentoo/01_all_default-fortify-source.patch | 22 ++++
16 .../02_all_default-warn-format-security.patch | 22 ++++
17 9.4.0/gentoo/03_all_default-warn-trampolines.patch | 13 ++
18 9.4.0/gentoo/04_all_nossp-on-nostdlib.patch | 27 ++++
19 9.4.0/gentoo/05_all_alpha-mieee-default.patch | 39 ++++++
20 9.4.0/gentoo/06_all_ia64_note.GNU-stack.patch | 92 +++++++++++++
21 .../gentoo/07_all_i386_libgcc_note.GNU-stack.patch | 54 ++++++++
22 9.4.0/gentoo/08_all_libiberty-asprintf.patch | 18 +++
23 9.4.0/gentoo/09_all_libiberty-pic.patch | 10 ++
24 9.4.0/gentoo/10_all_nopie-all-flags.patch | 18 +++
25 9.4.0/gentoo/11_all_extra-options.patch | 89 +++++++++++++
26 .../12_all_pr55930-dependency-tracking.patch | 18 +++
27 9.4.0/gentoo/13_all_sh-drop-sysroot-suffix.patch | 32 +++++
28 9.4.0/gentoo/14_all_ia64-TEXTREL.patch | 22 ++++
29 9.4.0/gentoo/15_all_disable-systemtap-switch.patch | 122 ++++++++++++++++++
30 9.4.0/gentoo/16_all_m68k-textrel-on-libgcc.patch | 93 ++++++++++++++
31 9.4.0/gentoo/17_all_respect-build-cxxflags.patch | 39 ++++++
32 9.4.0/gentoo/18_all_libgfortran-Werror.patch | 20 +++
33 9.4.0/gentoo/19_all_libgomp-Werror.patch | 20 +++
34 9.4.0/gentoo/20_all_libitm-Werror.patch | 19 +++
35 9.4.0/gentoo/21_all_libatomic-Werror.patch | 19 +++
36 9.4.0/gentoo/22_all_libbacktrace-Werror.patch | 17 +++
37 9.4.0/gentoo/23_all_libsanitizer-Werror.patch | 17 +++
38 9.4.0/gentoo/24_all_libstdcxx-no-vtv.patch | 61 +++++++++
39 9.4.0/gentoo/25_all_disable-riscv32-ABIs.patch | 53 ++++++++
40 9.4.0/gentoo/26_all_default_ssp-buffer-size.patch | 14 ++
41 9.4.0/gentoo/27_all_hppa-faster-synth_mult.patch | 44 +++++++
42 9.4.0/gentoo/28_all_libcpp-ar.patch | 143 +++++++++++++++++++++
43 9.4.0/gentoo/29_all_plugin-objdump.patch | 34 +++++
44 9.4.0/gentoo/README.history | 30 +++++
45 30 files changed, 1221 insertions(+)
46
47 diff --git a/9.4.0/gentoo/01_all_default-fortify-source.patch b/9.4.0/gentoo/01_all_default-fortify-source.patch
48 new file mode 100644
49 index 0000000..d307474
50 --- /dev/null
51 +++ b/9.4.0/gentoo/01_all_default-fortify-source.patch
52 @@ -0,0 +1,22 @@
53 +Taken Debian's patch and removed docs matches:
54 + https://salsa.debian.org/toolchain-team/gcc.git
55 +Also see https://bugs.gentoo.org/621036 where
56 +initially Gentoo used too complicated macro.
57 +
58 +# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++,
59 +# DP: if the optimization level is > 0
60 +--- a/gcc/c-family/c-cppbuiltin.c
61 ++++ b/gcc/c-family/c-cppbuiltin.c
62 +@@ -951,6 +951,12 @@ c_cpp_builtins (cpp_reader *pfile)
63 + builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
64 + builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
65 +
66 ++#if !defined(ACCEL_COMPILER)
67 ++ /* Fortify Source enabled by default for optimization levels > 0 */
68 ++ if (optimize)
69 ++ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
70 ++#endif
71 ++
72 + /* Misc. */
73 + if (flag_gnu89_inline)
74 + cpp_define (pfile, "__GNUC_GNU_INLINE__");
75
76 diff --git a/9.4.0/gentoo/02_all_default-warn-format-security.patch b/9.4.0/gentoo/02_all_default-warn-format-security.patch
77 new file mode 100644
78 index 0000000..f809abd
79 --- /dev/null
80 +++ b/9.4.0/gentoo/02_all_default-warn-format-security.patch
81 @@ -0,0 +1,22 @@
82 +Enable -Wformat and -Wformat-security by default.
83 +
84 +--- a/gcc/c-family/c.opt 2016-03-23 18:51:56.000000000 +0100
85 ++++ b/gcc/c-family/c.opt 2016-04-28 23:45:54.063351272 +0200
86 +@@ -459,7 +459,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonlit
87 + Warn about format strings that are not literals.
88 +
89 + Wformat-security
90 +-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
91 ++C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
92 + Warn about possible security problems with format functions.
93 +
94 + Wformat-signedness
95 +@@ -475,7 +475,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_l
96 + Warn about zero-length formats.
97 +
98 + Wformat=
99 +-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
100 ++C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
101 + Warn about printf/scanf/strftime/strfmon format string anomalies.
102 +
103 + Wignored-qualifiers
104
105 diff --git a/9.4.0/gentoo/03_all_default-warn-trampolines.patch b/9.4.0/gentoo/03_all_default-warn-trampolines.patch
106 new file mode 100644
107 index 0000000..7a644cb
108 --- /dev/null
109 +++ b/9.4.0/gentoo/03_all_default-warn-trampolines.patch
110 @@ -0,0 +1,13 @@
111 +Enable -Wtrampolines by default.
112 +
113 +--- a/gcc/common.opt
114 ++++ b/gcc/common.opt
115 +@@ -712,7 +712,7 @@ Common Var(warn_system_headers) Warning
116 + Do not suppress warnings from system headers.
117 +
118 + Wtrampolines
119 +-Common Var(warn_trampolines) Warning
120 ++Common Var(warn_trampolines) Init(1) Warning
121 + Warn whenever a trampoline is generated.
122 +
123 + Wtype-limits
124
125 diff --git a/9.4.0/gentoo/04_all_nossp-on-nostdlib.patch b/9.4.0/gentoo/04_all_nossp-on-nostdlib.patch
126 new file mode 100644
127 index 0000000..648d712
128 --- /dev/null
129 +++ b/9.4.0/gentoo/04_all_nossp-on-nostdlib.patch
130 @@ -0,0 +1,27 @@
131 +Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
132 +
133 +https://bugs.gentoo.org/484714
134 +--- a/gcc/gcc.c 2017-07-04 09:15:57.740793000 +0200
135 ++++ b/gcc/gcc.c 2018-03-02 13:58:44.387741114 +0100
136 +@@ -857,6 +857,12 @@ proper position among the other output f
137 + #define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G"
138 + #endif
139 +
140 ++#ifdef ENABLE_DEFAULT_SSP
141 ++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} "
142 ++#else
143 ++#define NO_SSP_SPEC ""
144 ++#endif
145 ++
146 + #ifndef LINK_SSP_SPEC
147 + #ifdef TARGET_LIBC_PROVIDES_SSP
148 + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
149 +@@ -1131,7 +1148,7 @@ static const char *cc1_options =
150 + %{-version:--version}\
151 + %{-help=*:--help=%*}\
152 + %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
153 +- %{fsyntax-only:-o %j} %{-param*}\
154 ++ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
155 + %{coverage:-fprofile-arcs -ftest-coverage}\
156 + %{fprofile-arcs|fprofile-generate*|coverage:\
157 + %{!fprofile-update=singel:\
158
159 diff --git a/9.4.0/gentoo/05_all_alpha-mieee-default.patch b/9.4.0/gentoo/05_all_alpha-mieee-default.patch
160 new file mode 100644
161 index 0000000..b266d77
162 --- /dev/null
163 +++ b/9.4.0/gentoo/05_all_alpha-mieee-default.patch
164 @@ -0,0 +1,39 @@
165 +Set the default behavior on alpha to use -mieee since the large majority of
166 +time we want this (bad/weird things can happen with packages built without
167 +it).
168 +
169 +To satisfy those people who may not want -mieee forced on them all the time,
170 +we also provide -mno-ieee.
171 +
172 +Patch by Mike Frysinger <vapier@g.o>
173 +
174 +Note: upstream doesn't want to take this due to long standing behavior, and
175 +because it'd make behavior across OS's inconsistent:
176 + https://gcc.gnu.org/ml/gcc-patches/2003-07/msg02144.html
177 +
178 +This makes sense for upstream, but Gentoo is more concerned about packages
179 +behaving the same across arches under Linux.
180 +
181 +--- a/gcc/config/alpha/alpha.h
182 ++++ b/gcc/config/alpha/alpha.h
183 +@@ -96,6 +96,8 @@ along with GCC; see the file COPYING3. If not see
184 + while (0)
185 + #endif
186 +
187 ++#define CPP_SPEC "%{!no-ieee:-mieee}"
188 ++
189 + /* Run-time compilation parameters selecting different hardware subsets. */
190 +
191 + /* Which processor to schedule for. The cpu attribute defines a list that
192 +--- a/gcc/config/alpha/alpha.opt
193 ++++ b/gcc/config/alpha/alpha.opt
194 +@@ -35,7 +35,7 @@
195 + Request IEEE-conformant math library routines (OSF/1).
196 +
197 + mieee
198 +-Target Report RejectNegative Mask(IEEE)
199 ++Target Report Mask(IEEE)
200 + Emit IEEE-conformant code, without inexact exceptions.
201 +
202 + mieee-with-inexact
203 +
204
205 diff --git a/9.4.0/gentoo/06_all_ia64_note.GNU-stack.patch b/9.4.0/gentoo/06_all_ia64_note.GNU-stack.patch
206 new file mode 100644
207 index 0000000..66a787e
208 --- /dev/null
209 +++ b/9.4.0/gentoo/06_all_ia64_note.GNU-stack.patch
210 @@ -0,0 +1,92 @@
211 +http://gcc.gnu.org/PR21098
212 +
213 +
214 +2004-09-20 Jakub Jelinek <jakub@××××××.com>
215 +
216 + * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
217 + on ppc64-linux.
218 +
219 + * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
220 + ia64-linux.
221 + * config/ia64/crtbegin.asm: Likewise.
222 + * config/ia64/crtend.asm: Likewise.
223 + * config/ia64/crti.asm: Likewise.
224 + * config/ia64/crtn.asm: Likewise.
225 +
226 +2004-05-14 Jakub Jelinek <jakub@××××××.com>
227 +
228 + * config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
229 +
230 +
231 +--- a/gcc/config/ia64/linux.h
232 ++++ b/gcc/config/ia64/linux.h
233 +@@ -24,6 +24,8 @@ a copy of the GCC Runtime Library Exception along with this program;
234 + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
235 + <http://www.gnu.org/licenses/>. */
236 +
237 ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
238 ++
239 + /* This is for -profile to use -lc_p instead of -lc. */
240 + #undef CC1_SPEC
241 + #define CC1_SPEC "%{profile:-p} %{G*}"
242 +--- a/gcc/config/rs6000/ppc-asm.h
243 ++++ b/gcc/config/rs6000/ppc-asm.h
244 +@@ -352,7 +352,7 @@ GLUE(.L,name): \
245 + #endif
246 + #endif
247 +
248 +-#if defined __linux__ && !defined __powerpc64__
249 ++#if defined __linux__
250 + .section .note.GNU-stack
251 + .previous
252 + #endif
253 +--- a/libgcc/config/ia64/crtbegin.S
254 ++++ b/libgcc/config/ia64/crtbegin.S
255 +@@ -252,3 +252,7 @@ __do_jv_register_classes:
256 + .weak __cxa_finalize
257 + #endif
258 + .weak _Jv_RegisterClasses
259 ++
260 ++#ifdef __linux__
261 ++.section .note.GNU-stack; .previous
262 ++#endif
263 +--- a/libgcc/config/ia64/crtend.S
264 ++++ b/libgcc/config/ia64/crtend.S
265 +@@ -119,3 +119,6 @@ __do_global_ctors_aux:
266 +
267 + br.ret.sptk.many rp
268 + .endp __do_global_ctors_aux
269 ++#ifdef __linux__
270 ++.section .note.GNU-stack; .previous
271 ++#endif
272 +--- a/libgcc/config/ia64/crti.S
273 ++++ b/libgcc/config/ia64/crti.S
274 +@@ -49,5 +49,8 @@ _fini:
275 + .save rp, r33
276 + mov r33 = b0
277 + .body
278 ++#ifdef __linux__
279 ++.section .note.GNU-stack; .previous
280 ++#endif
281 +
282 + # end of crti.S
283 +--- a/libgcc/config/ia64/crtn.S
284 ++++ b/libgcc/config/ia64/crtn.S
285 +@@ -39,5 +39,8 @@
286 + .restore sp
287 + mov r12 = r35
288 + br.ret.sptk.many b0
289 ++#ifdef __linux__
290 ++.section .note.GNU-stack; .previous
291 ++#endif
292 +
293 + # end of crtn.S
294 +--- a/libgcc/config/ia64/lib1funcs.S
295 ++++ b/libgcc/config/ia64/lib1funcs.S
296 +@@ -793,3 +793,6 @@ __floattitf:
297 + .endp __floattitf
298 + #endif
299 + #endif
300 ++#ifdef __linux__
301 ++.section .note.GNU-stack; .previous
302 ++#endif
303
304 diff --git a/9.4.0/gentoo/07_all_i386_libgcc_note.GNU-stack.patch b/9.4.0/gentoo/07_all_i386_libgcc_note.GNU-stack.patch
305 new file mode 100644
306 index 0000000..7f74945
307 --- /dev/null
308 +++ b/9.4.0/gentoo/07_all_i386_libgcc_note.GNU-stack.patch
309 @@ -0,0 +1,54 @@
310 +--- a/libgcc/config/i386/resms64.h 2018-01-03 11:03:58.000000000 +0100
311 ++++ b/libgcc/config/i386/resms64.h 2018-05-01 12:59:48.942833419 +0200
312 +@@ -57,3 +57,6 @@ MS2SYSV_STUB_END(resms64_17)
313 + MS2SYSV_STUB_END(resms64_18)
314 +
315 + #endif /* __x86_64__ */
316 ++#if defined(__linux__) && defined(__ELF__)
317 ++.section .note.GNU-stack,"",%progbits
318 ++#endif
319 +--- a/libgcc/config/i386/resms64f.h 2018-01-03 11:03:58.000000000 +0100
320 ++++ b/libgcc/config/i386/resms64f.h 2018-05-01 13:00:23.422832853 +0200
321 +@@ -55,3 +55,6 @@ MS2SYSV_STUB_END(resms64f_16)
322 + MS2SYSV_STUB_END(resms64f_17)
323 +
324 + #endif /* __x86_64__ */
325 ++#if defined(__linux__) && defined(__ELF__)
326 ++.section .note.GNU-stack,"",%progbits
327 ++#endif
328 +--- a/libgcc/config/i386/resms64fx.h 2018-02-26 20:46:34.000000000 +0100
329 ++++ b/libgcc/config/i386/resms64fx.h 2018-05-01 13:06:49.682826518 +0200
330 +@@ -62,3 +62,6 @@ MS2SYSV_STUB_END(resms64fx_16)
331 + MS2SYSV_STUB_END(resms64fx_17)
332 +
333 + #endif /* __x86_64__ */
334 ++#if defined(__linux__) && defined(__ELF__)
335 ++.section .note.GNU-stack,"",%progbits
336 ++#endif
337 +--- a/libgcc/config/i386/resms64x.h 2018-02-26 20:46:34.000000000 +0100
338 ++++ b/libgcc/config/i386/resms64x.h 2018-05-01 13:07:21.702825993 +0200
339 +@@ -63,3 +63,6 @@ MS2SYSV_STUB_END(resms64x_17)
340 + MS2SYSV_STUB_END(resms64x_18)
341 +
342 + #endif /* __x86_64__ */
343 ++#if defined(__linux__) && defined(__ELF__)
344 ++.section .note.GNU-stack,"",%progbits
345 ++#endif
346 +--- a/libgcc/config/i386/savms64.h 2018-01-03 11:03:58.000000000 +0100
347 ++++ b/libgcc/config/i386/savms64.h 2018-05-01 13:07:48.952825546 +0200
348 +@@ -57,3 +57,6 @@ MS2SYSV_STUB_END(savms64_17)
349 + MS2SYSV_STUB_END(savms64_18)
350 +
351 + #endif /* __x86_64__ */
352 ++#if defined(__linux__) && defined(__ELF__)
353 ++.section .note.GNU-stack,"",%progbits
354 ++#endif
355 +--- a/libgcc/config/i386/savms64f.h 2018-01-03 11:03:58.000000000 +0100
356 ++++ b/libgcc/config/i386/savms64f.h 2018-05-01 13:08:30.082824871 +0200
357 +@@ -55,3 +55,6 @@ MS2SYSV_STUB_END(savms64f_16)
358 + MS2SYSV_STUB_END(savms64f_17)
359 +
360 + #endif /* __x86_64__ */
361 ++#if defined(__linux__) && defined(__ELF__)
362 ++.section .note.GNU-stack,"",%progbits
363 ++#endif
364
365 diff --git a/9.4.0/gentoo/08_all_libiberty-asprintf.patch b/9.4.0/gentoo/08_all_libiberty-asprintf.patch
366 new file mode 100644
367 index 0000000..bee0c4c
368 --- /dev/null
369 +++ b/9.4.0/gentoo/08_all_libiberty-asprintf.patch
370 @@ -0,0 +1,18 @@
371 +2008-07-25 Magnus Granberg <zorry@×××.nu>
372 +
373 + * include/libiberty.h (asprintf): Don't declare if defined as a macro
374 +
375 +--- a/include/libiberty.h
376 ++++ b/include/libiberty.h
377 +@@ -609,8 +609,11 @@ extern int pwait (int, int *, int);
378 + /* Like sprintf but provides a pointer to malloc'd storage, which must
379 + be freed by the caller. */
380 +
381 ++/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
382 ++#ifndef asprintf
383 + extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
384 + #endif
385 ++#endif
386 +
387 + #if !HAVE_DECL_VASPRINTF
388 + /* Like vsprintf but provides a pointer to malloc'd storage, which
389
390 diff --git a/9.4.0/gentoo/09_all_libiberty-pic.patch b/9.4.0/gentoo/09_all_libiberty-pic.patch
391 new file mode 100644
392 index 0000000..b6160a7
393 --- /dev/null
394 +++ b/9.4.0/gentoo/09_all_libiberty-pic.patch
395 @@ -0,0 +1,10 @@
396 +--- a/libiberty/Makefile.in
397 ++++ b/libiberty/Makefile.in
398 +@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
399 + $(AR) $(AR_FLAGS) $(TARGETLIB) \
400 + $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
401 + $(RANLIB) $(TARGETLIB); \
402 ++ cp $(TARGETLIB) ../ ; \
403 + cd ..; \
404 + else true; fi
405 +
406
407 diff --git a/9.4.0/gentoo/10_all_nopie-all-flags.patch b/9.4.0/gentoo/10_all_nopie-all-flags.patch
408 new file mode 100644
409 index 0000000..48536e6
410 --- /dev/null
411 +++ b/9.4.0/gentoo/10_all_nopie-all-flags.patch
412 @@ -0,0 +1,18 @@
413 +We need to pass NO_PIE_CFLAGS to ALL_* so gcc don't fail when
414 +we compile it with older gcc and pie.
415 +
416 +--- a/gcc/Makefile.in 2015-06-25 19:18:12.000000000 +0200
417 ++++ b/gcc/Makefile.in 2016-04-22 00:12:54.029178860 +0200
418 +@@ -991,10 +991,10 @@ ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@)
419 + ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS)
420 +
421 + # This is the variable to use when using $(COMPILER).
422 +-ALL_COMPILERFLAGS = $(ALL_CXXFLAGS)
423 ++ALL_COMPILERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS)
424 +
425 + # This is the variable to use when using $(LINKER).
426 +-ALL_LINKERFLAGS = $(ALL_CXXFLAGS)
427 ++ALL_LINKERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS)
428 +
429 + # Build and host support libraries.
430 +
431
432 diff --git a/9.4.0/gentoo/11_all_extra-options.patch b/9.4.0/gentoo/11_all_extra-options.patch
433 new file mode 100644
434 index 0000000..42c288c
435 --- /dev/null
436 +++ b/9.4.0/gentoo/11_all_extra-options.patch
437 @@ -0,0 +1,89 @@
438 +On Hardened we add some options like -fstack-clash-protection and -z now
439 +
440 +--- a/gcc/common.opt 2018-03-28 16:51:09.000000000 +0200
441 ++++ a/gcc/common.opt 2018-04-30 15:35:55.274096877 +0200
442 +@@ -2367,7 +2367,7 @@ Common Alias(fstack-check=, specific, no
443 + Insert stack checking code into the program. Same as -fstack-check=specific.
444 +
445 + fstack-clash-protection
446 +-Common Report Var(flag_stack_clash_protection) Optimization
447 ++Common Report Var(flag_stack_clash_protection) Optimization Init(-1)
448 + Insert code to probe each page of stack space as it is allocated to protect
449 + from stack-clash style attacks.
450 +
451 +--- a/gcc/defaults.h 2018-01-03 11:03:58.000000000 +0100
452 ++++ b/gcc/defaults.h 2018-05-01 12:41:29.522851451 +0200
453 +@@ -1435,6 +1435,15 @@ see the files COPYING3 and COPYING.RUNTI
454 + #define STACK_CHECK_MAX_VAR_SIZE (STACK_CHECK_MAX_FRAME_SIZE / 100)
455 + #endif
456 +
457 ++/* Default value for flag_clash_protector when flag_clash_protector is
458 ++ initialized to -1. */
459 ++#ifdef EXTRA_OPTIONS
460 ++#define DEFAULT_FLAG_SCP 1
461 ++#endif
462 ++#ifndef DEFAULT_FLAG_SCP
463 ++#define DEFAULT_FLAG_SCP 0
464 ++#endif
465 ++
466 + /* By default, the C++ compiler will use function addresses in the
467 + vtable entries. Setting this nonzero tells the compiler to use
468 + function descriptors instead. The value of this macro says how
469 +--- a/gcc/toplev.c 2018-02-13 17:18:37.000000000 +0100
470 ++++ b/gcc/toplev.c 2018-04-30 16:46:37.244027303 +0200
471 +@@ -1682,6 +1682,10 @@ process_options (void)
472 +
473 + /* -fstack-clash-protection is not currently supported on targets
474 + where the stack grows up. */
475 ++ if (flag_stack_clash_protection == -1)
476 ++ {
477 ++ flag_stack_clash_protection = DEFAULT_FLAG_SCP;
478 ++ }
479 + if (flag_stack_clash_protection && !STACK_GROWS_DOWNWARD)
480 + {
481 + warning_at (UNKNOWN_LOCATION, 0,
482 +
483 +--- a/libgcc/Makefile.in 2011-11-22 04:01:02.000000000 +0100
484 ++++ b/libgcc/Makefile.in 2011-12-25 15:18:22.449610631 +0100
485 +@@ -225,7 +225,7 @@ endif
486 + LIBGCC2_DEBUG_CFLAGS = -g
487 + LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
488 + $(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \
489 +- -fbuilding-libgcc -fno-stack-protector \
490 ++ -fbuilding-libgcc -fno-stack-protector -fno-stack-clash-protection \
491 + $(INHIBIT_LIBC_CFLAGS)
492 +
493 + # Additional options to use when compiling libgcc2.a.
494 +@@ -279,7 +290,7 @@ INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CF
495 + -finhibit-size-directive -fno-inline -fno-exceptions \
496 + -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
497 + -fbuilding-libgcc -fno-stack-protector $(FORCE_EXPLICIT_EH_REGISTRY) \
498 +- $(INHIBIT_LIBC_CFLAGS)
499 ++ -fno-stack-clash-protection $(INHIBIT_LIBC_CFLAGS)
500 +
501 + # Extra flags to use when compiling crt{begin,end}.o.
502 + CRTSTUFF_T_CFLAGS =
503 +--- a/gcc/gcc.c 2016-02-19 23:18:38.000000000 +0100
504 ++++ b/gcc/gcc.c 2016-05-02 22:56:10.185721270 +0200
505 +@@ -868,6 +868,12 @@ proper position among the other output f
506 + #endif
507 + #endif
508 +
509 ++#ifdef EXTRA_OPTIONS
510 ++#define LINK_NOW_SPEC "%{!nonow:-z now} "
511 ++#else
512 ++#define LINK_NOW_SPEC ""
513 ++#endif
514 ++
515 + #ifdef ENABLE_DEFAULT_PIE
516 + #define NO_PIE_SPEC "no-pie|static"
517 + #define PIE_SPEC NO_PIE_SPEC "|r|shared:;"
518 +@@ -1013,7 +1020,7 @@ proper position among the other output f
519 + %(linker) " \
520 + LINK_PLUGIN_SPEC \
521 + "%{flto|flto=*:%<fcompare-debug*} \
522 +- %{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
523 ++ %{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC LINK_NOW_SPEC \
524 + "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
525 + "%X %{o*} %{e*} %{N} %{n} %{r}\
526 + %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} \
527
528 diff --git a/9.4.0/gentoo/12_all_pr55930-dependency-tracking.patch b/9.4.0/gentoo/12_all_pr55930-dependency-tracking.patch
529 new file mode 100644
530 index 0000000..a8743e0
531 --- /dev/null
532 +++ b/9.4.0/gentoo/12_all_pr55930-dependency-tracking.patch
533 @@ -0,0 +1,18 @@
534 +libatomic build failure if configured with --disable-dependency-tracking
535 +load_n.c:115:1: fatal error: opening dependency file .deps/load_1_.lo.Ppo: No such file or directory
536 +
537 +https://bugs.gentoo.org/463463
538 +http://gcc.gnu.org/PR55930
539 +
540 +--- a/libatomic/Makefile.in
541 ++++ b/libatomic/Makefile.in
542 +@@ -298,7 +298,8 @@ PAT_N = $(word 2,$(PAT_SPLIT))
543 + PAT_S = $(word 3,$(PAT_SPLIT))
544 + IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
545 + IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
546 +-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
547 ++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
548 ++@AMDEP_FALSE@M_DEPS =
549 + M_SIZE = -DN=$(PAT_N)
550 + M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
551 + M_FILE = $(PAT_BASE)_n.c
552
553 diff --git a/9.4.0/gentoo/13_all_sh-drop-sysroot-suffix.patch b/9.4.0/gentoo/13_all_sh-drop-sysroot-suffix.patch
554 new file mode 100644
555 index 0000000..3dadd4c
556 --- /dev/null
557 +++ b/9.4.0/gentoo/13_all_sh-drop-sysroot-suffix.patch
558 @@ -0,0 +1,32 @@
559 +From 5eeeff19bb4978a8d3c0d53bc81744bc25d82993 Mon Sep 17 00:00:00 2001
560 +From: Sergei Trofimovich <slyfox@g.o>
561 +Date: Sat, 14 Apr 2018 13:07:39 +0100
562 +Subject: [PATCH] gcc/config.gcc: sh-*: Disable sysroot-suffix (PR42947)
563 +
564 +sh-* is a multilib target. It is also one of 2 sysroot-prefix targets.
565 +Unfortunately two options do not mix well. Attempt to use default
566 +multilib flavour always prepends sysroot-prefix.
567 +
568 +Bug: https://bugs.gentoo.org/511548
569 +Bug: https://gcc.gnu.org/PR42947
570 +Signed-off-by: Sergei Trofimovich <slyfox@g.o>
571 +---
572 + gcc/config.gcc | 2 --
573 + 1 file changed, 2 deletions(-)
574 +
575 +diff --git a/gcc/config.gcc b/gcc/config.gcc
576 +index 55c314afdbd..c320f24f123 100644
577 +--- a/gcc/config.gcc
578 ++++ b/gcc/config.gcc
579 +@@ -2866,8 +2866,6 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
580 + if test x${enable_incomplete_targets} = xyes ; then
581 + tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1"
582 + fi
583 +- tm_file="$tm_file ./sysroot-suffix.h"
584 +- tmake_file="$tmake_file t-sysroot-suffix"
585 + ;;
586 + sh-*-rtems*)
587 + tmake_file="${tmake_file} sh/t-sh sh/t-rtems"
588 +--
589 +2.17.0
590 +
591
592 diff --git a/9.4.0/gentoo/14_all_ia64-TEXTREL.patch b/9.4.0/gentoo/14_all_ia64-TEXTREL.patch
593 new file mode 100644
594 index 0000000..706dbe5
595 --- /dev/null
596 +++ b/9.4.0/gentoo/14_all_ia64-TEXTREL.patch
597 @@ -0,0 +1,22 @@
598 +Fix textrels on -rdynamic binaries:
599 +Bug: https://gcc.gnu.org/PR84553
600 +Bug: https://bugs.gentoo.org/566118
601 +--- a/gcc/config/ia64/ia64.c
602 ++++ a/gcc/config/ia64/ia64.c
603 +@@ -10838,12 +10838,14 @@ ia64_hpux_reloc_rw_mask (void)
604 +
605 + /* For others, relax this so that relocations to local data goes in
606 + read-only segments, but we still cannot allow global relocations
607 +- in read-only segments. */
608 ++ in read-only segments. Except that use of -rdynamic at link time
609 ++ may make any local data global, so we can't allow local data in
610 ++ read-only segments either. */
611 +
612 + static int
613 + ia64_reloc_rw_mask (void)
614 + {
615 +- return flag_pic ? 3 : 2;
616 ++ return flag_pic ? 3 : 3;
617 + }
618 +
619 + /* Return the section to use for X. The only special thing we do here
620
621 diff --git a/9.4.0/gentoo/15_all_disable-systemtap-switch.patch b/9.4.0/gentoo/15_all_disable-systemtap-switch.patch
622 new file mode 100644
623 index 0000000..d5ae8d0
624 --- /dev/null
625 +++ b/9.4.0/gentoo/15_all_disable-systemtap-switch.patch
626 @@ -0,0 +1,122 @@
627 +From bb510ed7ea82093c924b027489db6f92250a85b3 Mon Sep 17 00:00:00 2001
628 +From: Sergei Trofimovich <slyfox@g.o>
629 +Date: Sat, 12 May 2018 12:56:46 +0100
630 +Subject: [PATCH] gcc/configure.ac: add --disable-systemtap switch
631 +
632 +Before the change systemtap probes were enabled
633 +if target headers had sys/sdt.h at ./configure time.
634 +
635 +After the change explicitly ask to enable or disable
636 +for probe support and not rely on automagic dependency
637 +discovery.
638 +
639 +Bug: https://bugs.gentoo.org/654748
640 +Bug: https://gcc.gnu.org/bugzilla/PR61257
641 +Signed-off-by: Sergei Trofimovich <slyfox@g.o>
642 +---
643 + gcc/configure | 34 ++++++++++++++++++++++++++--------
644 + gcc/configure.ac | 30 ++++++++++++++++++++++--------
645 + 2 files changed, 48 insertions(+), 16 deletions(-)
646 +
647 +diff --git a/gcc/configure b/gcc/configure
648 +index 3dcf7752b..c2049f117 100755
649 +--- a/gcc/configure
650 ++++ b/gcc/configure
651 +@@ -988,6 +988,7 @@ enable_gnu_unique_object
652 + enable_linker_build_id
653 + enable_libssp
654 + enable_default_ssp
655 ++enable_systemtap
656 + with_long_double_128
657 + with_long_double_format
658 + with_gc
659 +@@ -1740,6 +1741,7 @@ Optional Features:
660 + compiler will always pass --build-id to linker
661 + --enable-libssp enable linking against libssp
662 + --enable-default-ssp enable Stack Smashing Protection as default
663 ++ --disable-systemtap enable systemtap static probe points [default=auto]
664 + --enable-maintainer-mode
665 + enable make rules and dependencies not useful (and
666 + sometimes confusing) to the casual installer
667 +@@ -29330,17 +29332,33 @@ fi
668 +
669 + # Test for <sys/sdt.h> on the target.
670 +
671 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
672 ++
673 ++# Check whether --enable-systemtap was given.
674 ++if test "${enable_systemtap+set}" = set; then :
675 ++ enableval=$enable_systemtap; enable_systemtap=$enableval
676 ++else
677 ++ enable_systemtap=auto
678 ++fi
679 ++
680 ++
681 ++if test x$enable_systemtap != xno; then
682 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
683 + $as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
684 +-have_sys_sdt_h=no
685 +-if test -f $target_header_dir/sys/sdt.h; then
686 +- have_sys_sdt_h=yes
687 ++ have_sys_sdt_h=no
688 ++ if test -f $target_header_dir/sys/sdt.h ; then
689 ++ have_sys_sdt_h=yes
690 +
691 + $as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
692 +
693 +-fi
694 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
695 ++ fi
696 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
697 + $as_echo "$have_sys_sdt_h" >&6; }
698 ++ if test x$enable_systemtap = xyes ; then
699 ++ if test x$have_sys_sdt_h = xno ; then
700 ++ as_fn_error $? "sys/sdt.h was not found" "$LINENO" 5
701 ++ fi
702 ++ fi
703 ++fi
704 +
705 + # Check if TFmode long double should be used by default or not.
706 + # Some glibc targets used DFmode long double, but with glibc 2.4
707 +--- a/gcc/configure.ac
708 ++++ b/gcc/configure.ac
709 +@@ -6000,14 +6000,28 @@ AC_SUBST([enable_default_ssp])
710 +
711 + # Test for <sys/sdt.h> on the target.
712 + GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
713 +-AC_MSG_CHECKING(sys/sdt.h in the target C library)
714 +-have_sys_sdt_h=no
715 +-if test -f $target_header_dir/sys/sdt.h; then
716 +- have_sys_sdt_h=yes
717 +- AC_DEFINE(HAVE_SYS_SDT_H, 1,
718 +- [Define if your target C library provides sys/sdt.h])
719 +-fi
720 +-AC_MSG_RESULT($have_sys_sdt_h)
721 ++
722 ++AC_ARG_ENABLE(systemtap,
723 ++[AS_HELP_STRING([--disable-systemtap],
724 ++ [enable systemtap static probe points [default=auto]])],
725 ++ enable_systemtap=$enableval,
726 ++ enable_systemtap=auto)
727 ++
728 ++if test x$enable_systemtap != xno; then
729 ++ AC_MSG_CHECKING(sys/sdt.h in the target C library)
730 ++ have_sys_sdt_h=no
731 ++ if test -f $target_header_dir/sys/sdt.h ; then
732 ++ have_sys_sdt_h=yes
733 ++ AC_DEFINE(HAVE_SYS_SDT_H, 1,
734 ++ [Define if your target C library provides sys/sdt.h])
735 ++ fi
736 ++ AC_MSG_RESULT($have_sys_sdt_h)
737 ++ if test x$enable_systemtap = xyes ; then
738 ++ if test x$have_sys_sdt_h = xno ; then
739 ++ AC_MSG_ERROR([sys/sdt.h was not found])
740 ++ fi
741 ++ fi
742 ++fi
743 +
744 + # Check if TFmode long double should be used by default or not.
745 + # Some glibc targets used DFmode long double, but with glibc 2.4
746 +--
747 +2.17.0
748 +
749
750 diff --git a/9.4.0/gentoo/16_all_m68k-textrel-on-libgcc.patch b/9.4.0/gentoo/16_all_m68k-textrel-on-libgcc.patch
751 new file mode 100644
752 index 0000000..a2aa100
753 --- /dev/null
754 +++ b/9.4.0/gentoo/16_all_m68k-textrel-on-libgcc.patch
755 @@ -0,0 +1,93 @@
756 +https://gcc.gnu.org/PR86224
757 +
758 +From 1d89df42bdaf0745fd2a0d294471ac16f0553707 Mon Sep 17 00:00:00 2001
759 +From: Sergei Trofimovich <slyfox@g.o>
760 +Date: Sat, 28 Jul 2018 11:33:27 +0100
761 +Subject: [PATCH] libgcc: m68k: avoid absolute relocation in shared library
762 +
763 +Signed-off-by: Sergei Trofimovich <slyfox@g.o>
764 +---
765 + libgcc/config/m68k/lb1sf68.S | 19 ++++++++++++++-----
766 + 1 file changed, 14 insertions(+), 5 deletions(-)
767 +
768 +diff --git a/libgcc/config/m68k/lb1sf68.S b/libgcc/config/m68k/lb1sf68.S
769 +index 325a7c17d9b..16c6dc3f5a7 100644
770 +--- a/libgcc/config/m68k/lb1sf68.S
771 ++++ b/libgcc/config/m68k/lb1sf68.S
772 +@@ -435,7 +435,10 @@ $_exception_handler:
773 + .text
774 + FUNC(__mulsi3)
775 + .globl SYM (__mulsi3)
776 ++ .globl SYM (__mulsi3_internal)
777 ++ .hidden SYM (__mulsi3_internal)
778 + SYM (__mulsi3):
779 ++SYM (__mulsi3_internal):
780 + movew sp@(4), d0 /* x0 -> d0 */
781 + muluw sp@(10), d0 /* x0*y1 */
782 + movew sp@(6), d1 /* x1 -> d1 */
783 +@@ -458,7 +461,10 @@ SYM (__mulsi3):
784 + .text
785 + FUNC(__udivsi3)
786 + .globl SYM (__udivsi3)
787 ++ .globl SYM (__udivsi3_internal)
788 ++ .hidden SYM (__udivsi3_internal)
789 + SYM (__udivsi3):
790 ++SYM (__udivsi3_internal):
791 + #ifndef __mcoldfire__
792 + movel d2, sp@-
793 + movel sp@(12), d1 /* d1 = divisor */
794 +@@ -534,7 +540,10 @@ L2: subql IMM (1),d4
795 + .text
796 + FUNC(__divsi3)
797 + .globl SYM (__divsi3)
798 ++ .globl SYM (__divsi3_internal)
799 ++ .hidden SYM (__divsi3_internal)
800 + SYM (__divsi3):
801 ++SYM (__divsi3_internal):
802 + movel d2, sp@-
803 +
804 + moveq IMM (1), d2 /* sign of result stored in d2 (=1 or =-1) */
805 +@@ -557,7 +566,7 @@ L1: movel sp@(8), d0 /* d0 = dividend */
806 +
807 + L2: movel d1, sp@-
808 + movel d0, sp@-
809 +- PICCALL SYM (__udivsi3) /* divide abs(dividend) by abs(divisor) */
810 ++ PICCALL SYM (__udivsi3_internal) /* divide abs(dividend) by abs(divisor) */
811 + addql IMM (8), sp
812 +
813 + tstb d2
814 +@@ -577,13 +586,13 @@ SYM (__umodsi3):
815 + movel sp@(4), d0 /* d0 = dividend */
816 + movel d1, sp@-
817 + movel d0, sp@-
818 +- PICCALL SYM (__udivsi3)
819 ++ PICCALL SYM (__udivsi3_internal)
820 + addql IMM (8), sp
821 + movel sp@(8), d1 /* d1 = divisor */
822 + #ifndef __mcoldfire__
823 + movel d1, sp@-
824 + movel d0, sp@-
825 +- PICCALL SYM (__mulsi3) /* d0 = (a/b)*b */
826 ++ PICCALL SYM (__mulsi3_internal) /* d0 = (a/b)*b */
827 + addql IMM (8), sp
828 + #else
829 + mulsl d1,d0
830 +@@ -603,13 +612,13 @@ SYM (__modsi3):
831 + movel sp@(4), d0 /* d0 = dividend */
832 + movel d1, sp@-
833 + movel d0, sp@-
834 +- PICCALL SYM (__divsi3)
835 ++ PICCALL SYM (__divsi3_internal)
836 + addql IMM (8), sp
837 + movel sp@(8), d1 /* d1 = divisor */
838 + #ifndef __mcoldfire__
839 + movel d1, sp@-
840 + movel d0, sp@-
841 +- PICCALL SYM (__mulsi3) /* d0 = (a/b)*b */
842 ++ PICCALL SYM (__mulsi3_internal) /* d0 = (a/b)*b */
843 + addql IMM (8), sp
844 + #else
845 + mulsl d1,d0
846 +--
847 +2.18.0
848 +
849
850 diff --git a/9.4.0/gentoo/17_all_respect-build-cxxflags.patch b/9.4.0/gentoo/17_all_respect-build-cxxflags.patch
851 new file mode 100644
852 index 0000000..14139ea
853 --- /dev/null
854 +++ b/9.4.0/gentoo/17_all_respect-build-cxxflags.patch
855 @@ -0,0 +1,39 @@
856 +Pass CXXFLAGS as CXXFLAGS_FOR_BUILD to stage1.
857 +
858 +Fixes build failure when CXXFLAGS contains
859 +TARGET-specific flags.
860 +
861 +Tested on x86_64-pc-linux-gnu host as:
862 + # CFLAGS='-O2 -mfpu=neon-vfpv4' CXXFLAGS='-O2 -mfpu=neon-vfpv4' \
863 + armv7a-unknown-linux-gnueabihf-emerge -v1 sys-devel/gcc --quiet-build=n
864 +
865 +Fix by Peter Levine.
866 +https://bugs.gentoo.org/581406
867 +--- a/Makefile.in
868 ++++ b/Makefile.in
869 +@@ -170,6 +170,7 @@
870 + # built for the build system to override those in BASE_FLAGS_TO_PASS.
871 + EXTRA_BUILD_FLAGS = \
872 + CFLAGS="$(CFLAGS_FOR_BUILD)" \
873 ++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
874 + LDFLAGS="$(LDFLAGS_FOR_BUILD)"
875 +
876 + # This is the list of directories to built for the host system.
877 +@@ -710,6 +711,7 @@
878 + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
879 + "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
880 + "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
881 ++ "CXXFLAGS_FOR_BUILD=$(CXXFLAGS_FOR_BUILD)" \
882 + "EXPECT=$(EXPECT)" \
883 + "FLEX=$(FLEX)" \
884 + "INSTALL=$(INSTALL)" \
885 +--- a/Makefile.tpl
886 ++++ b/Makefile.tpl
887 +@@ -172,6 +172,7 @@
888 + # built for the build system to override those in BASE_FLAGS_TO_PASS.
889 + EXTRA_BUILD_FLAGS = \
890 + CFLAGS="$(CFLAGS_FOR_BUILD)" \
891 ++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
892 + LDFLAGS="$(LDFLAGS_FOR_BUILD)"
893 +
894 + # This is the list of directories to built for the host system.
895
896 diff --git a/9.4.0/gentoo/18_all_libgfortran-Werror.patch b/9.4.0/gentoo/18_all_libgfortran-Werror.patch
897 new file mode 100644
898 index 0000000..f6c26bf
899 --- /dev/null
900 +++ b/9.4.0/gentoo/18_all_libgfortran-Werror.patch
901 @@ -0,0 +1,20 @@
902 +libgfortran does not respect --disable-werror
903 +
904 +https://bugs.gentoo.org/433435
905 +http://gcc.gnu.org/PR54724
906 +
907 +
908 +--- a/libgfortran/configure.ac
909 ++++ b/libgfortran/configure.ac
910 +@@ -140,3 +140,3 @@ AM_PROG_CC_C_O
911 + if test "x$GCC" = "xyes"; then
912 +- AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring"
913 ++ AM_FCFLAGS="-I . -Wall -fimplicit-none -fno-repack-arrays -fno-underscoring"
914 + ## We like to use C11 and C99 routines when available. This makes
915 +--- a/libgfortran/configure
916 ++++ b/libgfortran/configure
917 +@@ -5764,3 +5764,3 @@ fi
918 + # Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC.
919 + if test "x$GCC" = "xyes"; then
920 +- AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring"
921 ++ AM_FCFLAGS="-I . -Wall -fimplicit-none -fno-repack-arrays -fno-underscoring"
922
923 diff --git a/9.4.0/gentoo/19_all_libgomp-Werror.patch b/9.4.0/gentoo/19_all_libgomp-Werror.patch
924 new file mode 100644
925 index 0000000..416808a
926 --- /dev/null
927 +++ b/9.4.0/gentoo/19_all_libgomp-Werror.patch
928 @@ -0,0 +1,20 @@
929 +libgomp does not respect --disable-werror
930 +
931 +https://bugs.gentoo.org/229059
932 +http://gcc.gnu.org/PR38436
933 +--- a/libgomp/configure.ac
934 ++++ b/libgomp/configure.ac
935 +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
936 + # Add -Wall -Werror if we are using GCC.
937 + if test "x$GCC" = "xyes"; then
938 +- XCFLAGS="$XCFLAGS -Wall -Werror"
939 ++ XCFLAGS="$XCFLAGS -Wall"
940 + fi
941 +--- a/libgomp/configure
942 ++++ b/libgomp/configure
943 +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
944 + # Add -Wall -Werror if we are using GCC.
945 + if test "x$GCC" = "xyes"; then
946 +- XCFLAGS="$XCFLAGS -Wall -Werror"
947 ++ XCFLAGS="$XCFLAGS -Wall"
948 + fi
949
950 diff --git a/9.4.0/gentoo/20_all_libitm-Werror.patch b/9.4.0/gentoo/20_all_libitm-Werror.patch
951 new file mode 100644
952 index 0000000..27181e0
953 --- /dev/null
954 +++ b/9.4.0/gentoo/20_all_libitm-Werror.patch
955 @@ -0,0 +1,19 @@
956 +libitm does not respect --disable-werror
957 +
958 +https://bugs.gentoo.org/475350
959 +--- a/libitm/configure.ac
960 ++++ b/libitm/configure.ac
961 +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
962 + # Add -Wall -Werror if we are using GCC.
963 + if test "x$GCC" = "xyes"; then
964 +- XCFLAGS="$XCFLAGS -Wall -Werror"
965 ++ XCFLAGS="$XCFLAGS -Wall"
966 + fi
967 +--- a/libitm/configure
968 ++++ b/libitm/configure
969 +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
970 + # Add -Wall -Werror if we are using GCC.
971 + if test "x$GCC" = "xyes"; then
972 +- XCFLAGS="$XCFLAGS -Wall -Werror"
973 ++ XCFLAGS="$XCFLAGS -Wall"
974 + fi
975
976 diff --git a/9.4.0/gentoo/21_all_libatomic-Werror.patch b/9.4.0/gentoo/21_all_libatomic-Werror.patch
977 new file mode 100644
978 index 0000000..0550722
979 --- /dev/null
980 +++ b/9.4.0/gentoo/21_all_libatomic-Werror.patch
981 @@ -0,0 +1,19 @@
982 +libatomic does not respect --disable-werror
983 +
984 +https://bugs.gentoo.org/475350
985 +--- a/libatomic/configure.ac
986 ++++ b/libatomic/configure.ac
987 +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
988 + # Add -Wall -Werror if we are using GCC.
989 + if test "x$GCC" = "xyes"; then
990 +- XCFLAGS="$XCFLAGS -Wall -Werror"
991 ++ XCFLAGS="$XCFLAGS -Wall"
992 + fi
993 +--- a/libatomic/configure
994 ++++ b/libatomic/configure
995 +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
996 + # Add -Wall -Werror if we are using GCC.
997 + if test "x$GCC" = "xyes"; then
998 +- XCFLAGS="$XCFLAGS -Wall -Werror"
999 ++ XCFLAGS="$XCFLAGS -Wall"
1000 + fi
1001
1002 diff --git a/9.4.0/gentoo/22_all_libbacktrace-Werror.patch b/9.4.0/gentoo/22_all_libbacktrace-Werror.patch
1003 new file mode 100644
1004 index 0000000..57dd284
1005 --- /dev/null
1006 +++ b/9.4.0/gentoo/22_all_libbacktrace-Werror.patch
1007 @@ -0,0 +1,17 @@
1008 +libbacktrace does not respect --disable-werror
1009 +
1010 +https://bugs.gentoo.org/667104
1011 +--- a/libbacktrace/configure
1012 ++++ b/libbacktrace/configure
1013 +@@ -11634,3 +11634,3 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
1014 + if test -n "${with_target_subdir}"; then
1015 +- WARN_FLAGS="$WARN_FLAGS -Werror"
1016 ++ WARN_FLAGS="$WARN_FLAGS"
1017 + fi
1018 +--- a/libbacktrace/configure.ac
1019 ++++ b/libbacktrace/configure.ac
1020 +@@ -138,3 +138,3 @@ ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
1021 + if test -n "${with_target_subdir}"; then
1022 +- WARN_FLAGS="$WARN_FLAGS -Werror"
1023 ++ WARN_FLAGS="$WARN_FLAGS"
1024 + fi
1025
1026 diff --git a/9.4.0/gentoo/23_all_libsanitizer-Werror.patch b/9.4.0/gentoo/23_all_libsanitizer-Werror.patch
1027 new file mode 100644
1028 index 0000000..0e484a4
1029 --- /dev/null
1030 +++ b/9.4.0/gentoo/23_all_libsanitizer-Werror.patch
1031 @@ -0,0 +1,17 @@
1032 +libsanitizer does not respect --disable-werror
1033 +
1034 +https://bugs.gentoo.org/667104
1035 +--- a/libsanitizer/libbacktrace/Makefile.am
1036 ++++ b/libsanitizer/libbacktrace/Makefile.am
1037 +@@ -37,3 +37,3 @@ AM_CPPFLAGS = -I $(top_srcdir)/../include -I $(top_srcdir)/../libgcc \
1038 + WARN_FLAGS = -W -Wall -Wwrite-strings -Wmissing-format-attribute \
1039 +- -Wcast-qual -Werror
1040 ++ -Wcast-qual
1041 + C_WARN_FLAGS = $(WARN_FLAGS) -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
1042 +--- a/libsanitizer/libbacktrace/Makefile.in
1043 ++++ b/libsanitizer/libbacktrace/Makefile.in
1044 +@@ -297,3 +297,3 @@ AM_CPPFLAGS = -I $(top_srcdir)/../include -I $(top_srcdir)/../libgcc \
1045 + WARN_FLAGS = -W -Wall -Wwrite-strings -Wmissing-format-attribute \
1046 +- -Wcast-qual -Werror
1047 ++ -Wcast-qual
1048 +
1049
1050 diff --git a/9.4.0/gentoo/24_all_libstdcxx-no-vtv.patch b/9.4.0/gentoo/24_all_libstdcxx-no-vtv.patch
1051 new file mode 100644
1052 index 0000000..68508bd
1053 --- /dev/null
1054 +++ b/9.4.0/gentoo/24_all_libstdcxx-no-vtv.patch
1055 @@ -0,0 +1,61 @@
1056 +Final libstdc++.so should not contain rpath to make libvtv usable.
1057 +It's up to final binaries to link against proper libvtv.
1058 +
1059 +Bug: https://bugs.gentoo.org/582524
1060 +Bug: https://gcc.gnu.org/PR85884
1061 +--- a/libstdc++-v3/src/Makefile.am
1062 ++++ b/libstdc++-v3/src/Makefile.am
1063 +@@ -217,7 +217,6 @@ CXXLINK = \
1064 + $(LIBTOOL) --tag CXX \
1065 + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
1066 + --mode=link $(CXX) \
1067 +- $(VTV_CXXLINKFLAGS) \
1068 + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
1069 +
1070 + # Symbol versioning for shared libraries.
1071 +--- a/libstdc++-v3/src/Makefile.in
1072 ++++ b/libstdc++-v3/src/Makefile.in
1073 +@@ -511,7 +511,6 @@ CXXLINK = \
1074 + $(LIBTOOL) --tag CXX \
1075 + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
1076 + --mode=link $(CXX) \
1077 +- $(VTV_CXXLINKFLAGS) \
1078 + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
1079 +
1080 + @ENABLE_SYMVERS_TRUE@CLEANFILES = libstdc++-symbols.ver $(version_dep)
1081 +--- a/libstdc++-v3/src/c++11/Makefile.am
1082 ++++ b/libstdc++-v3/src/c++11/Makefile.am
1083 +@@ -204,5 +204,4 @@ CXXLINK = \
1084 + $(LIBTOOL) --tag CXX --tag disable-shared \
1085 + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
1086 + --mode=link $(CXX) \
1087 +- $(VTV_CXXLINKFLAGS) \
1088 + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
1089 +--- a/libstdc++-v3/src/c++11/Makefile.in
1090 ++++ b/libstdc++-v3/src/c++11/Makefile.in
1091 +@@ -496,7 +496,6 @@ CXXLINK = \
1092 + $(LIBTOOL) --tag CXX --tag disable-shared \
1093 + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
1094 + --mode=link $(CXX) \
1095 +- $(VTV_CXXLINKFLAGS) \
1096 + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
1097 +
1098 + all: all-am
1099 +--- a/libstdc++-v3/src/c++98/Makefile.am
1100 ++++ b/libstdc++-v3/src/c++98/Makefile.am
1101 +@@ -273,5 +273,4 @@ CXXLINK = \
1102 + $(LIBTOOL) --tag CXX --tag disable-shared \
1103 + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
1104 + --mode=link $(CXX) \
1105 +- $(VTV_CXXLINKFLAGS) \
1106 + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
1107 +--- a/libstdc++-v3/src/c++98/Makefile.in
1108 ++++ b/libstdc++-v3/src/c++98/Makefile.in
1109 +@@ -500,7 +500,6 @@ CXXLINK = \
1110 + $(LIBTOOL) --tag CXX --tag disable-shared \
1111 + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
1112 + --mode=link $(CXX) \
1113 +- $(VTV_CXXLINKFLAGS) \
1114 + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
1115 +
1116 + all: all-am
1117
1118 diff --git a/9.4.0/gentoo/25_all_disable-riscv32-ABIs.patch b/9.4.0/gentoo/25_all_disable-riscv32-ABIs.patch
1119 new file mode 100644
1120 index 0000000..ad0128a
1121 --- /dev/null
1122 +++ b/9.4.0/gentoo/25_all_disable-riscv32-ABIs.patch
1123 @@ -0,0 +1,53 @@
1124 +Autogenerated patch disabling the 32bit RISCV support
1125 +See https://gcc.gnu.org/PR90419
1126 +
1127 +diff -ruN gcc-9.1.0.orig/gcc/config/riscv/t-linux-multilib gcc-9.1.0/gcc/config/riscv/t-linux-multilib
1128 +--- gcc-9.1.0.orig/gcc/config/riscv/t-linux-multilib 2017-02-06 22:38:37.000000000 +0100
1129 ++++ gcc-9.1.0/gcc/config/riscv/t-linux-multilib 2019-05-18 23:04:54.849400774 +0200
1130 +@@ -1,40 +1,18 @@
1131 + # This file was generated by multilib-generator with the command:
1132 +-# ./multilib-generator rv32imac-ilp32-rv32ima,rv32imaf,rv32imafd,rv32imafc,rv32imafdc- rv32imafdc-ilp32d-rv32imafd- rv64imac-lp64-rv64ima,rv64imaf,rv64imafd,rv64imafc,rv64imafdc- rv64imafdc-lp64d-rv64imafd-
1133 +-MULTILIB_OPTIONS = march=rv32imac/march=rv32ima/march=rv32imaf/march=rv32imafd/march=rv32imafc/march=rv32imafdc/march=rv32g/march=rv32gc/march=rv64imac/march=rv64ima/march=rv64imaf/march=rv64imafd/march=rv64imafc/march=rv64imafdc/march=rv64g/march=rv64gc mabi=ilp32/mabi=ilp32d/mabi=lp64/mabi=lp64d
1134 +-MULTILIB_DIRNAMES = rv32imac \
1135 +-rv32ima \
1136 +-rv32imaf \
1137 +-rv32imafd \
1138 +-rv32imafc \
1139 +-rv32imafdc \
1140 +-rv32g \
1141 +-rv32gc \
1142 +-rv64imac \
1143 ++# ./multilib-generator rv64imac-lp64-rv64ima,rv64imaf,rv64imafd,rv64imafc,rv64imafdc- rv64imafdc-lp64d-rv64imafd-
1144 ++MULTILIB_OPTIONS = march=rv64imac/march=rv64ima/march=rv64imaf/march=rv64imafd/march=rv64imafc/march=rv64imafdc/march=rv64g/march=rv64gc mabi=lp64/mabi=lp64d
1145 ++MULTILIB_DIRNAMES = rv64imac \
1146 + rv64ima \
1147 + rv64imaf \
1148 + rv64imafd \
1149 + rv64imafc \
1150 + rv64imafdc \
1151 + rv64g \
1152 +-rv64gc ilp32 \
1153 +-ilp32d \
1154 +-lp64 \
1155 ++rv64gc lp64 \
1156 + lp64d
1157 +-MULTILIB_REQUIRED = march=rv32imac/mabi=ilp32 \
1158 +-march=rv32imafdc/mabi=ilp32d \
1159 +-march=rv64imac/mabi=lp64 \
1160 ++MULTILIB_REQUIRED = march=rv64imac/mabi=lp64 \
1161 + march=rv64imafdc/mabi=lp64d
1162 +-MULTILIB_REUSE = march.rv32imac/mabi.ilp32=march.rv32ima/mabi.ilp32 \
1163 +-march.rv32imac/mabi.ilp32=march.rv32imaf/mabi.ilp32 \
1164 +-march.rv32imac/mabi.ilp32=march.rv32imafd/mabi.ilp32 \
1165 +-march.rv32imac/mabi.ilp32=march.rv32imafc/mabi.ilp32 \
1166 +-march.rv32imac/mabi.ilp32=march.rv32imafdc/mabi.ilp32 \
1167 +-march.rv32imac/mabi.ilp32=march.rv32g/mabi.ilp32 \
1168 +-march.rv32imac/mabi.ilp32=march.rv32gc/mabi.ilp32 \
1169 +-march.rv32imafdc/mabi.ilp32d=march.rv32imafd/mabi.ilp32d \
1170 +-march.rv32imafdc/mabi.ilp32d=march.rv32gc/mabi.ilp32d \
1171 +-march.rv32imafdc/mabi.ilp32d=march.rv32g/mabi.ilp32d \
1172 +-march.rv64imac/mabi.lp64=march.rv64ima/mabi.lp64 \
1173 ++MULTILIB_REUSE = march.rv64imac/mabi.lp64=march.rv64ima/mabi.lp64 \
1174 + march.rv64imac/mabi.lp64=march.rv64imaf/mabi.lp64 \
1175 + march.rv64imac/mabi.lp64=march.rv64imafd/mabi.lp64 \
1176 + march.rv64imac/mabi.lp64=march.rv64imafc/mabi.lp64 \
1177
1178 diff --git a/9.4.0/gentoo/26_all_default_ssp-buffer-size.patch b/9.4.0/gentoo/26_all_default_ssp-buffer-size.patch
1179 new file mode 100644
1180 index 0000000..dddd06b
1181 --- /dev/null
1182 +++ b/9.4.0/gentoo/26_all_default_ssp-buffer-size.patch
1183 @@ -0,0 +1,14 @@
1184 +Change the minimal SSP buffer size.
1185 +
1186 +https://bugs.gentoo.org/484714
1187 +--- a/gcc/params.def 2016-03-30 09:47:40.000000000 +0200
1188 ++++ b/gcc/params.def 2016-09-19 12:56:58.443179039 +0200
1189 +@@ -673,7 +673,7 @@ DEFPARAM (PARAM_INTEGER_SHARE_LIMIT,
1190 + DEFPARAM (PARAM_SSP_BUFFER_SIZE,
1191 + "ssp-buffer-size",
1192 + "The lower bound for a buffer to be considered for stack smashing protection.",
1193 +- 8, 1, 0)
1194 ++ 4, 1, 0)
1195 +
1196 + DEFPARAM (PARAM_MIN_SIZE_FOR_STACK_SHARING,
1197 + "min-size-for-stack-sharing",
1198
1199 diff --git a/9.4.0/gentoo/27_all_hppa-faster-synth_mult.patch b/9.4.0/gentoo/27_all_hppa-faster-synth_mult.patch
1200 new file mode 100644
1201 index 0000000..e93aa40
1202 --- /dev/null
1203 +++ b/9.4.0/gentoo/27_all_hppa-faster-synth_mult.patch
1204 @@ -0,0 +1,44 @@
1205 +From 73a841928cc1b86f43108d2383a6242e7e61a785 Mon Sep 17 00:00:00 2001
1206 +From: Sergei Trofimovich <slyfox@g.o>
1207 +Date: Tue, 31 Mar 2020 23:58:05 +0100
1208 +Subject: [PATCH] gcc/expmed.h: increase cache size from 10^3 to 10^6
1209 +
1210 +Without this patch is takes dev-libs/xxhash 1-2 hours
1211 +to compile. With this patch - TODO measurements.
1212 +
1213 +It workarounds deficiency of synth_mult() which evics
1214 +cache entries as it calculates optimal multiplication
1215 +algorithm. xxhash is especially hevyweight as it's a
1216 +64-bit multiplication of large prime constants.
1217 +
1218 +Bug: https://gcc.gnu.org/PR87256
1219 +Signed-off-by: Sergei Trofimovich <slyfox@g.o>
1220 +---
1221 + gcc/expmed.h | 13 ++++++++-----
1222 + 1 file changed, 8 insertions(+), 5 deletions(-)
1223 +
1224 +--- a/gcc/expmed.h
1225 ++++ b/gcc/expmed.h
1226 +@@ -127,11 +127,14 @@ struct alg_hash_entry {
1227 + };
1228 +
1229 + /* The number of cache/hash entries. */
1230 +-#if HOST_BITS_PER_WIDE_INT == 64
1231 +-#define NUM_ALG_HASH_ENTRIES 1031
1232 +-#else
1233 +-#define NUM_ALG_HASH_ENTRIES 307
1234 +-#endif
1235 ++/*
1236 ++ * Workaround hppa2.0 synth_mult deficiency
1237 ++ * and allocate ~1 million slots:
1238 ++ * https://gcc.gnu.org/PR87256
1239 ++ * That should increase RAM usage up to ~24MB
1240 ++ * per process.
1241 ++ */
1242 ++#define NUM_ALG_HASH_ENTRIES 1000003
1243 +
1244 + #define NUM_MODE_INT \
1245 + (MAX_MODE_INT - MIN_MODE_INT + 1)
1246 +--
1247 +2.26.0
1248 +
1249
1250 diff --git a/9.4.0/gentoo/28_all_libcpp-ar.patch b/9.4.0/gentoo/28_all_libcpp-ar.patch
1251 new file mode 100644
1252 index 0000000..55f2944
1253 --- /dev/null
1254 +++ b/9.4.0/gentoo/28_all_libcpp-ar.patch
1255 @@ -0,0 +1,143 @@
1256 +https://bugs.gentoo.org/718004
1257 +https://gcc.gnu.org/PR94657
1258 +
1259 +Make sue we use ${CHOST}-ar and not 'ar'.
1260 +
1261 +--- a/libcpp/configure.ac
1262 ++++ b/libcpp/configure.ac
1263 +@@ -12,6 +12,7 @@ AC_PROG_INSTALL
1264 + AC_PROG_CC
1265 + AC_PROG_CXX
1266 + AC_PROG_RANLIB
1267 ++AC_CHECK_TOOL(AR, ar)
1268 +
1269 + AC_USE_SYSTEM_EXTENSIONS
1270 + AC_SYS_LARGEFILE
1271 +--- a/libcpp/Makefile.in
1272 ++++ b/libcpp/Makefile.in
1273 +@@ -25,7 +25,7 @@ srcdir = @srcdir@
1274 + top_builddir = .
1275 + VPATH = @srcdir@
1276 + INSTALL = @INSTALL@
1277 +-AR = ar
1278 ++AR = @AR@
1279 + ARFLAGS = cru
1280 + ACLOCAL = @ACLOCAL@
1281 + AUTOCONF = @AUTOCONF@
1282 +--- a/libcpp/configure
1283 ++++ b/libcpp/configure
1284 +@@ -657,6 +657,7 @@ ACLOCAL
1285 + EGREP
1286 + GREP
1287 + CPP
1288 ++AR
1289 + RANLIB
1290 + ac_ct_CXX
1291 + CXXFLAGS
1292 +@@ -1038,6 +1039,7 @@ do
1293 + | -silent | --silent | --silen | --sile | --sil)
1294 + silent=yes ;;
1295 +
1296 ++
1297 + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1298 + ac_prev=sbindir ;;
1299 + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1300 +@@ -4006,6 +4008,98 @@ else
1301 + RANLIB="$ac_cv_prog_RANLIB"
1302 + fi
1303 +
1304 ++if test -n "$ac_tool_prefix"; then
1305 ++ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
1306 ++set dummy ${ac_tool_prefix}ar; ac_word=$2
1307 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1308 ++$as_echo_n "checking for $ac_word... " >&6; }
1309 ++if ${ac_cv_prog_AR+:} false; then :
1310 ++ $as_echo_n "(cached) " >&6
1311 ++else
1312 ++ if test -n "$AR"; then
1313 ++ ac_cv_prog_AR="$AR" # Let the user override the test.
1314 ++else
1315 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1316 ++for as_dir in $PATH
1317 ++do
1318 ++ IFS=$as_save_IFS
1319 ++ test -z "$as_dir" && as_dir=.
1320 ++ for ac_exec_ext in '' $ac_executable_extensions; do
1321 ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
1322 ++ ac_cv_prog_AR="${ac_tool_prefix}ar"
1323 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1324 ++ break 2
1325 ++ fi
1326 ++done
1327 ++ done
1328 ++IFS=$as_save_IFS
1329 ++
1330 ++fi
1331 ++fi
1332 ++AR=$ac_cv_prog_AR
1333 ++if test -n "$AR"; then
1334 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
1335 ++$as_echo "$AR" >&6; }
1336 ++else
1337 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1338 ++$as_echo "no" >&6; }
1339 ++fi
1340 ++
1341 ++
1342 ++fi
1343 ++if test -z "$ac_cv_prog_AR"; then
1344 ++ ac_ct_AR=$AR
1345 ++ # Extract the first word of "ar", so it can be a program name with args.
1346 ++set dummy ar; ac_word=$2
1347 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1348 ++$as_echo_n "checking for $ac_word... " >&6; }
1349 ++if ${ac_cv_prog_ac_ct_AR+:} false; then :
1350 ++ $as_echo_n "(cached) " >&6
1351 ++else
1352 ++ if test -n "$ac_ct_AR"; then
1353 ++ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
1354 ++else
1355 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1356 ++for as_dir in $PATH
1357 ++do
1358 ++ IFS=$as_save_IFS
1359 ++ test -z "$as_dir" && as_dir=.
1360 ++ for ac_exec_ext in '' $ac_executable_extensions; do
1361 ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
1362 ++ ac_cv_prog_ac_ct_AR="ar"
1363 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1364 ++ break 2
1365 ++ fi
1366 ++done
1367 ++ done
1368 ++IFS=$as_save_IFS
1369 ++
1370 ++fi
1371 ++fi
1372 ++ac_ct_AR=$ac_cv_prog_ac_ct_AR
1373 ++if test -n "$ac_ct_AR"; then
1374 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
1375 ++$as_echo "$ac_ct_AR" >&6; }
1376 ++else
1377 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1378 ++$as_echo "no" >&6; }
1379 ++fi
1380 ++
1381 ++ if test "x$ac_ct_AR" = x; then
1382 ++ AR=""
1383 ++ else
1384 ++ case $cross_compiling:$ac_tool_warned in
1385 ++yes:)
1386 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
1387 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
1388 ++ac_tool_warned=yes ;;
1389 ++esac
1390 ++ AR=$ac_ct_AR
1391 ++ fi
1392 ++else
1393 ++ AR="$ac_cv_prog_AR"
1394 ++fi
1395 ++
1396 +
1397 +
1398 + ac_ext=c
1399
1400 diff --git a/9.4.0/gentoo/29_all_plugin-objdump.patch b/9.4.0/gentoo/29_all_plugin-objdump.patch
1401 new file mode 100644
1402 index 0000000..a9c33fd
1403 --- /dev/null
1404 +++ b/9.4.0/gentoo/29_all_plugin-objdump.patch
1405 @@ -0,0 +1,34 @@
1406 +https://gcc.gnu.org/PR95648
1407 +--- a/config/gcc-plugin.m4
1408 ++++ b/config/gcc-plugin.m4
1409 +@@ -45,7 +45,7 @@ AC_DEFUN([GCC_ENABLE_PLUGINS],
1410 + ;;
1411 + *)
1412 + if test x$build = x$host; then
1413 +- export_sym_check="objdump${exeext} -T"
1414 ++ export_sym_check="$ac_cv_prog_OBJDUMP -T"
1415 + elif test x$host = x$target; then
1416 + export_sym_check="$gcc_cv_objdump -T"
1417 + else
1418 +--- a/gcc/configure
1419 ++++ b/gcc/configure
1420 +@@ -30386,7 +30386,7 @@ fi
1421 + ;;
1422 + *)
1423 + if test x$build = x$host; then
1424 +- export_sym_check="objdump${exeext} -T"
1425 ++ export_sym_check="$ac_cv_prog_OBJDUMP -T"
1426 + elif test x$host = x$target; then
1427 + export_sym_check="$gcc_cv_objdump -T"
1428 + else
1429 +--- a/libcc1/configure
1430 ++++ b/libcc1/configure
1431 +@@ -14819,7 +14819,7 @@ fi
1432 + ;;
1433 + *)
1434 + if test x$build = x$host; then
1435 +- export_sym_check="objdump${exeext} -T"
1436 ++ export_sym_check="$ac_cv_prog_OBJDUMP -T"
1437 + elif test x$host = x$target; then
1438 + export_sym_check="$gcc_cv_objdump -T"
1439 + else
1440
1441 diff --git a/9.4.0/gentoo/README.history b/9.4.0/gentoo/README.history
1442 new file mode 100644
1443 index 0000000..2adb561
1444 --- /dev/null
1445 +++ b/9.4.0/gentoo/README.history
1446 @@ -0,0 +1,30 @@
1447 +1 01 June 2021
1448 + + 01_all_default-fortify-source.patch
1449 + + 02_all_default-warn-format-security.patch
1450 + + 03_all_default-warn-trampolines.patch
1451 + + 04_all_nossp-on-nostdlib.patch
1452 + + 05_all_alpha-mieee-default.patch
1453 + + 06_all_ia64_note.GNU-stack.patch
1454 + + 07_all_i386_libgcc_note.GNU-stack.patch
1455 + + 08_all_libiberty-asprintf.patch
1456 + + 09_all_libiberty-pic.patch
1457 + + 10_all_nopie-all-flags.patch
1458 + + 11_all_extra-options.patch
1459 + + 12_all_pr55930-dependency-tracking.patch
1460 + + 13_all_sh-drop-sysroot-suffix.patch
1461 + + 14_all_ia64-TEXTREL.patch
1462 + + 15_all_disable-systemtap-switch.patch
1463 + + 16_all_m68k-textrel-on-libgcc.patch
1464 + + 17_all_respect-build-cxxflags.patch
1465 + + 18_all_libgfortran-Werror.patch
1466 + + 19_all_libgomp-Werror.patch
1467 + + 20_all_libitm-Werror.patch
1468 + + 21_all_libatomic-Werror.patch
1469 + + 22_all_libbacktrace-Werror.patch
1470 + + 23_all_libsanitizer-Werror.patch
1471 + + 24_all_libstdcxx-no-vtv.patch
1472 + + 25_all_disable-riscv32-ABIs.patch
1473 + + 26_all_default_ssp-buffer-size.patch
1474 + + 27_all_hppa-faster-synth_mult.patch
1475 + + 28_all_libcpp-ar.patch
1476 + + 29_all_plugin-objdump.patch