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