1 |
zorry 16/12/25 22:20:41 |
2 |
|
3 |
Added: 10_all_default-fortify-source.patch |
4 |
11_all_default-warn-format-security.patch |
5 |
12_all_default-warn-trampolines.patch |
6 |
13_all_default-ssp-fix.patch |
7 |
25_all_alpha-mieee-default.patch |
8 |
29_all_arm_armv4t-default.patch |
9 |
34_all_ia64_note.GNU-stack.patch |
10 |
42_all_superh_default-multilib.patch |
11 |
50_all_libiberty-asprintf.patch |
12 |
51_all_libiberty-pic.patch |
13 |
54_all_nopie-all-flags.patch |
14 |
55_all_extra-options.patch |
15 |
90_all_pr55930-dependency-tracking.patch |
16 |
README.history |
17 |
Log: |
18 |
add gcc-6.3 patchset |
19 |
|
20 |
Revision Changes Path |
21 |
1.1 src/patchsets/gcc/6.3.0/gentoo/10_all_default-fortify-source.patch |
22 |
|
23 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/10_all_default-fortify-source.patch?rev=1.1&view=markup |
24 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/10_all_default-fortify-source.patch?rev=1.1&content-type=text/plain |
25 |
|
26 |
Index: 10_all_default-fortify-source.patch |
27 |
=================================================================== |
28 |
Enable -D_FORTIFY_SOURCE=2 by default. |
29 |
|
30 |
|
31 |
--- a/gcc/c-family/c-cppbuiltin.c |
32 |
+++ b/gcc/c-family/c-cppbuiltin.c |
33 |
@@ -951,6 +951,9 @@ c_cpp_builtins (cpp_reader *pfile) |
34 |
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0); |
35 |
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0); |
36 |
|
37 |
+ /* Fortify Source enabled by default w/optimization. */ |
38 |
+ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)"); |
39 |
+ |
40 |
/* Misc. */ |
41 |
if (flag_gnu89_inline) |
42 |
cpp_define (pfile, "__GNUC_GNU_INLINE__"); |
43 |
|
44 |
|
45 |
|
46 |
1.1 src/patchsets/gcc/6.3.0/gentoo/11_all_default-warn-format-security.patch |
47 |
|
48 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/11_all_default-warn-format-security.patch?rev=1.1&view=markup |
49 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/11_all_default-warn-format-security.patch?rev=1.1&content-type=text/plain |
50 |
|
51 |
Index: 11_all_default-warn-format-security.patch |
52 |
=================================================================== |
53 |
Enable -Wformat and -Wformat-security by default. |
54 |
|
55 |
--- a/gcc/c-family/c.opt 2016-03-23 18:51:56.000000000 +0100 |
56 |
+++ b/gcc/c-family/c.opt 2016-04-28 23:45:54.063351272 +0200 |
57 |
@@ -459,7 +459,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonlit |
58 |
Warn about format strings that are not literals. |
59 |
|
60 |
Wformat-security |
61 |
-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) |
62 |
+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) |
63 |
Warn about possible security problems with format functions. |
64 |
|
65 |
Wformat-signedness |
66 |
@@ -475,7 +475,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_l |
67 |
Warn about zero-length formats. |
68 |
|
69 |
Wformat= |
70 |
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) |
71 |
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) |
72 |
Warn about printf/scanf/strftime/strfmon format string anomalies. |
73 |
|
74 |
Wignored-qualifiers |
75 |
|
76 |
|
77 |
|
78 |
1.1 src/patchsets/gcc/6.3.0/gentoo/12_all_default-warn-trampolines.patch |
79 |
|
80 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/12_all_default-warn-trampolines.patch?rev=1.1&view=markup |
81 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/12_all_default-warn-trampolines.patch?rev=1.1&content-type=text/plain |
82 |
|
83 |
Index: 12_all_default-warn-trampolines.patch |
84 |
=================================================================== |
85 |
Enable -Wtrampolines by default. |
86 |
|
87 |
--- a/gcc/common.opt |
88 |
+++ b/gcc/common.opt |
89 |
@@ -712,7 +712,7 @@ Common Var(warn_system_headers) Warning |
90 |
Do not suppress warnings from system headers. |
91 |
|
92 |
Wtrampolines |
93 |
-Common Var(warn_trampolines) Warning |
94 |
+Common Var(warn_trampolines) Init(1) Warning |
95 |
Warn whenever a trampoline is generated. |
96 |
|
97 |
Wtype-limits |
98 |
|
99 |
|
100 |
|
101 |
1.1 src/patchsets/gcc/6.3.0/gentoo/13_all_default-ssp-fix.patch |
102 |
|
103 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/13_all_default-ssp-fix.patch?rev=1.1&view=markup |
104 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/13_all_default-ssp-fix.patch?rev=1.1&content-type=text/plain |
105 |
|
106 |
Index: 13_all_default-ssp-fix.patch |
107 |
=================================================================== |
108 |
We disable ssp on -nostdlib and -ffreestanding as we did on older gcc |
109 |
and change the buffer size. |
110 |
|
111 |
--- a/gcc/c-family/c-opts.c 2016-03-08 23:30:44.000000000 +0100 |
112 |
+++ b/gcc/c-family/c-opts.c 2016-09-18 18:42:10.231644014 +0200 |
113 |
@@ -436,7 +436,15 @@ c_common_handle_option (size_t scode, co |
114 |
|
115 |
case OPT_ffreestanding: |
116 |
value = !value; |
117 |
+ if (global_options.x_flag_stack_protect == -1) |
118 |
+ global_options.x_flag_stack_protect = 0; |
119 |
/* Fall through.... */ |
120 |
+ |
121 |
+ case OPT_nostdlib: |
122 |
+ if (global_options.x_flag_stack_protect == -1) |
123 |
+ global_options.x_flag_stack_protect = 0; |
124 |
+ /* Fall through.... */ |
125 |
+ |
126 |
case OPT_fhosted: |
127 |
flag_hosted = value; |
128 |
flag_no_builtin = !value; |
129 |
--- a/gcc/c-family/c.opt 2016-03-23 18:51:56.000000000 +0100 |
130 |
+++ b/gcc/c-family/c.opt 2016-09-18 18:46:17.071649782 +0200 |
131 |
@@ -1647,6 +1647,10 @@ nostdinc++ |
132 |
C++ ObjC++ |
133 |
Do not search standard system include directories for C++. |
134 |
|
135 |
+nostdlib |
136 |
+C ObjC C++ ObjC++ |
137 |
+; Documented in common.opt |
138 |
+ |
139 |
o |
140 |
C ObjC C++ ObjC++ Joined Separate |
141 |
; Documented in common.opt |
142 |
--- a/gcc/gcc.c 2016-02-19 23:18:38.000000000 +0100 |
143 |
+++ b/gcc/gcc.c 2016-09-18 18:47:35.621651618 +0200 |
144 |
@@ -1132,6 +1143,7 @@ static const char *cc1_options = |
145 |
%{-help=*:--help=%*}\ |
146 |
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\ |
147 |
%{fsyntax-only:-o %j} %{-param*}\ |
148 |
+ %{nostdlib:-nostdlib}\ |
149 |
%{coverage:-fprofile-arcs -ftest-coverage}"; |
150 |
|
151 |
static const char *asm_options = |
152 |
--- a/gcc/params.def 2016-03-30 09:47:40.000000000 +0200 |
153 |
+++ b/gcc/params.def 2016-09-19 12:56:58.443179039 +0200 |
154 |
@@ -673,7 +673,7 @@ DEFPARAM (PARAM_INTEGER_SHARE_LIMIT, |
155 |
DEFPARAM (PARAM_SSP_BUFFER_SIZE, |
156 |
"ssp-buffer-size", |
157 |
"The lower bound for a buffer to be considered for stack smashing protection.", |
158 |
- 8, 1, 0) |
159 |
+ 4, 1, 0) |
160 |
|
161 |
DEFPARAM (PARAM_MIN_SIZE_FOR_STACK_SHARING, |
162 |
"min-size-for-stack-sharing", |
163 |
|
164 |
|
165 |
|
166 |
1.1 src/patchsets/gcc/6.3.0/gentoo/25_all_alpha-mieee-default.patch |
167 |
|
168 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/25_all_alpha-mieee-default.patch?rev=1.1&view=markup |
169 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/25_all_alpha-mieee-default.patch?rev=1.1&content-type=text/plain |
170 |
|
171 |
Index: 25_all_alpha-mieee-default.patch |
172 |
=================================================================== |
173 |
Set the default behavior on alpha to use -mieee since the large majority of |
174 |
time we want this (bad/weird things can happen with packages built without |
175 |
it). |
176 |
|
177 |
To satisfy those people who may not want -mieee forced on them all the time, |
178 |
we also provide -mno-ieee. |
179 |
|
180 |
Patch by Mike Frysinger <vapier@g.o> |
181 |
|
182 |
Note: upstream doesn't want to take this due to long standing behavior, and |
183 |
because it'd make behavior across OS's inconsistent: |
184 |
https://gcc.gnu.org/ml/gcc-patches/2003-07/msg02144.html |
185 |
|
186 |
This makes sense for upstream, but Gentoo is more concerned about packages |
187 |
behaving the same across arches under Linux. |
188 |
|
189 |
--- a/gcc/config/alpha/alpha.h |
190 |
+++ b/gcc/config/alpha/alpha.h |
191 |
@@ -96,6 +96,8 @@ along with GCC; see the file COPYING3. If not see |
192 |
while (0) |
193 |
#endif |
194 |
|
195 |
+#define CPP_SPEC "%{!no-ieee:-mieee}" |
196 |
+ |
197 |
/* Run-time compilation parameters selecting different hardware subsets. */ |
198 |
|
199 |
/* Which processor to schedule for. The cpu attribute defines a list that |
200 |
--- a/gcc/config/alpha/alpha.opt |
201 |
+++ b/gcc/config/alpha/alpha.opt |
202 |
@@ -39,7 +39,7 @@ Target RejectNegative Mask(IEEE_CONFORMANT) |
203 |
Request IEEE-conformant math library routines (OSF/1). |
204 |
|
205 |
mieee |
206 |
-Target Report RejectNegative Mask(IEEE) |
207 |
+Target Report Mask(IEEE) |
208 |
Emit IEEE-conformant code, without inexact exceptions. |
209 |
|
210 |
mieee-with-inexact |
211 |
|
212 |
|
213 |
|
214 |
1.1 src/patchsets/gcc/6.3.0/gentoo/29_all_arm_armv4t-default.patch |
215 |
|
216 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/29_all_arm_armv4t-default.patch?rev=1.1&view=markup |
217 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/29_all_arm_armv4t-default.patch?rev=1.1&content-type=text/plain |
218 |
|
219 |
Index: 29_all_arm_armv4t-default.patch |
220 |
=================================================================== |
221 |
gcc defaults to armv5t for all targets even armv4t |
222 |
|
223 |
http://sourceware.org/ml/crossgcc/2008-05/msg00009.html |
224 |
|
225 |
|
226 |
--- a/gcc/config/arm/linux-eabi.h |
227 |
+++ b/gcc/config/arm/linux-eabi.h |
228 |
@@ -45,7 +45,7 @@ |
229 |
The ARM10TDMI core is the default for armv5t, so set |
230 |
SUBTARGET_CPU_DEFAULT to achieve this. */ |
231 |
#undef SUBTARGET_CPU_DEFAULT |
232 |
-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi |
233 |
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi |
234 |
|
235 |
/* TARGET_BIG_ENDIAN_DEFAULT is set in |
236 |
config.gcc for big endian configurations. */ |
237 |
|
238 |
|
239 |
|
240 |
1.1 src/patchsets/gcc/6.3.0/gentoo/34_all_ia64_note.GNU-stack.patch |
241 |
|
242 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/34_all_ia64_note.GNU-stack.patch?rev=1.1&view=markup |
243 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/34_all_ia64_note.GNU-stack.patch?rev=1.1&content-type=text/plain |
244 |
|
245 |
Index: 34_all_ia64_note.GNU-stack.patch |
246 |
=================================================================== |
247 |
http://gcc.gnu.org/PR21098 |
248 |
|
249 |
|
250 |
2004-09-20 Jakub Jelinek <jakub@××××××.com> |
251 |
|
252 |
* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also |
253 |
on ppc64-linux. |
254 |
|
255 |
* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on |
256 |
ia64-linux. |
257 |
* config/ia64/crtbegin.asm: Likewise. |
258 |
* config/ia64/crtend.asm: Likewise. |
259 |
* config/ia64/crti.asm: Likewise. |
260 |
* config/ia64/crtn.asm: Likewise. |
261 |
|
262 |
2004-05-14 Jakub Jelinek <jakub@××××××.com> |
263 |
|
264 |
* config/ia64/linux.h (TARGET_ASM_FILE_END): Define. |
265 |
|
266 |
|
267 |
--- a/gcc/config/ia64/linux.h |
268 |
+++ b/gcc/config/ia64/linux.h |
269 |
@@ -24,6 +24,8 @@ a copy of the GCC Runtime Library Exception along with this program; |
270 |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
271 |
<http://www.gnu.org/licenses/>. */ |
272 |
|
273 |
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack |
274 |
+ |
275 |
/* This is for -profile to use -lc_p instead of -lc. */ |
276 |
#undef CC1_SPEC |
277 |
#define CC1_SPEC "%{profile:-p} %{G*}" |
278 |
--- a/gcc/config/rs6000/ppc-asm.h |
279 |
+++ b/gcc/config/rs6000/ppc-asm.h |
280 |
@@ -352,7 +352,7 @@ GLUE(.L,name): \ |
281 |
#endif |
282 |
#endif |
283 |
|
284 |
-#if defined __linux__ && !defined __powerpc64__ |
285 |
+#if defined __linux__ |
286 |
.section .note.GNU-stack |
287 |
.previous |
288 |
#endif |
289 |
--- a/libgcc/config/ia64/crtbegin.S |
290 |
+++ b/libgcc/config/ia64/crtbegin.S |
291 |
@@ -252,3 +252,7 @@ __do_jv_register_classes: |
292 |
.weak __cxa_finalize |
293 |
#endif |
294 |
.weak _Jv_RegisterClasses |
295 |
+ |
296 |
+#ifdef __linux__ |
297 |
+.section .note.GNU-stack; .previous |
298 |
+#endif |
299 |
--- a/libgcc/config/ia64/crtend.S |
300 |
+++ b/libgcc/config/ia64/crtend.S |
301 |
@@ -119,3 +119,6 @@ __do_global_ctors_aux: |
302 |
|
303 |
br.ret.sptk.many rp |
304 |
.endp __do_global_ctors_aux |
305 |
+#ifdef __linux__ |
306 |
+.section .note.GNU-stack; .previous |
307 |
+#endif |
308 |
--- a/libgcc/config/ia64/crti.S |
309 |
+++ b/libgcc/config/ia64/crti.S |
310 |
@@ -49,5 +49,8 @@ _fini: |
311 |
.save rp, r33 |
312 |
mov r33 = b0 |
313 |
.body |
314 |
+#ifdef __linux__ |
315 |
+.section .note.GNU-stack; .previous |
316 |
+#endif |
317 |
|
318 |
# end of crti.S |
319 |
--- a/libgcc/config/ia64/crtn.S |
320 |
+++ b/libgcc/config/ia64/crtn.S |
321 |
@@ -39,5 +39,8 @@ |
322 |
.restore sp |
323 |
mov r12 = r35 |
324 |
br.ret.sptk.many b0 |
325 |
+#ifdef __linux__ |
326 |
+.section .note.GNU-stack; .previous |
327 |
+#endif |
328 |
|
329 |
# end of crtn.S |
330 |
--- a/libgcc/config/ia64/lib1funcs.S |
331 |
+++ b/libgcc/config/ia64/lib1funcs.S |
332 |
@@ -793,3 +793,6 @@ __floattitf: |
333 |
.endp __floattitf |
334 |
#endif |
335 |
#endif |
336 |
+#ifdef __linux__ |
337 |
+.section .note.GNU-stack; .previous |
338 |
+#endif |
339 |
|
340 |
|
341 |
|
342 |
1.1 src/patchsets/gcc/6.3.0/gentoo/42_all_superh_default-multilib.patch |
343 |
|
344 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/42_all_superh_default-multilib.patch?rev=1.1&view=markup |
345 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/42_all_superh_default-multilib.patch?rev=1.1&content-type=text/plain |
346 |
|
347 |
Index: 42_all_superh_default-multilib.patch |
348 |
=================================================================== |
349 |
The gcc-3.x toolchains would contain all the targets by default. With gcc-4, |
350 |
you have to actually list out the multilibs you want or you will end up with |
351 |
just one when using targets like 'sh4-linux-gnu'. |
352 |
|
353 |
The resulting toolchain can't even build a kernel as the kernel needs to build |
354 |
with the nofpu flag to be sure that no fpu ops are generated. |
355 |
|
356 |
Here we restore the gcc-3.x behavior; the additional overhead of building all |
357 |
of these multilibs by default is negligible. |
358 |
|
359 |
https://bugs.gentoo.org/140205 |
360 |
https://bugs.gentoo.org/320251 |
361 |
|
362 |
--- a/gcc/config.gcc |
363 |
+++ b/gcc/config.gcc |
364 |
@@ -2455,7 +2455,7 @@ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ |
365 |
if test "$sh_multilibs" = "default" ; then |
366 |
case ${target} in |
367 |
sh64-superh-linux* | \ |
368 |
- sh[1234]*) sh_multilibs=${sh_cpu_target} ;; |
369 |
+ sh[1234]*) sh_multilibs=$(echo $(sed -n '/^[[:space:]]*case ${sh_multilib} in/,/)/{s:case ${sh_multilib} in::;s: | *:,:g;s:[\\)]::g;p}' ${srcdir}/config.gcc) | sed 's: ::g') ;; |
370 |
sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;; |
371 |
sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;; |
372 |
sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;; |
373 |
|
374 |
|
375 |
|
376 |
1.1 src/patchsets/gcc/6.3.0/gentoo/50_all_libiberty-asprintf.patch |
377 |
|
378 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/50_all_libiberty-asprintf.patch?rev=1.1&view=markup |
379 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/50_all_libiberty-asprintf.patch?rev=1.1&content-type=text/plain |
380 |
|
381 |
Index: 50_all_libiberty-asprintf.patch |
382 |
=================================================================== |
383 |
2008-07-25 Magnus Granberg <zorry@×××.nu> |
384 |
|
385 |
* include/libiberty.h (asprintf): Don't declare if defined as a macro |
386 |
|
387 |
--- a/include/libiberty.h |
388 |
+++ b/include/libiberty.h |
389 |
@@ -609,8 +609,11 @@ extern int pwait (int, int *, int); |
390 |
/* Like sprintf but provides a pointer to malloc'd storage, which must |
391 |
be freed by the caller. */ |
392 |
|
393 |
+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */ |
394 |
+#ifndef asprintf |
395 |
extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2; |
396 |
#endif |
397 |
+#endif |
398 |
|
399 |
#if !HAVE_DECL_VASPRINTF |
400 |
/* Like vsprintf but provides a pointer to malloc'd storage, which |
401 |
|
402 |
|
403 |
|
404 |
1.1 src/patchsets/gcc/6.3.0/gentoo/51_all_libiberty-pic.patch |
405 |
|
406 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/51_all_libiberty-pic.patch?rev=1.1&view=markup |
407 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/51_all_libiberty-pic.patch?rev=1.1&content-type=text/plain |
408 |
|
409 |
Index: 51_all_libiberty-pic.patch |
410 |
=================================================================== |
411 |
--- a/libiberty/Makefile.in |
412 |
+++ b/libiberty/Makefile.in |
413 |
@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) |
414 |
$(AR) $(AR_FLAGS) $(TARGETLIB) \ |
415 |
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ |
416 |
$(RANLIB) $(TARGETLIB); \ |
417 |
+ cp $(TARGETLIB) ../ ; \ |
418 |
cd ..; \ |
419 |
else true; fi |
420 |
|
421 |
|
422 |
|
423 |
|
424 |
1.1 src/patchsets/gcc/6.3.0/gentoo/54_all_nopie-all-flags.patch |
425 |
|
426 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/54_all_nopie-all-flags.patch?rev=1.1&view=markup |
427 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/54_all_nopie-all-flags.patch?rev=1.1&content-type=text/plain |
428 |
|
429 |
Index: 54_all_nopie-all-flags.patch |
430 |
=================================================================== |
431 |
We need to pass NO_PIE_CFLAGS to ALL_* so gcc don't fail when |
432 |
we compile it with older gcc and pie. |
433 |
|
434 |
--- a/gcc/Makefile.in 2015-06-25 19:18:12.000000000 +0200 |
435 |
+++ b/gcc/Makefile.in 2016-04-22 00:12:54.029178860 +0200 |
436 |
@@ -991,10 +991,10 @@ ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) |
437 |
ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS) |
438 |
|
439 |
# This is the variable to use when using $(COMPILER). |
440 |
-ALL_COMPILERFLAGS = $(ALL_CXXFLAGS) |
441 |
+ALL_COMPILERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS) |
442 |
|
443 |
# This is the variable to use when using $(LINKER). |
444 |
-ALL_LINKERFLAGS = $(ALL_CXXFLAGS) |
445 |
+ALL_LINKERFLAGS = $(NO_PIE_CFLAGS) $(ALL_CXXFLAGS) |
446 |
|
447 |
# Build and host support libraries. |
448 |
|
449 |
|
450 |
|
451 |
|
452 |
1.1 src/patchsets/gcc/6.3.0/gentoo/55_all_extra-options.patch |
453 |
|
454 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/55_all_extra-options.patch?rev=1.1&view=markup |
455 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/55_all_extra-options.patch?rev=1.1&content-type=text/plain |
456 |
|
457 |
Index: 55_all_extra-options.patch |
458 |
=================================================================== |
459 |
On Hardened we add or remove some options like -fstack-check, |
460 |
-fstack-protector-all, -fstrict_overflow and -z now |
461 |
|
462 |
--- a/libgcc/Makefile.in 2011-11-22 04:01:02.000000000 +0100 |
463 |
+++ b/libgcc/Makefile.in 2011-12-25 15:18:22.449610631 +0100 |
464 |
@@ -225,7 +225,7 @@ endif |
465 |
LIBGCC2_DEBUG_CFLAGS = -g |
466 |
LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \ |
467 |
$(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \ |
468 |
- -fbuilding-libgcc -fno-stack-protector \ |
469 |
+ -fbuilding-libgcc -fno-stack-protector -fstack-check=no \ |
470 |
$(INHIBIT_LIBC_CFLAGS) |
471 |
|
472 |
# Additional options to use when compiling libgcc2.a. |
473 |
@@ -279,7 +290,7 @@ INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CF |
474 |
-finhibit-size-directive -fno-inline -fno-exceptions \ |
475 |
-fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \ |
476 |
-fbuilding-libgcc -fno-stack-protector $(FORCE_EXPLICIT_EH_REGISTRY) \ |
477 |
- $(INHIBIT_LIBC_CFLAGS) |
478 |
+ -fstack-check=no $(INHIBIT_LIBC_CFLAGS) |
479 |
|
480 |
# Extra flags to use when compiling crt{begin,end}.o. |
481 |
CRTSTUFF_T_CFLAGS = |
482 |
--- a/gcc/defaults.h 2016-01-04 15:30:50.000000000 +0100 |
483 |
+++ b/gcc/defaults.h 2016-05-02 22:23:43.815707806 +0200 |
484 |
@@ -1398,8 +1398,12 @@ see the files COPYING3 and COPYING.RUNTI |
485 |
/* Default value for flag_stack_protect when flag_stack_protect is initialized to -1: |
486 |
--enable-default-ssp: Default flag_stack_protect to -fstack-protector-strong. |
487 |
--disable-default-ssp: Default flag_stack_protect to 0. |
488 |
+ Hardened: Default flag_stack_protect to -fstack-protector-all. |
489 |
*/ |
490 |
#ifdef ENABLE_DEFAULT_SSP |
491 |
+# ifdef EXTRA_OPTIONS |
492 |
+# define DEFAULT_FLAG_SSP 2 |
493 |
+# endif |
494 |
# ifndef DEFAULT_FLAG_SSP |
495 |
# define DEFAULT_FLAG_SSP 3 |
496 |
# endif |
497 |
--- a/gcc/gcc.c 2016-02-19 23:18:38.000000000 +0100 |
498 |
+++ b/gcc/gcc.c 2016-05-02 22:56:10.185721270 +0200 |
499 |
@@ -868,6 +868,13 @@ proper position among the other output f |
500 |
#endif |
501 |
#endif |
502 |
|
503 |
+#define STACK_CHECK_SPEC "%{fstack-check|fstack-check=*:;: -fstack-check} " |
504 |
+#ifdef EXTRA_OPTIONS |
505 |
+#define LINK_NOW_SPEC "%{!nonow:-z now} " |
506 |
+#else |
507 |
+#define LINK_NOW_SPEC "" |
508 |
+#endif |
509 |
+ |
510 |
#ifdef ENABLE_DEFAULT_PIE |
511 |
#define NO_PIE_SPEC "no-pie|static" |
512 |
#define PIE_SPEC NO_PIE_SPEC "|r|shared:;" |
513 |
@@ -1013,7 +1020,7 @@ proper position among the other output f |
514 |
%(linker) " \ |
515 |
LINK_PLUGIN_SPEC \ |
516 |
"%{flto|flto=*:%<fcompare-debug*} \ |
517 |
- %{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \ |
518 |
+ %{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC LINK_NOW_SPEC \ |
519 |
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \ |
520 |
"%X %{o*} %{e*} %{N} %{n} %{r}\ |
521 |
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} \ |
522 |
@@ -1052,7 +1059,11 @@ proper position among the other output f |
523 |
|
524 |
static const char *asm_debug = ASM_DEBUG_SPEC; |
525 |
static const char *cpp_spec = CPP_SPEC; |
526 |
+#ifdef EXTRA_OPTIONS |
527 |
+static const char *cc1_spec = CC1_SPEC STACK_CHECK_SPEC; |
528 |
+#else |
529 |
static const char *cc1_spec = CC1_SPEC; |
530 |
+#endif |
531 |
static const char *cc1plus_spec = CC1PLUS_SPEC; |
532 |
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC; |
533 |
static const char *link_ssp_spec = LINK_SSP_SPEC; |
534 |
--- a/gcc/opts.c 2016-03-17 16:11:35.000000000 +0100 |
535 |
+++ b/gcc/opts.c 2016-04-27 16:48:59.952580580 +0200 |
536 |
@@ -495,7 +495,9 @@ static const struct default_options defa |
537 |
{ OPT_LEVELS_2_PLUS, OPT_fschedule_insns2, NULL, 1 }, |
538 |
#endif |
539 |
{ OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 }, |
540 |
+#ifndef EXTRA_OPTIONS |
541 |
{ OPT_LEVELS_2_PLUS, OPT_fstrict_overflow, NULL, 1 }, |
542 |
+#endif |
543 |
{ OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_freorder_blocks_algorithm_, NULL, |
544 |
REORDER_BLOCKS_ALGORITHM_STC }, |
545 |
{ OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 }, |
546 |
|
547 |
|
548 |
|
549 |
1.1 src/patchsets/gcc/6.3.0/gentoo/90_all_pr55930-dependency-tracking.patch |
550 |
|
551 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/90_all_pr55930-dependency-tracking.patch?rev=1.1&view=markup |
552 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/90_all_pr55930-dependency-tracking.patch?rev=1.1&content-type=text/plain |
553 |
|
554 |
Index: 90_all_pr55930-dependency-tracking.patch |
555 |
=================================================================== |
556 |
libatomic build failure if configured with --disable-dependency-tracking |
557 |
load_n.c:115:1: fatal error: opening dependency file .deps/load_1_.lo.Ppo: No such file or directory |
558 |
|
559 |
https://bugs.gentoo.org/463463 |
560 |
http://gcc.gnu.org/PR55930 |
561 |
|
562 |
--- a/libatomic/Makefile.in |
563 |
+++ b/libatomic/Makefile.in |
564 |
@@ -298,7 +298,8 @@ PAT_N = $(word 2,$(PAT_SPLIT)) |
565 |
PAT_S = $(word 3,$(PAT_SPLIT)) |
566 |
IFUNC_DEF = -DIFUNC_ALT=$(PAT_S) |
567 |
IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS)) |
568 |
-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo |
569 |
+@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo |
570 |
+@AMDEP_FALSE@M_DEPS = |
571 |
M_SIZE = -DN=$(PAT_N) |
572 |
M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT)) |
573 |
M_FILE = $(PAT_BASE)_n.c |
574 |
|
575 |
|
576 |
|
577 |
1.1 src/patchsets/gcc/6.3.0/gentoo/README.history |
578 |
|
579 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/README.history?rev=1.1&view=markup |
580 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/6.3.0/gentoo/README.history?rev=1.1&content-type=text/plain |
581 |
|
582 |
Index: README.history |
583 |
=================================================================== |
584 |
1.0 24 Dec 2016 |
585 |
+ 10_all_default-fortify-source.patch |
586 |
+ 11_all_default-warn-format-security.patch |
587 |
+ 12_all_default-warn-trampolines.patch |
588 |
+ 13_all_default-ssp-fix.patch |
589 |
+ 25_all_alpha-mieee-default.patch |
590 |
+ 29_all_arm_armv4t-default.patch |
591 |
+ 34_all_ia64_note.GNU-stack.patch |
592 |
+ 42_all_superh_default-multilib.patch |
593 |
+ 50_all_libiberty-asprintf.patch |
594 |
+ 51_all_libiberty-pic.patch |
595 |
+ 54_all_nopie-all-flags.patch |
596 |
+ 55_all_extra-options.patch |
597 |
+ 90_all_pr55930-dependency-tracking.patch |