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