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