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: 12.0.0/gentoo/
Date: Tue, 20 Apr 2021 17:43:54
Message-Id: 1618940431.cfd464cfd5b42c6759a0cf3322da78f4f36849f0.slyfox@gentoo
1 commit: cfd464cfd5b42c6759a0cf3322da78f4f36849f0
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 20 17:40:31 2021 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 20 17:40:31 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=cfd464cf
7
8 12.0.0: start patch with a branch (11.0.0 copy)
9
10 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
11
12 12.0.0/gentoo/01_all_default-fortify-source.patch | 22 ++++
13 .../02_all_default-warn-format-security.patch | 22 ++++
14 .../gentoo/03_all_default-warn-trampolines.patch | 13 +++
15 12.0.0/gentoo/04_all_nossp-on-nostdlib.patch | 27 +++++
16 12.0.0/gentoo/05_all_alpha-mieee-default.patch | 39 +++++++
17 12.0.0/gentoo/06_all_ia64_note.GNU-stack.patch | 92 ++++++++++++++++
18 12.0.0/gentoo/07_all_libiberty-asprintf.patch | 18 +++
19 12.0.0/gentoo/08_all_libiberty-pic.patch | 10 ++
20 12.0.0/gentoo/09_all_nopie-all-flags.patch | 18 +++
21 12.0.0/gentoo/10_all_sh-drop-sysroot-suffix.patch | 32 ++++++
22 12.0.0/gentoo/11_all_ia64-TEXTREL.patch | 22 ++++
23 .../gentoo/12_all_disable-systemtap-switch.patch | 122 +++++++++++++++++++++
24 12.0.0/gentoo/13_all_m68k-textrel-on-libgcc.patch | 93 ++++++++++++++++
25 12.0.0/gentoo/14_all_respect-build-cxxflags.patch | 39 +++++++
26 12.0.0/gentoo/15_all_libgomp-Werror.patch | 20 ++++
27 12.0.0/gentoo/16_all_libitm-Werror.patch | 19 ++++
28 12.0.0/gentoo/17_all_libatomic-Werror.patch | 19 ++++
29 12.0.0/gentoo/18_all_libbacktrace-Werror.patch | 17 +++
30 12.0.0/gentoo/19_all_libsanitizer-Werror.patch | 17 +++
31 12.0.0/gentoo/20_all_libstdcxx-no-vtv.patch | 61 +++++++++++
32 12.0.0/gentoo/21_all_disable-riscv32-ABIs.patch | 53 +++++++++
33 12.0.0/gentoo/22_all_default_ssp-buffer-size.patch | 14 +++
34 12.0.0/gentoo/23_all_EXTRA_OPTIONS-z-now.patch | 26 +++++
35 ...all_EXTRA_OPTIONS-fstack-clash-protection.patch | 65 +++++++++++
36 .../25_all_lto-intl-workaround-PR95194.patch | 20 ++++
37 12.0.0/gentoo/26_all_plugin-objdump.patch | 34 ++++++
38 12.0.0/gentoo/README.history | 27 +++++
39 27 files changed, 961 insertions(+)
40
41 diff --git a/12.0.0/gentoo/01_all_default-fortify-source.patch b/12.0.0/gentoo/01_all_default-fortify-source.patch
42 new file mode 100644
43 index 0000000..d307474
44 --- /dev/null
45 +++ b/12.0.0/gentoo/01_all_default-fortify-source.patch
46 @@ -0,0 +1,22 @@
47 +Taken Debian's patch and removed docs matches:
48 + https://salsa.debian.org/toolchain-team/gcc.git
49 +Also see https://bugs.gentoo.org/621036 where
50 +initially Gentoo used too complicated macro.
51 +
52 +# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++,
53 +# DP: if the optimization level is > 0
54 +--- a/gcc/c-family/c-cppbuiltin.c
55 ++++ b/gcc/c-family/c-cppbuiltin.c
56 +@@ -951,6 +951,12 @@ c_cpp_builtins (cpp_reader *pfile)
57 + builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
58 + builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
59 +
60 ++#if !defined(ACCEL_COMPILER)
61 ++ /* Fortify Source enabled by default for optimization levels > 0 */
62 ++ if (optimize)
63 ++ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
64 ++#endif
65 ++
66 + /* Misc. */
67 + if (flag_gnu89_inline)
68 + cpp_define (pfile, "__GNUC_GNU_INLINE__");
69
70 diff --git a/12.0.0/gentoo/02_all_default-warn-format-security.patch b/12.0.0/gentoo/02_all_default-warn-format-security.patch
71 new file mode 100644
72 index 0000000..f809abd
73 --- /dev/null
74 +++ b/12.0.0/gentoo/02_all_default-warn-format-security.patch
75 @@ -0,0 +1,22 @@
76 +Enable -Wformat and -Wformat-security by default.
77 +
78 +--- a/gcc/c-family/c.opt 2016-03-23 18:51:56.000000000 +0100
79 ++++ b/gcc/c-family/c.opt 2016-04-28 23:45:54.063351272 +0200
80 +@@ -459,7 +459,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonlit
81 + Warn about format strings that are not literals.
82 +
83 + Wformat-security
84 +-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
85 ++C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
86 + Warn about possible security problems with format functions.
87 +
88 + Wformat-signedness
89 +@@ -475,7 +475,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_l
90 + Warn about zero-length formats.
91 +
92 + Wformat=
93 +-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
94 ++C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
95 + Warn about printf/scanf/strftime/strfmon format string anomalies.
96 +
97 + Wignored-qualifiers
98
99 diff --git a/12.0.0/gentoo/03_all_default-warn-trampolines.patch b/12.0.0/gentoo/03_all_default-warn-trampolines.patch
100 new file mode 100644
101 index 0000000..7a644cb
102 --- /dev/null
103 +++ b/12.0.0/gentoo/03_all_default-warn-trampolines.patch
104 @@ -0,0 +1,13 @@
105 +Enable -Wtrampolines by default.
106 +
107 +--- a/gcc/common.opt
108 ++++ b/gcc/common.opt
109 +@@ -712,7 +712,7 @@ Common Var(warn_system_headers) Warning
110 + Do not suppress warnings from system headers.
111 +
112 + Wtrampolines
113 +-Common Var(warn_trampolines) Warning
114 ++Common Var(warn_trampolines) Init(1) Warning
115 + Warn whenever a trampoline is generated.
116 +
117 + Wtype-limits
118
119 diff --git a/12.0.0/gentoo/04_all_nossp-on-nostdlib.patch b/12.0.0/gentoo/04_all_nossp-on-nostdlib.patch
120 new file mode 100644
121 index 0000000..4e581a5
122 --- /dev/null
123 +++ b/12.0.0/gentoo/04_all_nossp-on-nostdlib.patch
124 @@ -0,0 +1,27 @@
125 +Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
126 +
127 +https://bugs.gentoo.org/484714
128 +--- a/gcc/gcc.c 2017-07-04 09:15:57.740793000 +0200
129 ++++ b/gcc/gcc.c 2018-03-02 13:58:44.387741114 +0100
130 +@@ -857,6 +857,12 @@ proper position among the other output f
131 + #define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G"
132 + #endif
133 +
134 ++#ifdef ENABLE_DEFAULT_SSP
135 ++#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} "
136 ++#else
137 ++#define NO_SSP_SPEC ""
138 ++#endif
139 ++
140 + #ifndef LINK_SSP_SPEC
141 + #ifdef TARGET_LIBC_PROVIDES_SSP
142 + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
143 +@@ -1131,7 +1148,7 @@ static const char *cc1_options =
144 + %{-version:--version}\
145 + %{-help=*:--help=%*}\
146 + %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
147 +- %{fsyntax-only:-o %j} %{-param*}\
148 ++ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
149 + %{coverage:-fprofile-arcs -ftest-coverage}\
150 + %{fprofile-arcs|fprofile-generate*|coverage:\
151 + %{!fprofile-update=single:\
152
153 diff --git a/12.0.0/gentoo/05_all_alpha-mieee-default.patch b/12.0.0/gentoo/05_all_alpha-mieee-default.patch
154 new file mode 100644
155 index 0000000..cf33f14
156 --- /dev/null
157 +++ b/12.0.0/gentoo/05_all_alpha-mieee-default.patch
158 @@ -0,0 +1,39 @@
159 +Set the default behavior on alpha to use -mieee since the large majority of
160 +time we want this (bad/weird things can happen with packages built without
161 +it).
162 +
163 +To satisfy those people who may not want -mieee forced on them all the time,
164 +we also provide -mno-ieee.
165 +
166 +Patch by Mike Frysinger <vapier@g.o>
167 +
168 +Note: upstream doesn't want to take this due to long standing behavior, and
169 +because it'd make behavior across OS's inconsistent:
170 + https://gcc.gnu.org/ml/gcc-patches/2003-07/msg02144.html
171 +
172 +This makes sense for upstream, but Gentoo is more concerned about packages
173 +behaving the same across arches under Linux.
174 +
175 +--- a/gcc/config/alpha/alpha.h
176 ++++ b/gcc/config/alpha/alpha.h
177 +@@ -96,6 +96,8 @@ along with GCC; see the file COPYING3. If not see
178 + while (0)
179 + #endif
180 +
181 ++#define CPP_SPEC "%{!no-ieee:-mieee}"
182 ++
183 + /* Run-time compilation parameters selecting different hardware subsets. */
184 +
185 + /* Which processor to schedule for. The cpu attribute defines a list that
186 +--- a/gcc/config/alpha/alpha.opt
187 ++++ b/gcc/config/alpha/alpha.opt
188 +@@ -35,7 +35,7 @@
189 + Request IEEE-conformant math library routines (OSF/1).
190 +
191 + mieee
192 +-Target RejectNegative Mask(IEEE)
193 ++Target Mask(IEEE)
194 + Emit IEEE-conformant code, without inexact exceptions.
195 +
196 + mieee-with-inexact
197 +
198
199 diff --git a/12.0.0/gentoo/06_all_ia64_note.GNU-stack.patch b/12.0.0/gentoo/06_all_ia64_note.GNU-stack.patch
200 new file mode 100644
201 index 0000000..66a787e
202 --- /dev/null
203 +++ b/12.0.0/gentoo/06_all_ia64_note.GNU-stack.patch
204 @@ -0,0 +1,92 @@
205 +http://gcc.gnu.org/PR21098
206 +
207 +
208 +2004-09-20 Jakub Jelinek <jakub@××××××.com>
209 +
210 + * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
211 + on ppc64-linux.
212 +
213 + * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
214 + ia64-linux.
215 + * config/ia64/crtbegin.asm: Likewise.
216 + * config/ia64/crtend.asm: Likewise.
217 + * config/ia64/crti.asm: Likewise.
218 + * config/ia64/crtn.asm: Likewise.
219 +
220 +2004-05-14 Jakub Jelinek <jakub@××××××.com>
221 +
222 + * config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
223 +
224 +
225 +--- a/gcc/config/ia64/linux.h
226 ++++ b/gcc/config/ia64/linux.h
227 +@@ -24,6 +24,8 @@ a copy of the GCC Runtime Library Exception along with this program;
228 + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
229 + <http://www.gnu.org/licenses/>. */
230 +
231 ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
232 ++
233 + /* This is for -profile to use -lc_p instead of -lc. */
234 + #undef CC1_SPEC
235 + #define CC1_SPEC "%{profile:-p} %{G*}"
236 +--- a/gcc/config/rs6000/ppc-asm.h
237 ++++ b/gcc/config/rs6000/ppc-asm.h
238 +@@ -352,7 +352,7 @@ GLUE(.L,name): \
239 + #endif
240 + #endif
241 +
242 +-#if defined __linux__ && !defined __powerpc64__
243 ++#if defined __linux__
244 + .section .note.GNU-stack
245 + .previous
246 + #endif
247 +--- a/libgcc/config/ia64/crtbegin.S
248 ++++ b/libgcc/config/ia64/crtbegin.S
249 +@@ -252,3 +252,7 @@ __do_jv_register_classes:
250 + .weak __cxa_finalize
251 + #endif
252 + .weak _Jv_RegisterClasses
253 ++
254 ++#ifdef __linux__
255 ++.section .note.GNU-stack; .previous
256 ++#endif
257 +--- a/libgcc/config/ia64/crtend.S
258 ++++ b/libgcc/config/ia64/crtend.S
259 +@@ -119,3 +119,6 @@ __do_global_ctors_aux:
260 +
261 + br.ret.sptk.many rp
262 + .endp __do_global_ctors_aux
263 ++#ifdef __linux__
264 ++.section .note.GNU-stack; .previous
265 ++#endif
266 +--- a/libgcc/config/ia64/crti.S
267 ++++ b/libgcc/config/ia64/crti.S
268 +@@ -49,5 +49,8 @@ _fini:
269 + .save rp, r33
270 + mov r33 = b0
271 + .body
272 ++#ifdef __linux__
273 ++.section .note.GNU-stack; .previous
274 ++#endif
275 +
276 + # end of crti.S
277 +--- a/libgcc/config/ia64/crtn.S
278 ++++ b/libgcc/config/ia64/crtn.S
279 +@@ -39,5 +39,8 @@
280 + .restore sp
281 + mov r12 = r35
282 + br.ret.sptk.many b0
283 ++#ifdef __linux__
284 ++.section .note.GNU-stack; .previous
285 ++#endif
286 +
287 + # end of crtn.S
288 +--- a/libgcc/config/ia64/lib1funcs.S
289 ++++ b/libgcc/config/ia64/lib1funcs.S
290 +@@ -793,3 +793,6 @@ __floattitf:
291 + .endp __floattitf
292 + #endif
293 + #endif
294 ++#ifdef __linux__
295 ++.section .note.GNU-stack; .previous
296 ++#endif
297
298 diff --git a/12.0.0/gentoo/07_all_libiberty-asprintf.patch b/12.0.0/gentoo/07_all_libiberty-asprintf.patch
299 new file mode 100644
300 index 0000000..bee0c4c
301 --- /dev/null
302 +++ b/12.0.0/gentoo/07_all_libiberty-asprintf.patch
303 @@ -0,0 +1,18 @@
304 +2008-07-25 Magnus Granberg <zorry@×××.nu>
305 +
306 + * include/libiberty.h (asprintf): Don't declare if defined as a macro
307 +
308 +--- a/include/libiberty.h
309 ++++ b/include/libiberty.h
310 +@@ -609,8 +609,11 @@ extern int pwait (int, int *, int);
311 + /* Like sprintf but provides a pointer to malloc'd storage, which must
312 + be freed by the caller. */
313 +
314 ++/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
315 ++#ifndef asprintf
316 + extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
317 + #endif
318 ++#endif
319 +
320 + #if !HAVE_DECL_VASPRINTF
321 + /* Like vsprintf but provides a pointer to malloc'd storage, which
322
323 diff --git a/12.0.0/gentoo/08_all_libiberty-pic.patch b/12.0.0/gentoo/08_all_libiberty-pic.patch
324 new file mode 100644
325 index 0000000..b6160a7
326 --- /dev/null
327 +++ b/12.0.0/gentoo/08_all_libiberty-pic.patch
328 @@ -0,0 +1,10 @@
329 +--- a/libiberty/Makefile.in
330 ++++ b/libiberty/Makefile.in
331 +@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
332 + $(AR) $(AR_FLAGS) $(TARGETLIB) \
333 + $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
334 + $(RANLIB) $(TARGETLIB); \
335 ++ cp $(TARGETLIB) ../ ; \
336 + cd ..; \
337 + else true; fi
338 +
339
340 diff --git a/12.0.0/gentoo/09_all_nopie-all-flags.patch b/12.0.0/gentoo/09_all_nopie-all-flags.patch
341 new file mode 100644
342 index 0000000..48536e6
343 --- /dev/null
344 +++ b/12.0.0/gentoo/09_all_nopie-all-flags.patch
345 @@ -0,0 +1,18 @@
346 +We need to pass NO_PIE_CFLAGS to ALL_* so gcc don't fail when
347 +we compile it with older gcc and pie.
348 +
349 +--- a/gcc/Makefile.in 2015-06-25 19:18:12.000000000 +0200
350 ++++ b/gcc/Makefile.in 2016-04-22 00:12:54.029178860 +0200
351 +@@ -991,10 +991,10 @@ ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@)
352 + ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS)
353 +
354 + # This is the variable to use when using $(COMPILER).
355 +-ALL_COMPILERFLAGS = $(ALL_CXXFLAGS)
356 ++ALL_COMPILERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS)
357 +
358 + # This is the variable to use when using $(LINKER).
359 +-ALL_LINKERFLAGS = $(ALL_CXXFLAGS)
360 ++ALL_LINKERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS)
361 +
362 + # Build and host support libraries.
363 +
364
365 diff --git a/12.0.0/gentoo/10_all_sh-drop-sysroot-suffix.patch b/12.0.0/gentoo/10_all_sh-drop-sysroot-suffix.patch
366 new file mode 100644
367 index 0000000..3dadd4c
368 --- /dev/null
369 +++ b/12.0.0/gentoo/10_all_sh-drop-sysroot-suffix.patch
370 @@ -0,0 +1,32 @@
371 +From 5eeeff19bb4978a8d3c0d53bc81744bc25d82993 Mon Sep 17 00:00:00 2001
372 +From: Sergei Trofimovich <slyfox@g.o>
373 +Date: Sat, 14 Apr 2018 13:07:39 +0100
374 +Subject: [PATCH] gcc/config.gcc: sh-*: Disable sysroot-suffix (PR42947)
375 +
376 +sh-* is a multilib target. It is also one of 2 sysroot-prefix targets.
377 +Unfortunately two options do not mix well. Attempt to use default
378 +multilib flavour always prepends sysroot-prefix.
379 +
380 +Bug: https://bugs.gentoo.org/511548
381 +Bug: https://gcc.gnu.org/PR42947
382 +Signed-off-by: Sergei Trofimovich <slyfox@g.o>
383 +---
384 + gcc/config.gcc | 2 --
385 + 1 file changed, 2 deletions(-)
386 +
387 +diff --git a/gcc/config.gcc b/gcc/config.gcc
388 +index 55c314afdbd..c320f24f123 100644
389 +--- a/gcc/config.gcc
390 ++++ b/gcc/config.gcc
391 +@@ -2866,8 +2866,6 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
392 + if test x${enable_incomplete_targets} = xyes ; then
393 + tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1"
394 + fi
395 +- tm_file="$tm_file ./sysroot-suffix.h"
396 +- tmake_file="$tmake_file t-sysroot-suffix"
397 + ;;
398 + sh-*-rtems*)
399 + tmake_file="${tmake_file} sh/t-sh sh/t-rtems"
400 +--
401 +2.17.0
402 +
403
404 diff --git a/12.0.0/gentoo/11_all_ia64-TEXTREL.patch b/12.0.0/gentoo/11_all_ia64-TEXTREL.patch
405 new file mode 100644
406 index 0000000..706dbe5
407 --- /dev/null
408 +++ b/12.0.0/gentoo/11_all_ia64-TEXTREL.patch
409 @@ -0,0 +1,22 @@
410 +Fix textrels on -rdynamic binaries:
411 +Bug: https://gcc.gnu.org/PR84553
412 +Bug: https://bugs.gentoo.org/566118
413 +--- a/gcc/config/ia64/ia64.c
414 ++++ a/gcc/config/ia64/ia64.c
415 +@@ -10838,12 +10838,14 @@ ia64_hpux_reloc_rw_mask (void)
416 +
417 + /* For others, relax this so that relocations to local data goes in
418 + read-only segments, but we still cannot allow global relocations
419 +- in read-only segments. */
420 ++ in read-only segments. Except that use of -rdynamic at link time
421 ++ may make any local data global, so we can't allow local data in
422 ++ read-only segments either. */
423 +
424 + static int
425 + ia64_reloc_rw_mask (void)
426 + {
427 +- return flag_pic ? 3 : 2;
428 ++ return flag_pic ? 3 : 3;
429 + }
430 +
431 + /* Return the section to use for X. The only special thing we do here
432
433 diff --git a/12.0.0/gentoo/12_all_disable-systemtap-switch.patch b/12.0.0/gentoo/12_all_disable-systemtap-switch.patch
434 new file mode 100644
435 index 0000000..d5ae8d0
436 --- /dev/null
437 +++ b/12.0.0/gentoo/12_all_disable-systemtap-switch.patch
438 @@ -0,0 +1,122 @@
439 +From bb510ed7ea82093c924b027489db6f92250a85b3 Mon Sep 17 00:00:00 2001
440 +From: Sergei Trofimovich <slyfox@g.o>
441 +Date: Sat, 12 May 2018 12:56:46 +0100
442 +Subject: [PATCH] gcc/configure.ac: add --disable-systemtap switch
443 +
444 +Before the change systemtap probes were enabled
445 +if target headers had sys/sdt.h at ./configure time.
446 +
447 +After the change explicitly ask to enable or disable
448 +for probe support and not rely on automagic dependency
449 +discovery.
450 +
451 +Bug: https://bugs.gentoo.org/654748
452 +Bug: https://gcc.gnu.org/bugzilla/PR61257
453 +Signed-off-by: Sergei Trofimovich <slyfox@g.o>
454 +---
455 + gcc/configure | 34 ++++++++++++++++++++++++++--------
456 + gcc/configure.ac | 30 ++++++++++++++++++++++--------
457 + 2 files changed, 48 insertions(+), 16 deletions(-)
458 +
459 +diff --git a/gcc/configure b/gcc/configure
460 +index 3dcf7752b..c2049f117 100755
461 +--- a/gcc/configure
462 ++++ b/gcc/configure
463 +@@ -988,6 +988,7 @@ enable_gnu_unique_object
464 + enable_linker_build_id
465 + enable_libssp
466 + enable_default_ssp
467 ++enable_systemtap
468 + with_long_double_128
469 + with_long_double_format
470 + with_gc
471 +@@ -1740,6 +1741,7 @@ Optional Features:
472 + compiler will always pass --build-id to linker
473 + --enable-libssp enable linking against libssp
474 + --enable-default-ssp enable Stack Smashing Protection as default
475 ++ --disable-systemtap enable systemtap static probe points [default=auto]
476 + --enable-maintainer-mode
477 + enable make rules and dependencies not useful (and
478 + sometimes confusing) to the casual installer
479 +@@ -29330,17 +29332,33 @@ fi
480 +
481 + # Test for <sys/sdt.h> on the target.
482 +
483 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
484 ++
485 ++# Check whether --enable-systemtap was given.
486 ++if test "${enable_systemtap+set}" = set; then :
487 ++ enableval=$enable_systemtap; enable_systemtap=$enableval
488 ++else
489 ++ enable_systemtap=auto
490 ++fi
491 ++
492 ++
493 ++if test x$enable_systemtap != xno; then
494 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
495 + $as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
496 +-have_sys_sdt_h=no
497 +-if test -f $target_header_dir/sys/sdt.h; then
498 +- have_sys_sdt_h=yes
499 ++ have_sys_sdt_h=no
500 ++ if test -f $target_header_dir/sys/sdt.h ; then
501 ++ have_sys_sdt_h=yes
502 +
503 + $as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
504 +
505 +-fi
506 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
507 ++ fi
508 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
509 + $as_echo "$have_sys_sdt_h" >&6; }
510 ++ if test x$enable_systemtap = xyes ; then
511 ++ if test x$have_sys_sdt_h = xno ; then
512 ++ as_fn_error $? "sys/sdt.h was not found" "$LINENO" 5
513 ++ fi
514 ++ fi
515 ++fi
516 +
517 + # Check if TFmode long double should be used by default or not.
518 + # Some glibc targets used DFmode long double, but with glibc 2.4
519 +--- a/gcc/configure.ac
520 ++++ b/gcc/configure.ac
521 +@@ -6000,14 +6000,28 @@ AC_SUBST([enable_default_ssp])
522 +
523 + # Test for <sys/sdt.h> on the target.
524 + GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
525 +-AC_MSG_CHECKING(sys/sdt.h in the target C library)
526 +-have_sys_sdt_h=no
527 +-if test -f $target_header_dir/sys/sdt.h; then
528 +- have_sys_sdt_h=yes
529 +- AC_DEFINE(HAVE_SYS_SDT_H, 1,
530 +- [Define if your target C library provides sys/sdt.h])
531 +-fi
532 +-AC_MSG_RESULT($have_sys_sdt_h)
533 ++
534 ++AC_ARG_ENABLE(systemtap,
535 ++[AS_HELP_STRING([--disable-systemtap],
536 ++ [enable systemtap static probe points [default=auto]])],
537 ++ enable_systemtap=$enableval,
538 ++ enable_systemtap=auto)
539 ++
540 ++if test x$enable_systemtap != xno; then
541 ++ AC_MSG_CHECKING(sys/sdt.h in the target C library)
542 ++ have_sys_sdt_h=no
543 ++ if test -f $target_header_dir/sys/sdt.h ; then
544 ++ have_sys_sdt_h=yes
545 ++ AC_DEFINE(HAVE_SYS_SDT_H, 1,
546 ++ [Define if your target C library provides sys/sdt.h])
547 ++ fi
548 ++ AC_MSG_RESULT($have_sys_sdt_h)
549 ++ if test x$enable_systemtap = xyes ; then
550 ++ if test x$have_sys_sdt_h = xno ; then
551 ++ AC_MSG_ERROR([sys/sdt.h was not found])
552 ++ fi
553 ++ fi
554 ++fi
555 +
556 + # Check if TFmode long double should be used by default or not.
557 + # Some glibc targets used DFmode long double, but with glibc 2.4
558 +--
559 +2.17.0
560 +
561
562 diff --git a/12.0.0/gentoo/13_all_m68k-textrel-on-libgcc.patch b/12.0.0/gentoo/13_all_m68k-textrel-on-libgcc.patch
563 new file mode 100644
564 index 0000000..a2aa100
565 --- /dev/null
566 +++ b/12.0.0/gentoo/13_all_m68k-textrel-on-libgcc.patch
567 @@ -0,0 +1,93 @@
568 +https://gcc.gnu.org/PR86224
569 +
570 +From 1d89df42bdaf0745fd2a0d294471ac16f0553707 Mon Sep 17 00:00:00 2001
571 +From: Sergei Trofimovich <slyfox@g.o>
572 +Date: Sat, 28 Jul 2018 11:33:27 +0100
573 +Subject: [PATCH] libgcc: m68k: avoid absolute relocation in shared library
574 +
575 +Signed-off-by: Sergei Trofimovich <slyfox@g.o>
576 +---
577 + libgcc/config/m68k/lb1sf68.S | 19 ++++++++++++++-----
578 + 1 file changed, 14 insertions(+), 5 deletions(-)
579 +
580 +diff --git a/libgcc/config/m68k/lb1sf68.S b/libgcc/config/m68k/lb1sf68.S
581 +index 325a7c17d9b..16c6dc3f5a7 100644
582 +--- a/libgcc/config/m68k/lb1sf68.S
583 ++++ b/libgcc/config/m68k/lb1sf68.S
584 +@@ -435,7 +435,10 @@ $_exception_handler:
585 + .text
586 + FUNC(__mulsi3)
587 + .globl SYM (__mulsi3)
588 ++ .globl SYM (__mulsi3_internal)
589 ++ .hidden SYM (__mulsi3_internal)
590 + SYM (__mulsi3):
591 ++SYM (__mulsi3_internal):
592 + movew sp@(4), d0 /* x0 -> d0 */
593 + muluw sp@(10), d0 /* x0*y1 */
594 + movew sp@(6), d1 /* x1 -> d1 */
595 +@@ -458,7 +461,10 @@ SYM (__mulsi3):
596 + .text
597 + FUNC(__udivsi3)
598 + .globl SYM (__udivsi3)
599 ++ .globl SYM (__udivsi3_internal)
600 ++ .hidden SYM (__udivsi3_internal)
601 + SYM (__udivsi3):
602 ++SYM (__udivsi3_internal):
603 + #ifndef __mcoldfire__
604 + movel d2, sp@-
605 + movel sp@(12), d1 /* d1 = divisor */
606 +@@ -534,7 +540,10 @@ L2: subql IMM (1),d4
607 + .text
608 + FUNC(__divsi3)
609 + .globl SYM (__divsi3)
610 ++ .globl SYM (__divsi3_internal)
611 ++ .hidden SYM (__divsi3_internal)
612 + SYM (__divsi3):
613 ++SYM (__divsi3_internal):
614 + movel d2, sp@-
615 +
616 + moveq IMM (1), d2 /* sign of result stored in d2 (=1 or =-1) */
617 +@@ -557,7 +566,7 @@ L1: movel sp@(8), d0 /* d0 = dividend */
618 +
619 + L2: movel d1, sp@-
620 + movel d0, sp@-
621 +- PICCALL SYM (__udivsi3) /* divide abs(dividend) by abs(divisor) */
622 ++ PICCALL SYM (__udivsi3_internal) /* divide abs(dividend) by abs(divisor) */
623 + addql IMM (8), sp
624 +
625 + tstb d2
626 +@@ -577,13 +586,13 @@ SYM (__umodsi3):
627 + movel sp@(4), d0 /* d0 = dividend */
628 + movel d1, sp@-
629 + movel d0, sp@-
630 +- PICCALL SYM (__udivsi3)
631 ++ PICCALL SYM (__udivsi3_internal)
632 + addql IMM (8), sp
633 + movel sp@(8), d1 /* d1 = divisor */
634 + #ifndef __mcoldfire__
635 + movel d1, sp@-
636 + movel d0, sp@-
637 +- PICCALL SYM (__mulsi3) /* d0 = (a/b)*b */
638 ++ PICCALL SYM (__mulsi3_internal) /* d0 = (a/b)*b */
639 + addql IMM (8), sp
640 + #else
641 + mulsl d1,d0
642 +@@ -603,13 +612,13 @@ SYM (__modsi3):
643 + movel sp@(4), d0 /* d0 = dividend */
644 + movel d1, sp@-
645 + movel d0, sp@-
646 +- PICCALL SYM (__divsi3)
647 ++ PICCALL SYM (__divsi3_internal)
648 + addql IMM (8), sp
649 + movel sp@(8), d1 /* d1 = divisor */
650 + #ifndef __mcoldfire__
651 + movel d1, sp@-
652 + movel d0, sp@-
653 +- PICCALL SYM (__mulsi3) /* d0 = (a/b)*b */
654 ++ PICCALL SYM (__mulsi3_internal) /* d0 = (a/b)*b */
655 + addql IMM (8), sp
656 + #else
657 + mulsl d1,d0
658 +--
659 +2.18.0
660 +
661
662 diff --git a/12.0.0/gentoo/14_all_respect-build-cxxflags.patch b/12.0.0/gentoo/14_all_respect-build-cxxflags.patch
663 new file mode 100644
664 index 0000000..14139ea
665 --- /dev/null
666 +++ b/12.0.0/gentoo/14_all_respect-build-cxxflags.patch
667 @@ -0,0 +1,39 @@
668 +Pass CXXFLAGS as CXXFLAGS_FOR_BUILD to stage1.
669 +
670 +Fixes build failure when CXXFLAGS contains
671 +TARGET-specific flags.
672 +
673 +Tested on x86_64-pc-linux-gnu host as:
674 + # CFLAGS='-O2 -mfpu=neon-vfpv4' CXXFLAGS='-O2 -mfpu=neon-vfpv4' \
675 + armv7a-unknown-linux-gnueabihf-emerge -v1 sys-devel/gcc --quiet-build=n
676 +
677 +Fix by Peter Levine.
678 +https://bugs.gentoo.org/581406
679 +--- a/Makefile.in
680 ++++ b/Makefile.in
681 +@@ -170,6 +170,7 @@
682 + # built for the build system to override those in BASE_FLAGS_TO_PASS.
683 + EXTRA_BUILD_FLAGS = \
684 + CFLAGS="$(CFLAGS_FOR_BUILD)" \
685 ++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
686 + LDFLAGS="$(LDFLAGS_FOR_BUILD)"
687 +
688 + # This is the list of directories to built for the host system.
689 +@@ -710,6 +711,7 @@
690 + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
691 + "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
692 + "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
693 ++ "CXXFLAGS_FOR_BUILD=$(CXXFLAGS_FOR_BUILD)" \
694 + "EXPECT=$(EXPECT)" \
695 + "FLEX=$(FLEX)" \
696 + "INSTALL=$(INSTALL)" \
697 +--- a/Makefile.tpl
698 ++++ b/Makefile.tpl
699 +@@ -172,6 +172,7 @@
700 + # built for the build system to override those in BASE_FLAGS_TO_PASS.
701 + EXTRA_BUILD_FLAGS = \
702 + CFLAGS="$(CFLAGS_FOR_BUILD)" \
703 ++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
704 + LDFLAGS="$(LDFLAGS_FOR_BUILD)"
705 +
706 + # This is the list of directories to built for the host system.
707
708 diff --git a/12.0.0/gentoo/15_all_libgomp-Werror.patch b/12.0.0/gentoo/15_all_libgomp-Werror.patch
709 new file mode 100644
710 index 0000000..416808a
711 --- /dev/null
712 +++ b/12.0.0/gentoo/15_all_libgomp-Werror.patch
713 @@ -0,0 +1,20 @@
714 +libgomp does not respect --disable-werror
715 +
716 +https://bugs.gentoo.org/229059
717 +http://gcc.gnu.org/PR38436
718 +--- a/libgomp/configure.ac
719 ++++ b/libgomp/configure.ac
720 +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
721 + # Add -Wall -Werror if we are using GCC.
722 + if test "x$GCC" = "xyes"; then
723 +- XCFLAGS="$XCFLAGS -Wall -Werror"
724 ++ XCFLAGS="$XCFLAGS -Wall"
725 + fi
726 +--- a/libgomp/configure
727 ++++ b/libgomp/configure
728 +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
729 + # Add -Wall -Werror if we are using GCC.
730 + if test "x$GCC" = "xyes"; then
731 +- XCFLAGS="$XCFLAGS -Wall -Werror"
732 ++ XCFLAGS="$XCFLAGS -Wall"
733 + fi
734
735 diff --git a/12.0.0/gentoo/16_all_libitm-Werror.patch b/12.0.0/gentoo/16_all_libitm-Werror.patch
736 new file mode 100644
737 index 0000000..27181e0
738 --- /dev/null
739 +++ b/12.0.0/gentoo/16_all_libitm-Werror.patch
740 @@ -0,0 +1,19 @@
741 +libitm does not respect --disable-werror
742 +
743 +https://bugs.gentoo.org/475350
744 +--- a/libitm/configure.ac
745 ++++ b/libitm/configure.ac
746 +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
747 + # Add -Wall -Werror if we are using GCC.
748 + if test "x$GCC" = "xyes"; then
749 +- XCFLAGS="$XCFLAGS -Wall -Werror"
750 ++ XCFLAGS="$XCFLAGS -Wall"
751 + fi
752 +--- a/libitm/configure
753 ++++ b/libitm/configure
754 +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
755 + # Add -Wall -Werror if we are using GCC.
756 + if test "x$GCC" = "xyes"; then
757 +- XCFLAGS="$XCFLAGS -Wall -Werror"
758 ++ XCFLAGS="$XCFLAGS -Wall"
759 + fi
760
761 diff --git a/12.0.0/gentoo/17_all_libatomic-Werror.patch b/12.0.0/gentoo/17_all_libatomic-Werror.patch
762 new file mode 100644
763 index 0000000..0550722
764 --- /dev/null
765 +++ b/12.0.0/gentoo/17_all_libatomic-Werror.patch
766 @@ -0,0 +1,19 @@
767 +libatomic does not respect --disable-werror
768 +
769 +https://bugs.gentoo.org/475350
770 +--- a/libatomic/configure.ac
771 ++++ b/libatomic/configure.ac
772 +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
773 + # Add -Wall -Werror if we are using GCC.
774 + if test "x$GCC" = "xyes"; then
775 +- XCFLAGS="$XCFLAGS -Wall -Werror"
776 ++ XCFLAGS="$XCFLAGS -Wall"
777 + fi
778 +--- a/libatomic/configure
779 ++++ b/libatomic/configure
780 +@@ -4282,4 +4282,4 @@ save_CFLAGS="$CFLAGS"
781 + # Add -Wall -Werror if we are using GCC.
782 + if test "x$GCC" = "xyes"; then
783 +- XCFLAGS="$XCFLAGS -Wall -Werror"
784 ++ XCFLAGS="$XCFLAGS -Wall"
785 + fi
786
787 diff --git a/12.0.0/gentoo/18_all_libbacktrace-Werror.patch b/12.0.0/gentoo/18_all_libbacktrace-Werror.patch
788 new file mode 100644
789 index 0000000..57dd284
790 --- /dev/null
791 +++ b/12.0.0/gentoo/18_all_libbacktrace-Werror.patch
792 @@ -0,0 +1,17 @@
793 +libbacktrace does not respect --disable-werror
794 +
795 +https://bugs.gentoo.org/667104
796 +--- a/libbacktrace/configure
797 ++++ b/libbacktrace/configure
798 +@@ -11634,3 +11634,3 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
799 + if test -n "${with_target_subdir}"; then
800 +- WARN_FLAGS="$WARN_FLAGS -Werror"
801 ++ WARN_FLAGS="$WARN_FLAGS"
802 + fi
803 +--- a/libbacktrace/configure.ac
804 ++++ b/libbacktrace/configure.ac
805 +@@ -138,3 +138,3 @@ ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
806 + if test -n "${with_target_subdir}"; then
807 +- WARN_FLAGS="$WARN_FLAGS -Werror"
808 ++ WARN_FLAGS="$WARN_FLAGS"
809 + fi
810
811 diff --git a/12.0.0/gentoo/19_all_libsanitizer-Werror.patch b/12.0.0/gentoo/19_all_libsanitizer-Werror.patch
812 new file mode 100644
813 index 0000000..0e484a4
814 --- /dev/null
815 +++ b/12.0.0/gentoo/19_all_libsanitizer-Werror.patch
816 @@ -0,0 +1,17 @@
817 +libsanitizer does not respect --disable-werror
818 +
819 +https://bugs.gentoo.org/667104
820 +--- a/libsanitizer/libbacktrace/Makefile.am
821 ++++ b/libsanitizer/libbacktrace/Makefile.am
822 +@@ -37,3 +37,3 @@ AM_CPPFLAGS = -I $(top_srcdir)/../include -I $(top_srcdir)/../libgcc \
823 + WARN_FLAGS = -W -Wall -Wwrite-strings -Wmissing-format-attribute \
824 +- -Wcast-qual -Werror
825 ++ -Wcast-qual
826 + C_WARN_FLAGS = $(WARN_FLAGS) -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
827 +--- a/libsanitizer/libbacktrace/Makefile.in
828 ++++ b/libsanitizer/libbacktrace/Makefile.in
829 +@@ -297,3 +297,3 @@ AM_CPPFLAGS = -I $(top_srcdir)/../include -I $(top_srcdir)/../libgcc \
830 + WARN_FLAGS = -W -Wall -Wwrite-strings -Wmissing-format-attribute \
831 +- -Wcast-qual -Werror
832 ++ -Wcast-qual
833 +
834
835 diff --git a/12.0.0/gentoo/20_all_libstdcxx-no-vtv.patch b/12.0.0/gentoo/20_all_libstdcxx-no-vtv.patch
836 new file mode 100644
837 index 0000000..68508bd
838 --- /dev/null
839 +++ b/12.0.0/gentoo/20_all_libstdcxx-no-vtv.patch
840 @@ -0,0 +1,61 @@
841 +Final libstdc++.so should not contain rpath to make libvtv usable.
842 +It's up to final binaries to link against proper libvtv.
843 +
844 +Bug: https://bugs.gentoo.org/582524
845 +Bug: https://gcc.gnu.org/PR85884
846 +--- a/libstdc++-v3/src/Makefile.am
847 ++++ b/libstdc++-v3/src/Makefile.am
848 +@@ -217,7 +217,6 @@ CXXLINK = \
849 + $(LIBTOOL) --tag CXX \
850 + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
851 + --mode=link $(CXX) \
852 +- $(VTV_CXXLINKFLAGS) \
853 + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
854 +
855 + # Symbol versioning for shared libraries.
856 +--- a/libstdc++-v3/src/Makefile.in
857 ++++ b/libstdc++-v3/src/Makefile.in
858 +@@ -511,7 +511,6 @@ CXXLINK = \
859 + $(LIBTOOL) --tag CXX \
860 + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
861 + --mode=link $(CXX) \
862 +- $(VTV_CXXLINKFLAGS) \
863 + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
864 +
865 + @ENABLE_SYMVERS_TRUE@CLEANFILES = libstdc++-symbols.ver $(version_dep)
866 +--- a/libstdc++-v3/src/c++11/Makefile.am
867 ++++ b/libstdc++-v3/src/c++11/Makefile.am
868 +@@ -204,5 +204,4 @@ CXXLINK = \
869 + $(LIBTOOL) --tag CXX --tag disable-shared \
870 + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
871 + --mode=link $(CXX) \
872 +- $(VTV_CXXLINKFLAGS) \
873 + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
874 +--- a/libstdc++-v3/src/c++11/Makefile.in
875 ++++ b/libstdc++-v3/src/c++11/Makefile.in
876 +@@ -496,7 +496,6 @@ CXXLINK = \
877 + $(LIBTOOL) --tag CXX --tag disable-shared \
878 + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
879 + --mode=link $(CXX) \
880 +- $(VTV_CXXLINKFLAGS) \
881 + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
882 +
883 + all: all-am
884 +--- a/libstdc++-v3/src/c++98/Makefile.am
885 ++++ b/libstdc++-v3/src/c++98/Makefile.am
886 +@@ -273,5 +273,4 @@ CXXLINK = \
887 + $(LIBTOOL) --tag CXX --tag disable-shared \
888 + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
889 + --mode=link $(CXX) \
890 +- $(VTV_CXXLINKFLAGS) \
891 + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
892 +--- a/libstdc++-v3/src/c++98/Makefile.in
893 ++++ b/libstdc++-v3/src/c++98/Makefile.in
894 +@@ -500,7 +500,6 @@ CXXLINK = \
895 + $(LIBTOOL) --tag CXX --tag disable-shared \
896 + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
897 + --mode=link $(CXX) \
898 +- $(VTV_CXXLINKFLAGS) \
899 + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
900 +
901 + all: all-am
902
903 diff --git a/12.0.0/gentoo/21_all_disable-riscv32-ABIs.patch b/12.0.0/gentoo/21_all_disable-riscv32-ABIs.patch
904 new file mode 100644
905 index 0000000..ad0128a
906 --- /dev/null
907 +++ b/12.0.0/gentoo/21_all_disable-riscv32-ABIs.patch
908 @@ -0,0 +1,53 @@
909 +Autogenerated patch disabling the 32bit RISCV support
910 +See https://gcc.gnu.org/PR90419
911 +
912 +diff -ruN gcc-9.1.0.orig/gcc/config/riscv/t-linux-multilib gcc-9.1.0/gcc/config/riscv/t-linux-multilib
913 +--- gcc-9.1.0.orig/gcc/config/riscv/t-linux-multilib 2017-02-06 22:38:37.000000000 +0100
914 ++++ gcc-9.1.0/gcc/config/riscv/t-linux-multilib 2019-05-18 23:04:54.849400774 +0200
915 +@@ -1,40 +1,18 @@
916 + # This file was generated by multilib-generator with the command:
917 +-# ./multilib-generator rv32imac-ilp32-rv32ima,rv32imaf,rv32imafd,rv32imafc,rv32imafdc- rv32imafdc-ilp32d-rv32imafd- rv64imac-lp64-rv64ima,rv64imaf,rv64imafd,rv64imafc,rv64imafdc- rv64imafdc-lp64d-rv64imafd-
918 +-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
919 +-MULTILIB_DIRNAMES = rv32imac \
920 +-rv32ima \
921 +-rv32imaf \
922 +-rv32imafd \
923 +-rv32imafc \
924 +-rv32imafdc \
925 +-rv32g \
926 +-rv32gc \
927 +-rv64imac \
928 ++# ./multilib-generator rv64imac-lp64-rv64ima,rv64imaf,rv64imafd,rv64imafc,rv64imafdc- rv64imafdc-lp64d-rv64imafd-
929 ++MULTILIB_OPTIONS = march=rv64imac/march=rv64ima/march=rv64imaf/march=rv64imafd/march=rv64imafc/march=rv64imafdc/march=rv64g/march=rv64gc mabi=lp64/mabi=lp64d
930 ++MULTILIB_DIRNAMES = rv64imac \
931 + rv64ima \
932 + rv64imaf \
933 + rv64imafd \
934 + rv64imafc \
935 + rv64imafdc \
936 + rv64g \
937 +-rv64gc ilp32 \
938 +-ilp32d \
939 +-lp64 \
940 ++rv64gc lp64 \
941 + lp64d
942 +-MULTILIB_REQUIRED = march=rv32imac/mabi=ilp32 \
943 +-march=rv32imafdc/mabi=ilp32d \
944 +-march=rv64imac/mabi=lp64 \
945 ++MULTILIB_REQUIRED = march=rv64imac/mabi=lp64 \
946 + march=rv64imafdc/mabi=lp64d
947 +-MULTILIB_REUSE = march.rv32imac/mabi.ilp32=march.rv32ima/mabi.ilp32 \
948 +-march.rv32imac/mabi.ilp32=march.rv32imaf/mabi.ilp32 \
949 +-march.rv32imac/mabi.ilp32=march.rv32imafd/mabi.ilp32 \
950 +-march.rv32imac/mabi.ilp32=march.rv32imafc/mabi.ilp32 \
951 +-march.rv32imac/mabi.ilp32=march.rv32imafdc/mabi.ilp32 \
952 +-march.rv32imac/mabi.ilp32=march.rv32g/mabi.ilp32 \
953 +-march.rv32imac/mabi.ilp32=march.rv32gc/mabi.ilp32 \
954 +-march.rv32imafdc/mabi.ilp32d=march.rv32imafd/mabi.ilp32d \
955 +-march.rv32imafdc/mabi.ilp32d=march.rv32gc/mabi.ilp32d \
956 +-march.rv32imafdc/mabi.ilp32d=march.rv32g/mabi.ilp32d \
957 +-march.rv64imac/mabi.lp64=march.rv64ima/mabi.lp64 \
958 ++MULTILIB_REUSE = march.rv64imac/mabi.lp64=march.rv64ima/mabi.lp64 \
959 + march.rv64imac/mabi.lp64=march.rv64imaf/mabi.lp64 \
960 + march.rv64imac/mabi.lp64=march.rv64imafd/mabi.lp64 \
961 + march.rv64imac/mabi.lp64=march.rv64imafc/mabi.lp64 \
962
963 diff --git a/12.0.0/gentoo/22_all_default_ssp-buffer-size.patch b/12.0.0/gentoo/22_all_default_ssp-buffer-size.patch
964 new file mode 100644
965 index 0000000..ae5a707
966 --- /dev/null
967 +++ b/12.0.0/gentoo/22_all_default_ssp-buffer-size.patch
968 @@ -0,0 +1,14 @@
969 +Change the minimal SSP buffer size.
970 +
971 +https://bugs.gentoo.org/484714
972 +--- a/gcc/params.opt
973 ++++ b/gcc/params.opt
974 +@@ -849,7 +849,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
975 + The maximum number of SSA_NAME assignments to follow in determining a value.
976 +
977 + -param=ssp-buffer-size=
978 +-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization
979 ++Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization
980 + The lower bound for a buffer to be considered for stack smashing protection.
981 +
982 + -param=stack-clash-protection-guard-size=
983
984 diff --git a/12.0.0/gentoo/23_all_EXTRA_OPTIONS-z-now.patch b/12.0.0/gentoo/23_all_EXTRA_OPTIONS-z-now.patch
985 new file mode 100644
986 index 0000000..121dec4
987 --- /dev/null
988 +++ b/12.0.0/gentoo/23_all_EXTRA_OPTIONS-z-now.patch
989 @@ -0,0 +1,26 @@
990 +On Hardened we add some options like -z now
991 +
992 +--- a/gcc/gcc.c 2016-02-19 23:18:38.000000000 +0100
993 ++++ b/gcc/gcc.c 2016-05-02 22:56:10.185721270 +0200
994 +@@ -868,6 +868,12 @@ proper position among the other output f
995 + #endif
996 + #endif
997 +
998 ++#ifdef EXTRA_OPTIONS
999 ++#define LINK_NOW_SPEC "%{!nonow:-z now} "
1000 ++#else
1001 ++#define LINK_NOW_SPEC ""
1002 ++#endif
1003 ++
1004 + #ifdef ENABLE_DEFAULT_PIE
1005 + #define NO_PIE_SPEC "no-pie|static"
1006 + #define PIE_SPEC NO_PIE_SPEC "|r|shared:;"
1007 +@@ -1013,7 +1020,7 @@ proper position among the other output f
1008 + %(linker) " \
1009 + LINK_PLUGIN_SPEC \
1010 + "%{flto|flto=*:%<fcompare-debug*} \
1011 +- %{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
1012 ++ %{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC LINK_NOW_SPEC \
1013 + "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
1014 + "%X %{o*} %{e*} %{N} %{n} %{r}\
1015 + %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} \
1016
1017 diff --git a/12.0.0/gentoo/24_all_EXTRA_OPTIONS-fstack-clash-protection.patch b/12.0.0/gentoo/24_all_EXTRA_OPTIONS-fstack-clash-protection.patch
1018 new file mode 100644
1019 index 0000000..e836c92
1020 --- /dev/null
1021 +++ b/12.0.0/gentoo/24_all_EXTRA_OPTIONS-fstack-clash-protection.patch
1022 @@ -0,0 +1,65 @@
1023 +On Hardened we add some options like -fstack-clash-protection.
1024 +
1025 +--- a/gcc/common.opt 2018-03-28 16:51:09.000000000 +0200
1026 ++++ a/gcc/common.opt 2018-04-30 15:35:55.274096877 +0200
1027 +@@ -2367,7 +2367,7 @@ Common Alias(fstack-check=, specific, no
1028 + Insert stack checking code into the program. Same as -fstack-check=specific.
1029 +
1030 + fstack-clash-protection
1031 +-Common Var(flag_stack_clash_protection) Optimization
1032 ++Common Var(flag_stack_clash_protection) Optimization Init(-1)
1033 + Insert code to probe each page of stack space as it is allocated to protect
1034 + from stack-clash style attacks.
1035 +
1036 +--- a/gcc/defaults.h 2018-01-03 11:03:58.000000000 +0100
1037 ++++ b/gcc/defaults.h 2018-05-01 12:41:29.522851451 +0200
1038 +@@ -1435,6 +1435,15 @@ see the files COPYING3 and COPYING.RUNTI
1039 + #define STACK_CHECK_MAX_VAR_SIZE (STACK_CHECK_MAX_FRAME_SIZE / 100)
1040 + #endif
1041 +
1042 ++/* Default value for flag_clash_protector when flag_clash_protector is
1043 ++ initialized to -1. */
1044 ++#ifdef EXTRA_OPTIONS
1045 ++#define DEFAULT_FLAG_SCP 1
1046 ++#endif
1047 ++#ifndef DEFAULT_FLAG_SCP
1048 ++#define DEFAULT_FLAG_SCP 0
1049 ++#endif
1050 ++
1051 + /* By default, the C++ compiler will use function addresses in the
1052 + vtable entries. Setting this nonzero tells the compiler to use
1053 + function descriptors instead. The value of this macro says how
1054 +--- a/gcc/toplev.c 2018-02-13 17:18:37.000000000 +0100
1055 ++++ b/gcc/toplev.c 2018-04-30 16:46:37.244027303 +0200
1056 +@@ -1682,6 +1682,10 @@ process_options (void)
1057 +
1058 + /* -fstack-clash-protection is not currently supported on targets
1059 + where the stack grows up. */
1060 ++ if (flag_stack_clash_protection == -1)
1061 ++ {
1062 ++ flag_stack_clash_protection = DEFAULT_FLAG_SCP;
1063 ++ }
1064 + if (flag_stack_clash_protection && !STACK_GROWS_DOWNWARD)
1065 + {
1066 + warning_at (UNKNOWN_LOCATION, 0,
1067 +
1068 +--- a/libgcc/Makefile.in 2011-11-22 04:01:02.000000000 +0100
1069 ++++ b/libgcc/Makefile.in 2011-12-25 15:18:22.449610631 +0100
1070 +@@ -225,7 +225,7 @@ endif
1071 + LIBGCC2_DEBUG_CFLAGS = -g
1072 + LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
1073 + $(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \
1074 +- -fbuilding-libgcc -fno-stack-protector \
1075 ++ -fbuilding-libgcc -fno-stack-protector -fno-stack-clash-protection \
1076 + $(INHIBIT_LIBC_CFLAGS)
1077 +
1078 + # Additional options to use when compiling libgcc2.a.
1079 +@@ -279,7 +290,7 @@ INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CF
1080 + $(NO_PIE_CFLAGS) -finhibit-size-directive -fno-inline -fno-exceptions \
1081 + -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
1082 + -fbuilding-libgcc -fno-stack-protector $(FORCE_EXPLICIT_EH_REGISTRY) \
1083 +- $(INHIBIT_LIBC_CFLAGS) $(USE_TM_CLONE_REGISTRY)
1084 ++ -fno-stack-clash-protection $(INHIBIT_LIBC_CFLAGS) $(USE_TM_CLONE_REGISTRY)
1085 +
1086 + # Extra flags to use when compiling crt{begin,end}.o.
1087 + CRTSTUFF_T_CFLAGS =
1088
1089 diff --git a/12.0.0/gentoo/25_all_lto-intl-workaround-PR95194.patch b/12.0.0/gentoo/25_all_lto-intl-workaround-PR95194.patch
1090 new file mode 100644
1091 index 0000000..9613216
1092 --- /dev/null
1093 +++ b/12.0.0/gentoo/25_all_lto-intl-workaround-PR95194.patch
1094 @@ -0,0 +1,20 @@
1095 +Trick libintl not to use '_INTL_REDIRECT_ASM' mode as it's
1096 +incompatible with LTO builds.
1097 +
1098 +glibc does not normally use libintl implementations and uses
1099 +it's own primitives. But musl ond others do fall back to libintl.
1100 +
1101 +Reported-by: Andrew Savchenko
1102 +Bug: https://bugs.gentoo.org/723370
1103 +Bug: https://gcc.gnu.org/PR95194
1104 +--- a/intl/libgnuintl.h
1105 ++++ b/intl/libgnuintl.h
1106 +@@ -93,7 +93,7 @@ extern "C" {
1107 + If he doesn't, we choose the method. A third possible method is
1108 + _INTL_REDIRECT_ASM, supported only by GCC. */
1109 + #if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
1110 +-# if __GNUC__ >= 2 && !defined __APPLE_CC__ && (defined __STDC__ || defined __cplusplus)
1111 ++# if __GNUC__ >= 2 && !defined __APPLE_CC__ && (defined __STDC__ || defined __cplusplus) && USE_ASM_ALIASES_THAT_BREAK_LTO
1112 + # define _INTL_REDIRECT_ASM
1113 + # else
1114 + # ifdef __cplusplus
1115
1116 diff --git a/12.0.0/gentoo/26_all_plugin-objdump.patch b/12.0.0/gentoo/26_all_plugin-objdump.patch
1117 new file mode 100644
1118 index 0000000..a9c33fd
1119 --- /dev/null
1120 +++ b/12.0.0/gentoo/26_all_plugin-objdump.patch
1121 @@ -0,0 +1,34 @@
1122 +https://gcc.gnu.org/PR95648
1123 +--- a/config/gcc-plugin.m4
1124 ++++ b/config/gcc-plugin.m4
1125 +@@ -45,7 +45,7 @@ AC_DEFUN([GCC_ENABLE_PLUGINS],
1126 + ;;
1127 + *)
1128 + if test x$build = x$host; then
1129 +- export_sym_check="objdump${exeext} -T"
1130 ++ export_sym_check="$ac_cv_prog_OBJDUMP -T"
1131 + elif test x$host = x$target; then
1132 + export_sym_check="$gcc_cv_objdump -T"
1133 + else
1134 +--- a/gcc/configure
1135 ++++ b/gcc/configure
1136 +@@ -30386,7 +30386,7 @@ fi
1137 + ;;
1138 + *)
1139 + if test x$build = x$host; then
1140 +- export_sym_check="objdump${exeext} -T"
1141 ++ export_sym_check="$ac_cv_prog_OBJDUMP -T"
1142 + elif test x$host = x$target; then
1143 + export_sym_check="$gcc_cv_objdump -T"
1144 + else
1145 +--- a/libcc1/configure
1146 ++++ b/libcc1/configure
1147 +@@ -14819,7 +14819,7 @@ fi
1148 + ;;
1149 + *)
1150 + if test x$build = x$host; then
1151 +- export_sym_check="objdump${exeext} -T"
1152 ++ export_sym_check="$ac_cv_prog_OBJDUMP -T"
1153 + elif test x$host = x$target; then
1154 + export_sym_check="$gcc_cv_objdump -T"
1155 + else
1156
1157 diff --git a/12.0.0/gentoo/README.history b/12.0.0/gentoo/README.history
1158 new file mode 100644
1159 index 0000000..d50aeff
1160 --- /dev/null
1161 +++ b/12.0.0/gentoo/README.history
1162 @@ -0,0 +1,27 @@
1163 +1 20 Apr 2021
1164 + + 01_all_default-fortify-source.patch
1165 + + 02_all_default-warn-format-security.patch
1166 + + 03_all_default-warn-trampolines.patch
1167 + + 04_all_nossp-on-nostdlib.patch
1168 + + 05_all_alpha-mieee-default.patch
1169 + + 06_all_ia64_note.GNU-stack.patch
1170 + + 07_all_libiberty-asprintf.patch
1171 + + 08_all_libiberty-pic.patch
1172 + + 09_all_nopie-all-flags.patch
1173 + + 10_all_sh-drop-sysroot-suffix.patch
1174 + + 11_all_ia64-TEXTREL.patch
1175 + + 12_all_disable-systemtap-switch.patch
1176 + + 13_all_m68k-textrel-on-libgcc.patch
1177 + + 14_all_respect-build-cxxflags.patch
1178 + + 15_all_libgomp-Werror.patch
1179 + + 16_all_libitm-Werror.patch
1180 + + 17_all_libatomic-Werror.patch
1181 + + 18_all_libbacktrace-Werror.patch
1182 + + 19_all_libsanitizer-Werror.patch
1183 + + 20_all_libstdcxx-no-vtv.patch
1184 + + 21_all_disable-riscv32-ABIs.patch
1185 + + 22_all_default_ssp-buffer-size.patch
1186 + + 23_all_EXTRA_OPTIONS-z-now.patch
1187 + + 24_all_EXTRA_OPTIONS-fstack-clash-protection.patch
1188 + + 25_all_lto-intl-workaround-PR95194.patch
1189 + + 26_all_plugin-objdump.patch