Gentoo Archives: gentoo-commits

From: "Ryan Hill (dirtyepic)" <dirtyepic@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/gcc/4.6.1/pie: 10_all_gcc45_configure.patch 11_all_gcc44_config.in.patch 12_all_gcc46_Makefile.in.patch 20_all_gcc46_gcc.c.patch 21_all_gcc44_decl-tls-model.patch 22_all_gcc46-default-ssp.patch 30_all_gcc44_esp.h.patch 33_all_gcc46_config_rs6000_linux64.h.patch 35_all_gcc46_config_crtbegints.patch 60_all_gcc44_invoke.texi.patch README README.Changelog README.Gentoo.patches README.history
Date: Tue, 05 Jul 2011 04:51:05
Message-Id: 20110705045050.05F8820051@flycatcher.gentoo.org
1 dirtyepic 11/07/05 04:50:50
2
3 Added: 10_all_gcc45_configure.patch
4 11_all_gcc44_config.in.patch
5 12_all_gcc46_Makefile.in.patch
6 20_all_gcc46_gcc.c.patch
7 21_all_gcc44_decl-tls-model.patch
8 22_all_gcc46-default-ssp.patch
9 30_all_gcc44_esp.h.patch
10 33_all_gcc46_config_rs6000_linux64.h.patch
11 35_all_gcc46_config_crtbegints.patch
12 60_all_gcc44_invoke.texi.patch README
13 README.Changelog README.Gentoo.patches
14 README.history
15 Log:
16 Initial 4.6.1 patchset based on latest 4.6.0 patchset.
17
18 Revision Changes Path
19 1.1 src/patchsets/gcc/4.6.1/pie/10_all_gcc45_configure.patch
20
21 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/10_all_gcc45_configure.patch?rev=1.1&view=markup
22 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/10_all_gcc45_configure.patch?rev=1.1&content-type=text/plain
23
24 Index: 10_all_gcc45_configure.patch
25 ===================================================================
26 2010-05-25 Magnus Granberg <zorry@g.o>, Anthony G. Basile <basile@××××××××××××××.edu>
27
28 * configure Add --enable-esp. Add-fno-stack-protector
29 to stage1_cflags.
30 * gcc/configure Add --enable-esp. Check -z now and -z relro.
31 Define ENABLE_ESP.
32 Check if we support crtbeginTS and define ENABLE_CRTBEGINTS.
33 * libmudflap/configure Add AC_SUBST enable_esp.
34
35
36 --- configure 2010-01-31 13:12:21.000000000 -0500
37 +++ configure 2010-02-07 14:29:51.000000000 -0500
38 @@ -707,6 +707,7 @@
39 CFLAGS
40 CC
41 target_subdir
42 +enable_esp
43 host_subdir
44 build_subdir
45 build_libsubdir
46 @@ -934,6 +934,11 @@
47 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
48 --enable-gold use gold instead of ld
49 --enable-libada build libada directory
50 + --enable-esp
51 + Enable Stack protector, Position independent executable as
52 + default if we have suppot for it when compiling
53 + and link with -z relro and -z now as default.
54 + Linux targets supported i*86, x86_64, powerpc, powerpc64, ia64 and arm
55 --enable-libssp build libssp directory
56 --disable-ppl-version-check disable check for PPL version
57 --disable-cloog-version-check disable check for CLooG version
58 @@ -2145,6 +2150,25 @@
59 noconfigdirs="$noconfigdirs gnattools"
60 fi
61
62 +# Check whether --enable-esp was given and target have the support.
63 +# Check whether --enable-esp or --disable-esp was given.
64 +if test "${enable_esp+set}" = set; then
65 + enableval="$enable_esp"
66 +
67 + case $target in
68 + i?86*-*-linux* | x86_64*-*-linux* | powerpc-*-linux* | powerpc64-*-linux* | arm*-*-linux* | ia64-*-linux*)
69 + enable_esp=yes
70 + ;;
71 + *)
72 + { { echo "$as_me:$LINENO: error: *** --enable-esp is not supported on this $target target." >&5
73 +echo "$as_me: error: *** --enable-esp is not supported on this $target target." >&2;}
74 + { (exit 1); exit 1; }; }
75 + ;;
76 + esac
77 +
78 +fi;
79 +
80 +
81 # Check whether --enable-libssp was given.
82 if test "${enable_libssp+set}" = set; then :
83 enableval=$enable_libssp; ENABLE_LIBSSP=$enableval
84 @@ -14266,6 +14290,9 @@
85 *) stage1_cflags="-g -J" ;;
86 esac ;;
87 esac
88 +if test x$enable_esp = xyes; then
89 + stage1_cflags="$stage1_cflags -fno-stack-protector"
90 +fi
91
92 # This is aimed to mimic bootstrap with a non-GCC compiler to catch problems.
93 if test "$GCC" = yes -a "$ENABLE_BUILD_WITH_CXX" != yes; then
94 --- gcc/configure 2010-01-31 10:01:53.000000000 -0500
95 +++ gcc/configure 2010-02-07 14:29:56.000000000 -0500
96 @@ -678,6 +678,8 @@
97 HOST_LIBS
98 GGC
99 libgcc_visibility
100 +enable_esp
101 +enable_crtbeginTS
102 gcc_cv_readelf
103 gcc_cv_objdump
104 ORIGINAL_NM_FOR_TARGET
105 @@ -24480,6 +24481,50 @@
106 ;;
107 esac
108
109 +echo "$as_me:$LINENO: checking linker -z now support" >&5
110 +echo $ECHO_N "checking linker -z now support... $ECHO_C" >&6
111 +if test "${gcc_cv_ld_now+set}" = set; then
112 + echo $ECHO_N "(cached) $ECHO_C" >&6
113 +else
114 + gcc_cv_ld_now=no
115 +if test $in_tree_ld = yes ; then
116 + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \
117 + && test $in_tree_ld_is_elf = yes; then
118 + gcc_cv_ld_now=yes
119 + fi
120 +elif test x$gcc_cv_ld != x; then
121 + # Check if linker supports -z now options
122 + if $gcc_cv_ld --help 2>/dev/null | grep now > /dev/null; then
123 + gcc_cv_ld_now=yes
124 + fi
125 +fi
126 +
127 +fi
128 +echo "$as_me:$LINENO: result: $gcc_cv_ld_now" >&5
129 +echo "${ECHO_T}$gcc_cv_ld_now" >&6
130 +
131 +echo "$as_me:$LINENO: checking linker -z relro support" >&5
132 +echo $ECHO_N "checking linker -z relro support... $ECHO_C" >&6
133 +if test "${gcc_cv_ld_relro+set}" = set; then
134 + echo $ECHO_N "(cached) $ECHO_C" >&6
135 +else
136 + gcc_cv_ld_relro=no
137 +if test $in_tree_ld = yes ; then
138 + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \
139 + && test $in_tree_ld_is_elf = yes; then
140 + gcc_cv_ld_relro=yes
141 + fi
142 +elif test x$gcc_cv_ld != x; then
143 + # Check if linker supports -z relro and -z norelro options
144 + if $gcc_cv_ld --help 2>/dev/null | grep relro > /dev/null; then
145 + gcc_cv_ld_relro=yes
146 + fi
147 +fi
148 +
149 +fi
150 +echo "$as_me:$LINENO: result: $gcc_cv_ld_relro" >&5
151 +echo "${ECHO_T}$gcc_cv_ld_relro" >&6
152 +
153 { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker --build-id support" >&5
154 $as_echo_n "checking linker --build-id support... " >&6; }
155 if test "${gcc_cv_ld_buildid+set}" = set; then :
156 @@ -24411,6 +23745,74 @@
157
158 fi
159
160 +if test x$enable_esp = xyes ; then
161 +case $target in
162 + ia64*-*-linux*)
163 + if test x$gcc_cv_ld_now = xyes; then
164 + enable_esp_ld=yes
165 + else
166 + enable_esp_ld=no
167 + fi
168 + ;;
169 + *-*-linux*)
170 + if test x$gcc_cv_ld_relro = xyes && test x$gcc_cv_ld_now = xyes; then
171 + enable_esp_ld=yes
172 + else
173 + enable_esp_ld=no
174 + fi
175 + ;;
176 + *)
177 + enable_esp_ld=no
178 + ;;
179 + esac
180 +else
181 + enable_espf_ld=no
182 +fi
183 +if test x$enable_esp_ld = xyes; then
184 +
185 +cat >>confdefs.h <<\_ACEOF
186 +#define ENABLE_ESP 1
187 +_ACEOF
188 +
189 +fi
190 +
191 +if test x$enable_esp = xyes && test x$enable_esp_ld = xno; then
192 + { { echo "$as_me:$LINENO: error: *** --enable-esp is not supported. You don't have -z,relro or -z,now support in the linker." >&5
193 +echo "$as_me: error: *** --enable-esp is not supported. You don't have -z,relro or -z,now support in the linker." >&2;}
194 + { (exit 1); exit 1; }; }
195 +fi
196 +
197 +echo "$as_me:$LINENO: checking for crtbeginTS.o support" >&5
198 +echo $ECHO_N "checking for crtbeginTS.o support... $ECHO_C" >&6
199 +if test "${enable_crtbeginTS+set}" = set; then
200 + echo $ECHO_N "(cached) $ECHO_C" >&6
201 +else
202 +
203 +if test x$enable_esp = xyes ; then
204 + case "$target" in
205 + ia64*-*-linux*)
206 + enable_crtbeginTS=no ;;
207 + *-*-linux*)
208 + if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then
209 + enable_crtbeginTS=yes
210 + fi
211 + ;;
212 + *) enable_crtbeginTS=no ;;
213 + esac
214 +fi
215 +
216 +fi
217 +echo "$as_me:$LINENO: result: $enable_crtbeginTS" >&5
218 +echo "${ECHO_T}$enable_crtbeginTS" >&6
219 +
220 +if test x$enable_crtbeginTS = xyes; then
221 +
222 +cat >>confdefs.h <<\_ACEOF
223 +#define ENABLE_CRTBEGINTS 1
224 +_ACEOF
225 +
226 +fi
227 +
228 # Check if TFmode long double should be used by default or not.
229 # Some glibc targets used DFmode long double, but with glibc 2.4
230 # and later they can use TFmode.
231 --- libmudflap/configure 2009-12-05 12:18:53.000000000 -0500
232 +++ libmudflap/configure 2010-02-07 14:29:51.000000000 -0500
233 @@ -652,6 +652,7 @@
234 MAINTAINER_MODE_FALSE
235 MAINTAINER_MODE_TRUE
236 am__untar
237 +enable_esp
238 am__tar
239 AMTAR
240 am__leading_dot
241
242
243
244 1.1 src/patchsets/gcc/4.6.1/pie/11_all_gcc44_config.in.patch
245
246 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/11_all_gcc44_config.in.patch?rev=1.1&view=markup
247 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/11_all_gcc44_config.in.patch?rev=1.1&content-type=text/plain
248
249 Index: 11_all_gcc44_config.in.patch
250 ===================================================================
251 2010-05-24 Magnus Granberg <zorry@g.o>
252
253 * gcc/config.in Add ENABLE_CRTBEGINTS and ENABLE_ESP
254
255 --- gcc/config.in 2009-04-21 11:08:08.000000000 +0200
256 +++ gcc/config.in 2009-05-12 00:10:08.000000000 +0200
257 @@ -46,6 +46,12 @@
258 #endif
259
260
261 +/* Define to 1 to enable crtbeginTS.o. */
262 +#ifndef USED_FOR_TARGET
263 +#undef ENABLE_CRTBEGINTS
264 +#endif
265 +
266 +
267 /* Define to 1 to specify that we are using the BID decimal floating point
268 format instead of DPD */
269 #ifndef USED_FOR_TARGET
270 @@ -65,6 +65,12 @@
271 #endif
272
273
274 +/* Define to 1 to enable esp. */
275 +#ifndef USED_FOR_TARGET
276 +#undef ENABLE_ESP
277 +#endif
278 +
279 +
280 /* Define to 1 to enable fixed-point arithmetic extension to C. */
281 #ifndef USED_FOR_TARGET
282 #undef ENABLE_FIXED_POINT
283
284
285
286 1.1 src/patchsets/gcc/4.6.1/pie/12_all_gcc46_Makefile.in.patch
287
288 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/12_all_gcc46_Makefile.in.patch?rev=1.1&view=markup
289 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/12_all_gcc46_Makefile.in.patch?rev=1.1&content-type=text/plain
290
291 Index: 12_all_gcc46_Makefile.in.patch
292 ===================================================================
293 2011-01-01 Magnus Granberg <zorry@g.o> Anthony G. Basile <basile@××××××××××××××.edu>
294
295 * Makefile.in We add -fno-stack-protector to BOOT_CFLAGS, LIBCFLAGS and LIBCXXFLAGS if enable_esp yes.
296 * gcc/Makefile.in Add -fno-PIE. to CRTSTUFF_CFLAGS and ALL_CFLAGS if enable_esp yes
297 Add crtbeginTS.o to EXTRA_PARTS if enable_crtbeginTS yes
298 We add new file crtbeginTS.o if enable_crtbeginTS yes
299 * libgcc/Makefile.in Add crtbeginTS.o to EXTRA_PARTS if enable_crtbeginTS yes
300 We add new file crtbeginTS.o if enable_crtbeginTS yes
301
302 --- Makefile.in 2010-01-22 08:35:38.000000000 -0500
303 +++ Makefile.in 2010-02-07 15:10:59.000000000 -0500
304 @@ -350,9 +350,17 @@
305 BUILD_PREFIX = @BUILD_PREFIX@
306 BUILD_PREFIX_1 = @BUILD_PREFIX_1@
307
308 +# Some stuff don't compile with SSP
309 +enable_esp = @enable_esp@
310 +ifeq ($(enable_esp),yes)
311 +ESP_NOSSP_CFLAGS = -fno-stack-protector
312 +else
313 +ESP_NOSSP_CFLAGS=
314 +endif
315 +
316 # Flags to pass to stage2 and later makes. They are defined
317 # here so that they can be overridden by Makefile fragments.
318 -BOOT_CFLAGS= -g -O2
319 +BOOT_CFLAGS= -g -O2 $(ESP_NOSSP_CFLAGS)
320 BOOT_LDFLAGS=
321 BOOT_ADAFLAGS=-gnatpg -gnata
322
323 @@ -403,9 +403,9 @@
324
325 CFLAGS = @CFLAGS@
326 LDFLAGS = @LDFLAGS@
327 -LIBCFLAGS = $(CFLAGS)
328 +LIBCFLAGS = $(CFLAGS) $(ESP_NOSSP_CFLAGS)
329 CXXFLAGS = @CXXFLAGS@
330 -LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
331 +LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates $(ESP_NOSSP_CFLAGS)
332 GOCFLAGS = $(CFLAGS)
333
334 TFLAGS =
335 --- gcc/Makefile.in 2010-01-22 17:22:51.000000000 -0500
336 +++ gcc/Makefile.in 2010-02-07 15:15:13.000000000 -0500
337 @@ -642,6 +642,14 @@
338 INHIBIT_LIBC_CFLAGS = -Dinhibit_libc
339 endif
340
341 +# We don't want to compile the compiler with -fPIE.
342 +enable_esp = @enable_esp@
343 +ifeq ($(enable_esp),yes)
344 +ESP_NOPIE_CFLAGS = -fno-PIE
345 +else
346 +ESP_NOPIE_CFLAGS=
347 +endif
348 +
349 # Options to use when compiling libgcc2.a.
350 #
351 LIBGCC2_DEBUG_CFLAGS = -g
352 @@ -662,7 +670,7 @@
353 CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
354 -finhibit-size-directive -fno-inline -fno-exceptions \
355 -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
356 - -fno-stack-protector \
357 + -fno-stack-protector $(ESP_NOPIE_CFLAGS) \
358 $(INHIBIT_LIBC_CFLAGS)
359
360 # Additional sources to handle exceptions; overridden by targets as needed.
361 @@ -678,6 +689,12 @@
362 # The rules for compiling them should be in the t-* file for the machine.
363 EXTRA_PARTS = @extra_parts@
364
365 +# We add crtbeginTS.o to the EXTRA_PARTS list if enable_crtbeginTS = yes
366 +enable_crtbeginTS = @enable_crtbeginTS@
367 +ifeq ($(enable_crtbeginTS),yes)
368 +EXTRA_PARTS += crtbeginTS.o
369 +endif
370 +
371 # List of extra object files that should be compiled and linked with
372 # compiler proper (cc1, cc1obj, cc1plus).
373 EXTRA_OBJS = @extra_objs@
374 @@ -998,7 +1006,7 @@
375
376 # This is the variable actually used when we compile. If you change this,
377 # you probably want to update BUILD_CFLAGS in configure.ac
378 -ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \
379 +ALL_CFLAGS = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) \
380 $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@
381
382 # The C++ version.
383 @@ -1856,9 +1873,10 @@
384 echo LIBGCC_SYNC = '$(LIBGCC_SYNC)' >> tmp-libgcc.mvars
385 echo LIBGCC_SYNC_CFLAGS = '$(LIBGCC_SYNC_CFLAGS)' >> tmp-libgcc.mvars
386 echo CRTSTUFF_CFLAGS = '$(CRTSTUFF_CFLAGS)' >> tmp-libgcc.mvars
387 - echo CRTSTUFF_T_CFLAGS = '$(CRTSTUFF_T_CFLAGS)' >> tmp-libgcc.mvars
388 + echo CRTSTUFF_T_CFLAGS = '$(CRTSTUFF_T_CFLAGS) $(ESP_NOPIE_CFLAGS)' >> tmp-libgcc.mvars
389 echo CRTSTUFF_T_CFLAGS_S = '$(CRTSTUFF_T_CFLAGS_S)' >> tmp-libgcc.mvars
390 echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
391 + echo enable_crtbeginTS = '$(enable_crtbeginTS)' >> tmp-libgcc.mvars
392
393 mv tmp-libgcc.mvars libgcc.mvars
394
395 @@ -1918,9 +1938,19 @@
396 $(T)crtbeginT.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
397 gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
398 $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
399 + $(ESP_NOPIE_CFLAGS) \
400 -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \
401 -o $(T)crtbeginT$(objext)
402
403 +# This is a version of crtbegin for -static -fPIE links if esp is enable.
404 +ifeq ($(enable_crtbeginTS),yes)
405 +$(T)crtbeginTS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
406 + gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
407 + $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
408 + -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O \
409 + -o $(T)crtbeginTS$(objext)
410 +endif
411 +
412 # Compile the start modules crt0.o and mcrt0.o that are linked with
413 # every program
414 $(T)crt0.o: s-crt0 ; @true
415 --- libgcc/Makefile.in 2009-07-30 18:33:49.000000000 -0400
416 +++ libgcc/Makefile.in 2010-02-07 15:10:59.000000000 -0500
417 @@ -291,6 +291,12 @@
418 gen-hide-list = echo > \$@
419 endif
420
421 +# We add crtbeginTS.o to the EXTRA_PARTS list if enable_crtbeginTS = yes
422 +enable_libgcc_crtbeginTS = $(enable_crtbeginTS)
423 +ifeq ($(enable_libgcc_crtbeginTS),yes)
424 +EXTRA_PARTS += crtbeginTS.o
425 +endif
426 +
427 ifneq ($(EXTRA_PARTS),)
428 extra-parts = libgcc-extra-parts
429 INSTALL_PARTS = $(EXTRA_PARTS)
430 @@ -842,6 +848,13 @@
431 crtbeginT.o: $(gcc_srcdir)/crtstuff.c
432 $(crt_compile) $(CRTSTUFF_T_CFLAGS) \
433 -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O
434 +
435 +# This is a version of crtbegin for -static -fPIE links.
436 +ifeq ($(enable_libgcc_crtbeginTS),yes)
437 +crtbeginTS.o: $(gcc_srcdir)/crtstuff.c
438 + $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
439 + -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O
440 +endif
441 endif
442
443 # Build extra startfiles in the libgcc directory.
444
445
446
447 1.1 src/patchsets/gcc/4.6.1/pie/20_all_gcc46_gcc.c.patch
448
449 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/20_all_gcc46_gcc.c.patch?rev=1.1&view=markup
450 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/20_all_gcc46_gcc.c.patch?rev=1.1&content-type=text/plain
451
452 Index: 20_all_gcc46_gcc.c.patch
453 ===================================================================
454 2011-01-01 Magnus Granberg <zorry@g.o>
455
456 * gcc/gcc.c include esp.h
457 static const char *cc1_spec We set that in esp.h if ENABLE_ESP.
458 #ifdef EXTRA_SPECS: Add ESP_EXTRA_SPECS
459 main(): Add do_self_spec esp_command_options_spec()
460
461 --- gcc/gcc.c 2010-01-21 10:29:30.000000000 -0500
462 +++ gcc/gcc.c 2010-01-29 23:29:16.000000000 -0500
463 @@ -44,6 +44,7 @@
464 #include "flags.h"
465 #include "opts.h"
466 #include "vec.h"
467 +#include "esp.h" /* for --enable-esp support */
468
469 /* By default there is no special suffix for target executables. */
470 /* FIXME: when autoconf is fixed, remove the host check - dj */
471 @@ -822,7 +823,9 @@
472
473 static const char *asm_debug;
474 static const char *cpp_spec = CPP_SPEC;
475 +#ifndef ENABLE_ESP
476 static const char *cc1_spec = CC1_SPEC;
477 +#endif
478 static const char *cc1plus_spec = CC1PLUS_SPEC;
479 static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
480 static const char *link_ssp_spec = LINK_SSP_SPEC;
481 @@ -1699,18 +1705,23 @@
482 INIT_STATIC_SPEC ("sysroot_hdrs_suffix_spec", &sysroot_hdrs_suffix_spec),
483 };
484
485 -#ifdef EXTRA_SPECS /* additional specs needed */
486 +/* EXTRA_SPECS needs to be defined */
487 +#ifndef EXTRA_SPECS
488 +#define EXTRA_SPECS
489 +#endif
490 +
491 +/* EXTRA_SPECS and ESP_EXTRA_SPECS add additional specs */
492 /* Structure to keep track of just the first two args of a spec_list.
493 - That is all that the EXTRA_SPECS macro gives us. */
494 + That is all that the EXTRA_SPECS and ESP_EXTRA_SPECS macro gives us. */
495 struct spec_list_1
496 {
497 const char *const name;
498 const char *const ptr;
499 };
500
501 -static const struct spec_list_1 extra_specs_1[] = { EXTRA_SPECS };
502 +/* ESP_EXTRA_SPECS before EXTRA_SPECS */
503 +static const struct spec_list_1 extra_specs_1[] = { ESP_EXTRA_SPECS, EXTRA_SPECS };
504 static struct spec_list *extra_specs = (struct spec_list *) 0;
505 -#endif
506
507 /* List of dynamically allocates specs that have been defined so far. */
508
509 @@ -1798,7 +1809,6 @@
510 if (verbose_flag)
511 notice ("Using built-in specs.\n");
512
513 -#ifdef EXTRA_SPECS
514 extra_specs = XCNEWVEC (struct spec_list, ARRAY_SIZE (extra_specs_1));
515
516 for (i = ARRAY_SIZE (extra_specs_1) - 1; i >= 0; i--)
517 @@ -1811,7 +1821,6 @@
518 sl->ptr_spec = &sl->ptr;
519 next = sl;
520 }
521 -#endif
522
523 for (i = ARRAY_SIZE (static_specs) - 1; i >= 0; i--)
524 {
525 @@ -7096,6 +7123,12 @@
526 gcc_exec_prefix = concat (gcc_exec_prefix, spec_machine, dir_separator_str,
527 spec_version, dir_separator_str, NULL);
528
529 +#ifdef ENABLE_ESP
530 + /* Process ESP_COMMAND_OPTIONS_SPEC, adding any new options to the end
531 + of the command line. */
532 + do_self_spec (esp_command_options_spec);
533 +#endif
534 +
535 /* Now we have the specs.
536 Set the `valid' bits for switches that match anything in any spec. */
537
538
539
540
541 1.1 src/patchsets/gcc/4.6.1/pie/21_all_gcc44_decl-tls-model.patch
542
543 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/21_all_gcc44_decl-tls-model.patch?rev=1.1&view=markup
544 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/21_all_gcc44_decl-tls-model.patch?rev=1.1&content-type=text/plain
545
546 Index: 21_all_gcc44_decl-tls-model.patch
547 ===================================================================
548 2009-06-13 Magnus Granberg <zorry@×××.nu>
549
550 b.g.o #232601
551 * gcc/varasm.c (decl_tls_model): Check flag_pic instead of flag_shlib.
552
553 --- gcc/varasm.c 2009-03-17 21:18:21.000000000 +0100
554 +++ gcc/varasm.c 2009-04-29 03:10:09.000000000 +0200
555 @@ -5607,7 +5607,11 @@
556 bool is_local;
557
558 is_local = targetm.binds_local_p (decl);
559 - if (!flag_shlib)
560 + #ifdef ENABLE_ESP
561 + if (!flag_pic)
562 + #else
563 + if (!flag_shlib)
564 + #endif
565 {
566 if (is_local)
567 kind = TLS_MODEL_LOCAL_EXEC;
568
569
570
571 1.1 src/patchsets/gcc/4.6.1/pie/22_all_gcc46-default-ssp.patch
572
573 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/22_all_gcc46-default-ssp.patch?rev=1.1&view=markup
574 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/22_all_gcc46-default-ssp.patch?rev=1.1&content-type=text/plain
575
576 Index: 22_all_gcc46-default-ssp.patch
577 ===================================================================
578 2011-03-05 Matthias Klose <doko@××××××.com>, Kees Cook <kees@×××××××.net>,
579 Magnus Granberg <zorry@g.o>
580
581 * gcc/objc/lang-specs.h compiler spec Add %(esp_options)
582 * gcc/objcp/lang-specs.h compiler spec Add %(esp_options)
583 * gcc/gcc.c *cpp_options Add %(esp_cpp_options)
584 * gcc/gcc.c default_compilers[] Add %(esp_options)
585 * gcc/cp/lang-specs.h compiler spec Add %(esp_options)
586
587 --- a/gcc/gcc.c.orig 2009-12-21
588 +++ b/gcc/gcc.c 2009-12-21
589 @@ -740,7 +749,7 @@
590 static const char *cpp_options =
591 "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
592 %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*}\
593 - %{undef} %{save-temps*:-fpch-preprocess}";
594 + %{undef} %{save-temps*:-fpch-preprocess} %(esp_cpp_options)";
595
596 /* This contains cpp options which are not passed when the preprocessor
597 output will be used by another program. */
598 @@ -914,9 +923,9 @@
599 %{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
600 %(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\
601 cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \
602 - %(cc1_options)}\
603 + %(cc1_options) %(esp_options)}\
604 %{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\
605 - cc1 %(cpp_unique_options) %(cc1_options)}}}\
606 + cc1 %(cpp_unique_options) %(cc1_options) %(esp_options)}}}\
607 %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 1},
608 {"-",
609 "%{!E:%e-E or -x required when input is from standard input}\
610 @@ -953,7 +953,7 @@
611 %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0},
612 {".i", "@cpp-output", 0, 0, 0},
613 {"@cpp-output",
614 - "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
615 + "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %(esp_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
616 {".s", "@assembler", 0, 0, 0},
617 {"@assembler",
618 "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
619 --- a/gcc/cp/lang-specs.h 2011-03-06 17:27:57.000000000 +0100
620 +++ b/gcc/cp/lang-specs.h 2011-03-26 13:30:40.312423000 +0100
621 @@ -47,7 +47,7 @@
622 %(cpp_options) %2 -o %{save-temps*:%b.ii} %{!save-temps*:%g.ii} \n}\
623 cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\
624 %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\
625 - %(cc1_options) %2\
626 + %(cc1_options) %(esp_options) %2\
627 %{!fsyntax-only:%{!fdump-ada-spec*:-o %g.s %{!o*:--output-pch=%i.gch}\
628 %W{o*:--output-pch=%*}}%V}}}}",
629 CPLUSPLUS_CPP_SPEC, 0, 0},
630 @@ -58,7 +58,7 @@
631 %(cpp_options) %2 -o %{save-temps*:%b.ii} %{!save-temps*:%g.ii} \n}\
632 cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\
633 %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\
634 - %(cc1_options) %2\
635 + %(cc1_options) %(esp_options) %2\
636 %{!fsyntax-only:%(invoke_as)}}}}",
637 CPLUSPLUS_CPP_SPEC, 0, 0},
638 {".ii", "@c++-cpp-output", 0, 0, 0},
639
640 --- a/gcc/objcp/lang-specs.h 2011-03-06 17:27:57.000000000 +0100
641 +++ a/gcc/objcp/lang-specs.h 2011-03-26 14:19:12.596423000 +0100
642 @@ -36,7 +36,7 @@
643 %(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\
644 cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\
645 %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\
646 - %(cc1_options) %2\
647 + %(cc1_options) %(esp_options) %2\
648 -o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}",
649 CPLUSPLUS_CPP_SPEC, 0, 0},
650 {"@objective-c++",
651 @@ -46,16 +46,16 @@
652 %(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\
653 cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\
654 %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\
655 - %(cc1_options) %2\
656 + %(cc1_options) %(esp_options) %2\
657 %{!fsyntax-only:%(invoke_as)}}}}",
658 CPLUSPLUS_CPP_SPEC, 0, 0},
659 {".mii", "@objective-c++-cpp-output", 0, 0, 0},
660 {"@objective-c++-cpp-output",
661 "%{!M:%{!MM:%{!E:\
662 - cc1objplus -fpreprocessed %i %(cc1_options) %2\
663 + cc1objplus -fpreprocessed %i %(cc1_options) %(esp_options) %2\
664 %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
665 {"@objc++-cpp-output",
666 "%nobjc++-cpp-output is deprecated; please use objective-c++-cpp-output instead\n\
667 %{!M:%{!MM:%{!E:\
668 - cc1objplus -fpreprocessed %i %(cc1_options) %2\
669 + cc1objplus -fpreprocessed %i %(cc1_options) %(esp_options) %2\
670 %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
671 --- a/gcc/objc/lang-specs.h 2011-03-06 17:27:57.000000000 +0100
672 +++ b/gcc/objc/lang-specs.h 2011-03-26 14:56:27.668423000 +0100
673 @@ -30,9 +30,9 @@
674 %{traditional|traditional-cpp:\
675 %eGNU Objective C no longer supports traditional compilation}\
676 %{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\
677 - cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}\
678 + cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}}\
679 %{!save-temps*:%{!no-integrated-cpp:\
680 - cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}}\
681 + cc1obj %(cpp_unique_options) %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}}}\
682 %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
683 {"@objective-c-header",
684 "%{E|M|MM:cc1obj -E %{traditional|traditional-cpp:-traditional-cpp}\
685 @@ -41,18 +41,18 @@
686 %{traditional|traditional-cpp:\
687 %eGNU Objective C no longer supports traditional compilation}\
688 %{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\
689 - cc1obj -fpreprocessed %b.mi %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
690 + cc1obj -fpreprocessed %b.mi %(cc1_options)%(esp_options) %{print-objc-runtime-info} %{gen-decls}\
691 -o %g.s %{!o*:--output-pch=%i.gch}\
692 %W{o*:--output-pch=%*}%V}\
693 %{!save-temps*:%{!no-integrated-cpp:\
694 - cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
695 + cc1obj %(cpp_unique_options) %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\
696 -o %g.s %{!o*:--output-pch=%i.gch}\
697 %W{o*:--output-pch=%*}%V}}}}}", 0, 0, 0},
698 {".mi", "@objective-c-cpp-output", 0, 0, 0},
699 {"@objective-c-cpp-output",
700 - "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
701 + "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\
702 %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
703 {"@objc-cpp-output",
704 "%nobjc-cpp-output is deprecated; please use objective-c-cpp-output instead\n\
705 - %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
706 + %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\
707 %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
708
709
710
711 1.1 src/patchsets/gcc/4.6.1/pie/30_all_gcc44_esp.h.patch
712
713 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/30_all_gcc44_esp.h.patch?rev=1.1&view=markup
714 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/30_all_gcc44_esp.h.patch?rev=1.1&content-type=text/plain
715
716 Index: 30_all_gcc44_esp.h.patch
717 ===================================================================
718 2010-05-27 Magnus Granberg <zorry@g.o>
719
720 * gcc/esp.h New file to support --enable-esp
721 Version 20100527.1
722
723 --- gcc/esp.h 2010-04-09 16:14:00.000000000 +0200
724 +++ gcc/esp.h 2010-04-29 21:30:47.000000000 +0200
725 @@ -0,0 +1,145 @@
726 +/* License terms see GNU GENERAL PUBLIC LICENSE Version 3.
727 + * Version 20100527.1
728 + * Magnus Granberg (Zorry) <zorry@g.o> */
729 +#ifndef GCC_ESP_H
730 +#define GCC_ESP_H
731 +
732 +/* This file will add -fstack-protector-all, -fPIE, -pie and -z now
733 + as default if the defines and the spec allow it.
734 + Added a hack for gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass
735 + to support older hardened GCC patches and we don't need to change the code on gcc-specs-* and _filter-hardened.
736 + This will add some unsupported upstream commands options as -nopie and -nonow.
737 + -D__KERNEL__ is added so we don't have -fPIE, -pie and -fstack-protector-all when building kernels.
738 + ESP_CC1_SPEC is added to CC1_SPEC.
739 + ESP_CC1_STRICT_OVERFLOW_SPEC is added so we don't disable the strict-overflow check.
740 + ESP_LINK_PIE_CHECK_SPEC check for -pie, -p, -pg, -profile and -static.
741 + ENABLE_CRTBEGINTS add support for crtbeginTS.o, build -static with -fPIE or -fpie.
742 +*/
743 +#ifdef ENABLE_ESP
744 +
745 + /* Hack to support gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass */
746 + #define ESP_CC1_SPEC " %(esp_cc1_ssp) %(esp_cc1_pie) %(esp_cc1_strict_overflow)"
747 + #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
748 + #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: }}"
749 + #else
750 + #define ESP_CC1_SSP_SPEC ""
751 + #endif
752 + #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP )
753 + #define ESP_CC1_PIE_SPEC "%{!nopie: }"
754 + #else
755 + #define ESP_CC1_PIE_SPEC ""
756 + #endif
757 + #define ESP_CC1_STRICT_OVERFLOW_SPEC "%{!fstrict-overflow:%{!fno-strict-overflow: -fno-strict-overflow}}"
758 +
759 + /* ESP_LINK_SPEC is added to LINK_PIE_SPEC if esp is enable
760 + -z now will be added if we don't have -vanilla spec. We do a -pie incompatible check
761 + Don't remove the specs in the end */
762 + #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_pie_check) "
763 + #define ESP_LINK_NOW_SPEC "%{!nonow:-z now}"
764 +
765 + /* We use ESP_COMMAND_OPTIONS_SPEC to add pie command-line options. */
766 + #define ESP_COMMAND_OPTIONS_SPEC "%{!D__KERNEL__:%{!nopie:%(esp_options_pie) %(esp_link_pie)}}"
767 +
768 + /* ESP_OPTIONS_SPEC is added to the compiler spec in gcc/gcc.c */
769 + #define ESP_OPTIONS_SPEC "%(esp_options_ssp)"
770 +
771 + /* ESP_CPP_OPTIONS_SPEC is added to the cpp_options spec in gcc/gcc.c
772 + For precompiling headers. */
773 + #define ESP_CPP_OPTIONS_SPEC "%(esp_options_ssp)"
774 +
775 + /* This will add -fstack-protector-all if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
776 + -fstack-protector-all and we have EFAULT_SSP or EFAULT_PIE_SSP defined. */
777 + #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
778 + #define ESP_OPTIONS_SSP_SPEC \
779 + "%{!D__KERNEL__:%{!nostdlib:%{!nodefaultlibs: %{!fno-stack-protector: \
780 + %{!fstack-protector:%{!fstack-protector-all:-fstack-protector-all}}}}}}"
781 + #else
782 + #define ESP_OPTIONS_SSP_SPEC ""
783 + #endif
784 +
785 + /* If EFAULT_PIE or EFAULT_PIE_SSP is defined we will add -fPIE -pie */
786 + #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP )
787 +
788 + /* This will add -fPIE if we don't have -pie -fpic -fPIC -fpie -fPIE -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static
789 + -nostdlib -nostartfiles. */
790 + /* With ENABLE_CRTBEGINTS we don't need to check for -static */
791 + #ifdef ENABLE_CRTBEGINTS
792 + #define ESP_OPTIONS_PIE_SPEC \
793 + "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \
794 + %{!shared: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }"
795 + #else
796 + #define ESP_OPTIONS_PIE_SPEC \
797 + "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \
798 + %{!shared: %{!static: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }}"
799 + #endif
800 +
801 + /* This will add -pie if we don't have -pie -A -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static -r -nostdlib
802 + -nostartfiles */
803 + /* With ENABLE_CRTBEGINTS we don't need to check for -static
804 + and we add -pie only to get the start and endfiles. -pie will not go to the linker. */
805 + #ifdef ENABLE_CRTBEGINTS
806 + #define ESP_LINK_PIE_SPEC \
807 + "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!r: \
808 + %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}"
809 + #else
810 + #define ESP_LINK_PIE_SPEC \
811 + "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!static:%{!r: \
812 + %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}}"
813 + #endif
814 +
815 + /* This will check if -pie is set when (-static) -pg -p -profile. If set it will make gcc print out
816 + "-pie and (static)|pg|p|profile are incompatible when linking" */
817 + /* With ENABLE_CRTBEGINTS we don't need to check for -static */
818 + #ifdef ENABLE_CRTBEGINTS
819 + #define ESP_LINK_PIE_CHECK_SPEC \
820 + "%{pie:%{pg|p|profile:%e-pie and -pg|p|profile are incompatible when linking}}"
821 + #else
822 + #define ESP_LINK_PIE_CHECK_SPEC \
823 + "%{pie:%{static|pg|p|profile:%e-pie and -static|pg|p|profile are incompatible when linking}}"
824 + #endif
825 +
826 + /* We don't pass -pie to the linker when -static. */
827 + #ifdef ENABLE_CRTBEGINTS
828 + #define LINK_PIE_SPEC "%{!static:%{pie:-pie}} %(esp_link)"
829 + #else
830 + #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)"
831 + #endif
832 +
833 + #else
834 + #define ESP_OPTIONS_PIE_SPEC ""
835 + #define ESP_LINK_PIE_CHECK_SPEC ""
836 + #define ESP_LINK_PIE_SPEC ""
837 + #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)"
838 + #endif
839 +
840 + /* We add extra spec name's to the EXTRA_SPECS list */
841 + #define ESP_EXTRA_SPECS \
842 + { "esp_cc1", ESP_CC1_SPEC }, \
843 + { "esp_cc1_pie", ESP_CC1_PIE_SPEC }, \
844 + { "esp_cc1_ssp", ESP_CC1_SSP_SPEC }, \
845 + { "esp_cc1_strict_overflow", ESP_CC1_STRICT_OVERFLOW_SPEC }, \
846 + { "esp_link", ESP_LINK_SPEC }, \
847 + { "esp_link_now", ESP_LINK_NOW_SPEC }, \
848 + { "esp_link_pie", ESP_LINK_PIE_SPEC }, \
849 + { "esp_link_pie_check", ESP_LINK_PIE_CHECK_SPEC }, \
850 + { "esp_command_options", ESP_COMMAND_OPTIONS_SPEC }, \
851 + { "esp_cpp_options", ESP_CPP_OPTIONS_SPEC }, \
852 + { "esp_options", ESP_OPTIONS_SPEC }, \
853 + { "esp_options_pie", ESP_OPTIONS_PIE_SPEC }, \
854 + { "esp_options_ssp", ESP_OPTIONS_SSP_SPEC }
855 +
856 + static const char *esp_command_options_spec = ESP_COMMAND_OPTIONS_SPEC;
857 + static const char *cc1_spec = CC1_SPEC ESP_CC1_SPEC;
858 +
859 +#else /* If not ESP_ENABLE defined do this. */
860 +
861 + #define ESP_OPTIONS_SPEC ""
862 + #define ESP_CPP_OPTIONS_SPEC ""
863 +
864 + /* We add extra spec name's to the EXTRA_SPECS list */
865 + #define ESP_EXTRA_SPECS \
866 + { "esp_options", ESP_OPTIONS_SPEC }, \
867 + { "esp_cpp_options", ESP_CPP_OPTIONS_SPEC }
868 +
869 +#endif
870 +#endif /* End GCC_ESP_H */
871
872
873
874 1.1 src/patchsets/gcc/4.6.1/pie/33_all_gcc46_config_rs6000_linux64.h.patch
875
876 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/33_all_gcc46_config_rs6000_linux64.h.patch?rev=1.1&view=markup
877 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/33_all_gcc46_config_rs6000_linux64.h.patch?rev=1.1&content-type=text/plain
878
879 Index: 33_all_gcc46_config_rs6000_linux64.h.patch
880 ===================================================================
881 2011-03-05 Peter S. Mazinger <ps.m@×××.net>, Magnus Granberg <zorry@g.o>
882
883 * gcc/config/rs6000/linux64.h ASM_SPEC32 Change %{fpic:-K PIC} %{fPIC:-K PIC}
884 to %{fpic|fPIC|fpie|fPIE:-K PIC}
885
886 --- gcc/config/rs6000/linux64.h.psm 2009-04-10 01:23:07.000000000 +0200
887 +++ gcc/config/rs6000/linux64.h 2009-09-23 12:34:26.000000000 +0200
888 @@ -162,7 +162,7 @@
889 #endif
890
891 #define ASM_SPEC32 "-a32 \
892 -%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
893 +%{mrelocatable} %{mrelocatable-lib} %{fpic|fPIC|fpie|fPIE:-K PIC} \
894 %{memb} %{!memb: %{msdata=eabi: -memb}} \
895 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
896 %{mcall-freebsd: -mbig} \
897
898
899
900 1.1 src/patchsets/gcc/4.6.1/pie/35_all_gcc46_config_crtbegints.patch
901
902 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/35_all_gcc46_config_crtbegints.patch?rev=1.1&view=markup
903 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/35_all_gcc46_config_crtbegints.patch?rev=1.1&content-type=text/plain
904
905 Index: 35_all_gcc46_config_crtbegints.patch
906 ===================================================================
907 2011-03-05 Magnus Granberg <zorry@g.o>
908
909 * gcc/config/gnu-user.h If ENABLE_CRTBEGINTS, -static and -pie use crtbegineTS.o.
910 * gcc/config/rs6000/sysv4.h If ENABLE_CRTBEGINTS, -static and -pie use crtbegineTS.o.
911
912 --- gcc/config/gnu-user.h 2009-04-10 01:23:07.000000000 +0200
913 +++ gcc/config/gnu-user.h 2009-09-08 04:08:06.000000000 +0200
914 @@ -39,7 +39,11 @@
915 provides part of the support for getting C++ file-scope static
916 object constructed before entering `main'. */
917
918 -#if defined HAVE_LD_PIE
919 +#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINTS)
920 +#define GNU_USER_TARGET_STARTFILE_SPEC \
921 + "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} crti.o%s \
922 + %{static:%{pie:crtbeginTS.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}"
923 +#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINTS)
924 #define GNU_USER_TARGET_STARTFILE_SPEC \
925 "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
926 crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
927 --- gcc/config/rs6000/sysv4.h 2009-04-10 01:23:07.000000000 +0200
928 +++ gcc/config/rs6000/sysv4.h 2009-09-08 04:41:50.000000000 +0200
929 @@ -883,7 +883,12 @@
930 %{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
931 %{!shared: %{profile:-lc_p} %{!profile:-lc}}}"
932
933 -#ifdef HAVE_LD_PIE
934 +#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINTS)
935 +#define STARTFILE_LINUX_SPEC "\
936 +%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
937 +%{mnewlib:ecrti.o%s;:crti.o%s} \
938 +%{static:%{pie:crtbeginTS.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}"
939 +#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINTS)
940 #define STARTFILE_LINUX_SPEC "\
941 %{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
942 %{mnewlib:ecrti.o%s;:crti.o%s} \
943
944
945
946 1.1 src/patchsets/gcc/4.6.1/pie/60_all_gcc44_invoke.texi.patch
947
948 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/60_all_gcc44_invoke.texi.patch?rev=1.1&view=markup
949 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/60_all_gcc44_invoke.texi.patch?rev=1.1&content-type=text/plain
950
951 Index: 60_all_gcc44_invoke.texi.patch
952 ===================================================================
953 2009-09-11 Magnus Granberg <zorry@g.o>
954
955 * gcc/doc/invoke.texi Add NOTES about -fstack-protector-all, -pie and
956 -fPIE/-fpie when --enable-esp is enable, this options is on by default.
957
958 --- gcc/doc/invoke.texi 2009-04-01 09:18:47.000000000 +0200
959 +++ gcc/doc/invoke.texi 2009-06-18 14:08:38.000000000 +0200
960 @@ -7134,6 +7134,11 @@
961 @opindex fstack-protector-all
962 Like @option{-fstack-protector} except that all functions are protected.
963
964 +NOTE: When --enable-esp this option is enabled by default
965 +for C, C++, ObjC, ObjC++, if neither @option{-fno-stack-protector}
966 +or @option{-nostdlib} or @option{-nodefaultlibs} or
967 +@option{-fstack-protector} are found.
968 +
969 @item -fsection-anchors
970 @opindex fsection-anchors
971 Try to reduce the number of symbolic address calculations by using
972 @@ -7960,6 +7965,12 @@
973 that were used to generate code (@option{-fpie}, @option{-fPIE},
974 or model suboptions) when you specify this option.
975
976 +NOTE: When --enable-esp this option is enabled by default
977 +for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE}
978 +or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or
979 +@option{-nostartfiles} or @option{-shared} or @option{-pg} or @option{-p}
980 +are found.
981 +
982 @item -rdynamic
983 @opindex rdynamic
984 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
985 @@ -15889,6 +15910,11 @@
986 @code{__pie__} and @code{__PIE__}. The macros have the value 1
987 for @option{-fpie} and 2 for @option{-fPIE}.
988
989 +NOTE: When --enable-esp this option is enabled by default
990 +for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE}
991 +or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or
992 +@option{-nostartfiles} or @option{-shared} are found.
993 +
994 @item -fno-jump-tables
995 @opindex fno-jump-tables
996 Do not use jump tables for switch statements even where it would be
997
998
999
1000 1.1 src/patchsets/gcc/4.6.1/pie/README
1001
1002 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/README?rev=1.1&view=markup
1003 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/README?rev=1.1&content-type=text/plain
1004
1005 Index: README
1006 ===================================================================
1007 This work started with bugs #94325 #100689 #106222 #149292 #149649 and the overlay on http://overlays.gentoo.org/dev/kevquinn.
1008 By Kevin K. Quinn, Peter S. Mazinger, Natanael Copa, Alexander Gabert, Solar, PaX Team, SpanKY and mentor.
1009
1010 The work stalled. Some threads on the Gentoo forum started to do their own fixes to get it working.
1011 Xake started the thread where most of the new work is done: "How long until hardened and toolchain will produce a hardened gcc4?"
1012 http://forums.gentoo.org/viewtopic-t-668885.html. I joined the thread and started to code.
1013
1014 We started with the pieworld code from kevquinn's overlay. The PIE and minispecs part hit the tree later on.
1015 With GCC 4.4.0 I was willing to do some code cleanup, use built-in specs and add it as --enable-esp in the
1016 configure command line.
1017
1018 Thank you all:
1019 Kevin K. Quinn, Peter S. Mazinger, Natanael Copa, Alexander Gabert, Solar, PaX Team, SpanKY, Xake, Dwokfur,
1020 KernelOfTruth, SteveL, nixnut, Hopeless, forsaken1, XioXous, obrut<-, mv, qjim, Tommy[D], Genewb, radegand,
1021 unk, neuron, alexxy, hellboi64, likewhoa, g0rg0n, costel78, polsas, 7v5w7go9ub0o, uberpinguin, Naib, cilly,
1022 bonsaikitten, kerframil, agaffney, Gordon Malm, blueness, Matthias Klose, Kees Cook, mentor, Anarchy,
1023 devurandom and everyone else for helping to test, suggestions, fixes and anything else we have missed.
1024 /2009-00-09 Magnus Grenberg (Zorry) <zorry@×××.nu>
1025
1026
1027
1028 1.1 src/patchsets/gcc/4.6.1/pie/README.Changelog
1029
1030 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/README.Changelog?rev=1.1&view=markup
1031 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/README.Changelog?rev=1.1&content-type=text/plain
1032
1033 Index: README.Changelog
1034 ===================================================================
1035 0.4.8 Magnus granberg <zorry@g.o>
1036
1037 * gcc/objc/lang-specs.h Bumped for gcc 4.6.0 release
1038 * gcc/objcp/lang-specs.h Bumped for gcc 4.6.0 release
1039 * gcc/cp/lang-specs.h Bumped for gcc 4.6.0 release
1040
1041 0.4.7 Magnus Granberg <zorry@g.o>
1042
1043 * gcc/gcc.c Add %(esp_options) and %(esp_cpp_options)
1044 * gcc/esp.h Use the esp.h patch from gcc-4.4 patchset
1045 * gcc/config/rs6000/linux64.h Bumed for >2011-02-26 snapshot
1046 * gcc/objc/lang-specs.h Add %(esp_options)
1047 * gcc/objcp/lang-specs.h Add %(esp_options)
1048 * gcc/cp/lang-specs.h Add %(esp_options)
1049 * gcc/config/gnu-user.h Add crtbeginTS.o support
1050
1051 0.4.6 Magnus Granberg <zorry@g.o>
1052
1053 * Makefile.in Bumped for gcc 4.6
1054 * gcc/Makefile.in Bumped for gcc 4.6
1055 added ESP_NOPIE_CFLAGS to ALL_CFLAGS
1056 remove any ESP_NOSSP_CFLAGS
1057 remove any ESP_NOPIE_CFLAGS from crt* when not needed
1058 * gcc/gcc.c Bumped for gcc 4.6
1059 moved espf_options_ssp to espf_command_options_spec
1060 * gcc/esp.h Added espf_options_ssp to espf_cc1_command_spec
1061 * gcc/config/rs6000/linux64.h Bumped for gcc 4.6
1062 * gcc/config/linux.h Bumped for gcc 4.6
1063
1064 0.4.5 Magnus Granberg <zorry@g.o>
1065
1066 * gcc/config/rs6000/sysv4.h Fix a typo in the static spec rules
1067
1068 0.4.4 Magnus Granberg <zorry@g.o>
1069
1070 * gcc/esp.h Renamed ESP_CC1_STRICT_SPEC to ESP_CC1_STRICT_OVERFLOW_SPEC
1071 Renamed ESP_OPTIONS_PIE_CHECK_SPEC to ESP_LINK_PIE_CHECK_SPEC
1072
1073 0.4.3 Magnus Granberg <zorry@g.o>
1074
1075 #299061 b.g.o
1076 * gcc/gcc.c removed the pie incompatible specs rule call
1077 * gcc/esp.h Move the -pie incompatible check to esp_link
1078 remove the -shared incompatible check
1079
1080 0.4.2 Magnus granberg <zorry@g.o>
1081
1082 * configure remove the changes from 0.4.1
1083 * Makefile.in remove the changes from 0.4.1 remove -fstack-protector check.
1084 * gcc/configure remove the changes from 0.4.1
1085 * gcc/config.in remove the changes from 0.4.1 remove HAVE_GCC_SSP
1086 * gcc/Makefile remove the changes from 0.4.1
1087 * gcc/esp.h change HAVE_GCC_LD_PIE to (EFAULT_PIE || EFAULT_PIE_SSP)
1088 change HAVE_GCC_SSP to (EFAULT_SSP || EFAULT_PIE_SSP)
1089 * libmudflap/Makefiles.in remove the changes from 0.4.1
1090
1091 0.4.1 Magnus Granberg <zorry@g.o>
1092
1093 *configure removed check for --enable-esp removed enable_esp
1094 added check for --enable-esp=(no|all|nopie|nossp). added enable_esp_set
1095 *Makefile.in renamed enable_esp to enable_esp_set
1096 *gcc/configure removed check for --enable-esp removed enable_esp
1097 added check for --enable-esp=(no|all|nopie|nossp). added enable_esp_set
1098 added a -fPIE -pie check. change AC_COMPILE_IFELSE to AC_LINK_IFELSE in the
1099 -fstack-protector check.
1100 * gcc/config.in Added HAVE_GCC_LD_PIE
1101 *gcc/Makefile.in renamed enable_esp to enable_esp_set
1102 *gcc/esp.h Renamed HAVE_LD_PIE to HAVE_GCC_LD_PIE
1103 Added HAVE_GCC_LD_PIE to #define ESP_CC1_PIE_SPEC. Move ESP_COMMAND_OPTIONS_SPEC
1104 * libmudflap/Makefiles.in In enable_esp change ifeq to ifdef.
1105
1106 #293843 b.g.o
1107 *gcc/esp.h Added -nonow to the -z now specs.
1108
1109 0.4.0 Anthony G. Basile <basile@××××××××××××××.edu>
1110
1111 rename espf to esp and change espf-patchset to piepatchset
1112
1113 0.3.9 Magnus Granberg <zorry@g.o>
1114
1115 * gcc/configure Added check for TLS on the target in the SSP check.
1116
1117 #149292 b.g.o
1118 * gcc/config/i386/linux.h Removed uclibc don't support TLS on stack-protector
1119 * gcc/config/i386/linux64.h Removed uclibc don't support TLS on stack-protector
1120 * gcc/config/rs6000/linux.h Removed uclibc don't support TLS on stack-protector
1121 * gcc/config/i386/linux.h Removed uclibc don't support TLS on stack-protector
1122 * gcc/config/sparc/linux.h Removed uclibc don't support TLS on stack-protector
1123 * gcc/config/sparc/linux64.h Removed uclibc don't support TLS on stack-protector
1124
1125 0.3.8 Magnus Granberg <zorry@g.o>
1126
1127 * gcc/configure Redone the -fstack-protector check.
1128 * gcc/config.in Added HAVE_GCC_SSP
1129 * gcc/gcc.c Removed code for espf_link_spec in X
1130 * gcc/espf.h Added ifdef HAVE_GCC_SSP, change code for espf_link_spec and link_pie_spec
1131
1132 0.3.7_beta Anthony G. Basile <basile@××××××××××××××.edu>
1133
1134 * gcc/configure Check if -fstack-protector is supported by gcc on ARCH
1135 Updated AC_SUBST enable_espf
1136 * gcc/Makefile.in Remove the fix for $(out_object_file): ix86_split_to_parts() stack smashing attack b.g.o #149292.
1137 * gcc/gcc.c Updaded the .c .cc compiler specs.
1138
1139 0.3.6 Magnus Granberg <zorry@×××.nu>
1140
1141 * configure Check --enable-espf change ppc* to powerpc*, powerpc64 and add ia64.
1142 * gcc/configure Don't check for -z,relro on ia64. Disable crtbeginTS for ia64.
1143 * gcc/espf.h ia64 don't support -fstack-protector*
1144
1145 0.3.5 Maguns Granberg <zorry@×××.nu>
1146
1147 * gcc/espf.h Change the specs for crtbegin.TS.o.
1148 * gcc/gcc.c Rename espf_cc1_options to espf_options_pie_check.
1149 * gcc/config/linux.h Fix typos ENABLE_CRTBEGINS to ENABLE_CRTBEGINTS
1150 * gcc/config/rs6000/linux64.h ASM_SPEC32: %{fpic:-K PIC} %{fPIC:-K PIC} to
1151 %{fpic|fPIC|fpie|fPIE:-K PIC}
1152
1153 0.3.4 Magnus Granberg <zorry@×××.nu>
1154
1155 * gcc/configure Add crtbeginTS.o support.
1156 * gcc/Makefile.in Add crtbeginTS.o support.
1157 * gcc/gcc.c Add espf_cc1_options.
1158 * gcc/espf.h Added espf_cc1_options, crtbeginTS.o support,
1159 espf_cc1_options and espf_cc1_strictoverflow.
1160 * gcc/config.in Add crtbeginTS.o support.
1161 * gcc/config/linux.h Add crtbeginTS.o support.
1162 * gcc/config/rs6000/sysv4.h Add crtbeginTS.o support.
1163 * gcc/doc/invoke.texi Add NOTES about -fstack-protector-all,
1164 -pie and -fPIE.
1165 * libgcc/Makefile.in Add crtbeginTS.o support.
1166
1167 0.3.3 Magnus Granberg <zorry@×××.nu>
1168
1169 * gcc/opts.c change #ifdef ENABLE_ESPF to #ifndef ENABLE_ESPF
1170
1171 0.3.2 Magnus Granberg <zorry@×××.nu>
1172
1173 * gcc/opts.c disable flag_delete_null_pointer_checks >= -O2
1174 * gcc/espf.h add ESPF_CC1_SSP_SPEC and ESPF_CC1_PIE_SPEC to fix bugs on -vanilla spec
1175
1176 #149292 b.g.o
1177 * gcc/config/i386/linux.h uclibc don't support TLS on stack-protector
1178 * gcc/config/i386/linux64.h uclibc don't support TLS on stack-protector
1179 * gcc/config/rs6000/linux.h uclibc don't support TLS on stack-protector
1180 * gcc/config/i386/linux.h uclibc don't support TLS on stack-protector
1181 * gcc/config/sparc/linux.h uclibc don't support TLS on stack-protector
1182 * gcc/config/sparc/linux64.h uclibc don't support TLS on stack-protector
1183
1184 0.3.1 Magnus Granberg <zorry@×××.nu>
1185
1186 * gcc/cp/Make-lang.in cc1plus: pch test fail when cc1plus is compile with -fPIE.
1187 * gcc/configure fix --enable-espf when USE"-hardened"
1188
1189 4.4.1-espf-0.3.0 Magnus Granberg <zorry@×××.nu>
1190
1191 * gcc/espf.h add ESPF_LINK_SPEC ESPF_LINK_NOW_SPEC
1192 * gcc/gcc.c move do_self_spec (espf_command_options_spec)
1193 do_spec_1() add espf_link_spec
1194
1195 0.3.0 Magnus Granberg <zorry@×××.nu>
1196
1197 * gcc/objc/lang-specs.h Add %(espf_options)
1198 * gcc/objcp/lang-specs.h Add %(espf_options)
1199 * gcc/cp/lang-specs.h Add %(espf_options)
1200 * gcc/config.in removed ENABLE_LIBSSP
1201 * Makefile.in We add -fno-stack-protector to
1202 BOOT_CFLAGS, LIBCFLAGS and LIBCXXFLAGS
1203 cc1: pch.exp test fail when cc1 is compile with -fPIE
1204 * libmudflap/Makefiles.in Add -fno-stack-protector -U_FORTIFY_SOURCE
1205 to AM_CFLAGS
1206 * configure add --enable-espf
1207 add -fno-stack-protector to stage1_cflags
1208 add targes ppc* arm sparc*
1209 * gcc/configure change code for check --enable-espf
1210 * libmudflap/configure add enable_espf
1211 * gcc/espf.h ESPF_CC1_OPTIONS_SPEC renamed to ESPF_OPTIONS_SPEC
1212 add ESPF_CPP_OPTIONS_SPEC ESPF_COMMAND_OPTIONS_SPEC
1213 ESPF_CC1_OPTIONS_SSP_SPEC renamed to ESPF_OPTIONS_SSP_SPEC
1214 ESPF_COMPILER_COMMAND_PIE_SPEC renamed to ESPF_OPTIONS_PIE_SPEC
1215 ESPF_LINK_COMMAND_PIE_SPEC renamed to ESPF_LINK_PIE_SPEC
1216 add !p !pg to ESPF_LINK_PIE_SPEC
1217 removed ESPF_LINK_SPEC ESPF_CC1_OPTIONS_PIE_INCOMPATIBLE_SPEC
1218 * gcc/gcc.c cpp_options add %(espf_cpp_options)
1219 compiler spec add %(espf_options)
1220 change code for ESPF_EXTRA_SPECS
1221 process_command(): Check for lazy, or now
1222 do_spec_1(): Add -z now and -z relro
1223 main() add do_self_spec (espf_command_options_spec)
1224 removed do_self_spec (espf_cc1_command_spec) do_self_spec (espf_link_command_spec)
1225
1226 0.2.9 Magnus Granberg <zorry@×××.nu>
1227
1228 * gcc/espf.h add ESPF_COMPILER_COMMAND_PIE_SPEC
1229 add ESPF_LINK_COMMAND_PIE_SPEC
1230 change ESPF_COMPILER_COMMAND_SPEC ESPF_LINK_COMMAND_SPEC
1231
1232 0.2.8 Magnus Granberg <zorry@×××.nu>
1233
1234 * gcc/configure removed check crtbeginTS.o
1235 * gcc/espf.h added notes
1236 add ESPF_CC1_SPEC
1237 removed ESPF_CPP_UNIQUE_OPTIONS espf_override_options()
1238 * gcc/gcc.c cc1_spec Set it to CC1_SPEC if ! ENABLE_ESPF
1239 * gcc/toplev.c removed ESPF_OVERRIDE_OPTIONS
1240
1241 0.2.7 Magnus Granberg <zorry@×××.nu>
1242
1243 * gcc/opts.c (decode_options): Remove flag_strict_overflow as opt2
1244 * gcc/config.in removed HAVE_CRTBEGINTS
1245 * gcc/Makefile removed crtbeginTS.o
1246 * libgcc/Makefile.in removed crtbeginTS.o
1247 * gcc/config/i386/i386.h removed espf_override_options ESPF_EXTRA_SPECS
1248 * gcc/config/linux.h remoevd crtbeginTS.o
1249 * gcc/espf.h ESPF_CC1_OPTIONS_PIE_SPEC renamed to ESPF_CC1_COMMAND_SPEC
1250 * gcc/gcc.c add ESPF_EXTRA_SPECS
1251 main() add do_self_spec (espf_cc1_command_spec)
1252
1253 0.2.6 Magnus Granberg <zorry@×××.nu>
1254
1255 * gcc/config/i386/i386.h add espf_override_options() to OVERRIDE_OPTIONS
1256 * gcc/espf.h add espf_override_options()
1257 * gcc/toplev.c add ESPF_OVERRIDE_OPTIONS
1258
1259 0.2.5 Magnus Granberg <zorry@×××.nu>
1260
1261 * gcc/config/i386/i386.h removed espf_cc1
1262 * gcc/config/i386/linux.h removed espf_cc1 %(crtend_gen)
1263 * gcc/config/i386/x86-64.h removed espf_cc1 %(crtend_gen)
1264 * gcc/config/linux.h removed espf_cc1 %(crtfile_gen)
1265 %(crtbegin_t_gen) %(crtend_gen)
1266 add crtbeginTS.o
1267 * gcc/config.in removed TARGET_LIBC_PROVIDES_PIE
1268 add HAVE_CRTBEGINTS
1269 * gcc/Makefile.in add ESPF_NOPIE_CFLAGS ESPF_NOSSP_CFLAGS to
1270 CRTSTUFF_T_CFLAGS
1271 add ESPF_NOSSP_CFLAGS to CRTSTUFF_T_CFLAGS_S
1272 * espf.h ESPF_CC1_SPEC renamed to ESPF_CC1_OPTIONS_SPEC
1273 add ESPF_LINK_SPEC
1274 ESPF_CC1_SSP_SPEC renamed to ESPF_CC1_OPTIONS_SSP_SPEC
1275 ESPF_CC1_PIE_SPEC renamed to ESPF_CC1_OPTIONS_PIE_SPEC
1276 ESPF_CC1_OPTIONS_SPEC renamed to ESPF_CC1_OPTIONS_PIE_INCOMPATIBLE_SPEC
1277 LINK_PIE_SPEC renamed to ESPF_LINK_COMMAND_SPEC
1278 removed ESPF_CC1_STRICT_SPEC CRTFILE_GEN_SPEC CRTBEGIN_GEN_SPEC
1279 CRTBEGIN_T_GEN_SPEC CRTEND_GEN_SPEC
1280 * gcc/configure remove TARGET_LIBC_PROVIDES_PIE
1281 define HAVE_CRTBEGINTS
1282 * gcc/gcc.c LINK_COMMAND_SPEC add %(espf_link)
1283 main() add do_self_spec (espf_link_command_spec)
1284
1285 0.2.4 Magnus Granberg <zorry@×××.nu>
1286
1287 libgcc/Makefile.in clean specs
1288
1289 0.2.3 Magnus Granberg <zorry@×××.nu>
1290
1291 *gcc/espf.h add ESPF_CC1_STRICT_SPEC
1292
1293 0.2.2 Magnus Granberg <zorry@×××.nu>
1294
1295 * gcc/config/i386/i386.h Add espf_cc1
1296 Add ESPF_EXTRA_SPECS
1297 * gcc/config/i386/linux.h Add espf_cc1
1298 * gcc/config/i386/x86-64.h Add espf_cc1
1299 * gcc/config/linux.h Add espf_cc1
1300 * gcc/Makefile.in add crtbeginTS.o to EXTRA_PARTS list
1301 * libgcc/Makefile.in add crtbeginTS.o to EXTRA_PARTS list
1302 * gcc/configure add define ENABLE_LIBSSP
1303 * gcc/gcc.c %(fortify_default) renamed to %(espf_cpp_unique_options)
1304 %(pie_incompatible) renamed to %(espf_cc1_options)
1305 removed ESPF_EXTRA_SPECS
1306 * gcc/espf.h ESPF_DEFAULT_SPEC renamed to ESPF_CC1_SPEC
1307 SSP_DEFAULT_SPEC renamed to ESPF_CC1_SSP_SPEC
1308 FORTIFY_DEFAULT_SPEC renamed to ESPF_CPP_UNIQUE_OPTIONS
1309 PIE_DEFAULT_SPEC renamed to ESPF_CC1_PIE_SPEC
1310 PIE_INCOMPATIBLE_SPEC renamed to ESPF_CC1_OPTIONS_SPEC
1311 add new CRTFILE_GEN_SPEC CRTBEGIN_T_GEN_SPEC CRTEND_GEN_SPEC if !
1312 TARGET_LIBC_PROVIDES_PIE
1313
1314 4.4.0-espf-0.2.1 Magnus Granberg <zorry@×××.nu>
1315
1316 * gcc/gcc.c include: espf.h
1317 cc1_spec = CC1_SPEC if not ENABLE_ESPF
1318 cpp_unique_options add %(fortify_default)
1319 cc1_options add %(pie_incompatible)
1320 EXTRA_SPECS add ESPF_EXTRA_SPECS
1321 * libgcc/Makefile.in add crtbeginTs.o
1322 gcc/Makefile.in add ESPF_NOPIE_CFLAGS and ESPF_NOSSP_CFLAGS
1323 LIBGCC2_CFLAGS add ESPF_NOSSP_CFLAGS
1324 CRTSTUFF_CFLAGS add ESPF_NOPIE_CFLAGS and ESPF_NOSSP_CFLAGS
1325 crtbegin* add crtbeginTS
1326 $(out_object_file): ix86_split_to_parts() stack smashing attack b.g.o #149292
1327 * libgcc/configure add enable_espf
1328 * gcc/config/linux.h add %(crtfile_gen) %(crtbegin_t_gen) %(crtend_gen)
1329 * gcc/config/i386/linux.h add %(crtend_gen)
1330 * gcc/config/i386/linux64.h add %(crtend_gen)
1331 * gcc/config.gcc extra_parts add crtbeginTS.o
1332 * libgcc/config.host extra_parts add crtbeginTS.o
1333 * gcc/configure check -z relro
1334 check -z now
1335 check FORTIFY_SOURCES level 2
1336 check Scrt1.o
1337 check --enable-espf
1338 check crtbeginTS.o
1339 * gcc/espf.h new file
1340 * gcc/varasm.c (decl_tls_model): Check flag_pic instead of flag_shlib
1341 * gcc/config.in add ENABLE_LIBSSP
1342 add ENABLE_ESPF
1343 add TARGET_LIBC_PROVIDES_FORTIFY2
1344 add TARGET_LIBC_PROVIDES_PIE
1345 * configure define ENABLE_LIBSSP
1346
1347 gcc-4.3.3-piepatches-v10.2.1
1348
1349
1350
1351 1.1 src/patchsets/gcc/4.6.1/pie/README.Gentoo.patches
1352
1353 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/README.Gentoo.patches?rev=1.1&view=markup
1354 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/README.Gentoo.patches?rev=1.1&content-type=text/plain
1355
1356 Index: README.Gentoo.patches
1357 ===================================================================
1358 ================
1359 === W[hat]TF ===
1360 ================
1361
1362 Gentoo patchsets that have grown too large to keep on the rsync mirrors have
1363 been moved to our git tree. From there, we bundle up all the whee little
1364 patches into a tarball and distribute it via our public mirroring system.
1365
1366 If you want specific info about a patch (like wtf it does or whose great idea
1367 it was to change the code), read the patch ! We try to fill out the top of
1368 them with useful info such as what it does, why it's needed, bug reports,
1369 original creators, etc... For simple patches, we reserve the right to assume
1370 your IQ is greater than absolute 0 and figure out what it does w/out an
1371 explanation. If, by some miracle of science, it falls below the absolute 0
1372 mark, you should help mankind by finding some scientists and letting them
1373 probe you with their ... erm ... probes.
1374
1375 =================
1376 === W[here]TF ===
1377 =================
1378
1379 For those with git access
1380 git://git.overlays.gentoo.org/proj/hardened-gccpatchset.git
1381
1382 For those w/out git access, this URL should help you:
1383 http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-gccpatchset.git;a=summary
1384
1385 It should be pretty easy to find your way around, you're a big boy after all.
1386
1387
1388
1389 1.1 src/patchsets/gcc/4.6.1/pie/README.history
1390
1391 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/README.history?rev=1.1&view=markup
1392 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.6.1/pie/README.history?rev=1.1&content-type=text/plain
1393
1394 Index: README.history
1395 ===================================================================
1396 0.4.8 26-03-2011
1397 U 22_all_gcc46-default-ssp.patch
1398 0.4.7 05-03-2011
1399 U 20_all_gcc46_gcc.c.patch
1400 + 22_all_gcc46-default-ssp.patch
1401 - 30_all_gcc46_esp.h.patch
1402 + 30_all_gcc44_esp.h.patch
1403 U 33_all_gcc46_config_rs6000_linux64.h.patch
1404 U 35_all_gcc44_config_crtbegints.patch
1405 0.4.6 07-01-2011
1406 + 12_all_gcc46_Makefile.in.patch
1407 - 12_all_gcc44_Makefile.in.patch
1408 + 20_all_gcc46_gcc.c.patch
1409 - 20_all_gcc44_gcc.c.patch
1410 + 30_all_gcc46_esp.h.patch
1411 - 30_all_gcc44_esp.h.patch
1412 + 33_all_gcc46_config_rs6000_linux64.h.patch
1413 - 33_all_gcc45_config_rs6000_linux64.h.patch
1414 + 35_all_gcc46_config_crtbegints.patch
1415 - 35_all_gcc44_config_crtbegints.patch
1416 - 40_all_gcc44_obj_lang-specs.h.patch
1417 - 40_all_gcc44_objp_lang-specs.h.patch
1418 - 40_all_gcc44_cp_lang-specs.h.patch
1419 0.4.5 18-06-2010
1420 U 35_all_gcc44_config_crtbegints.patch
1421 0.4.4 26-05-2010
1422 U 30_all_gcc44_esp.h.patch
1423 0.4.3 26-05-2010
1424 U 20_all_gcc44_gcc.c.patch
1425 U 30_all_gcc44_esp.h.patch
1426 0.4.2 24-05-2010
1427 U 10_all_gcc44_configure.patch
1428 U 12_all_gcc44_Makefile.in.patch
1429 U 11_all_gcc44_config.in.patch
1430 U 30_all_gcc44_esp.h.patch
1431 0.4.1 29-04-2010
1432 U 10_all_gcc45_configure.patch
1433 U 12_all_gcc45_Makefile.in.patch
1434 U 11_all_gcc44_config.in.patch
1435 U 30_all_gcc44_esp.h.patch
1436
1437 0.4.0 19-04-2010
1438 U 10_all_gcc45_configure.patch
1439 U 12_all_gcc45_Makefile.in.patch
1440 U 11_all_gcc44_config.in.patch
1441 U 20_all_gcc45_gcc.c.patch
1442 - 30_all_gcc44_espf.h.patch
1443 + 30_all_gcc44_esp.h.patch
1444
1445 0.3.9 14-04-2010
1446 U 10_all_gcc45_configure.patch
1447 - 50_all_gcc44_no_ssp_tls_uclibc.patch
1448 U 33_all_gcc45_config_rs6000_linux64.h.patch
1449
1450 0.3.8 10-04-2010
1451 10_all_gcc44_configure.patch
1452 11_all_gcc44_config.in.patch
1453 20_all_gcc44_gcc.c.patch
1454 30_all_gcc44_espf.h.patch
1455
1456 0.3.7 10-02-2010
1457 20_all_gcc44_gcc.c.patch
1458 30_all_gcc44_espf.h.patch
1459 10_all_gcc44_configure.patch
1460
1461 0.3.6 23-12-2009
1462 - 10_all_gcc44_configure.patch
1463 + 10_all_gcc44_configure.patch
1464 - 30_all_gcc44_espf.h.patch
1465 + 30_all_gcc44_espf.h.patch
1466 - README.Changelog
1467 + README.Changelog
1468 - README.history
1469 + README.history
1470 - README
1471 + README
1472
1473 0.3.5 24-09-2009
1474 - 30_all_gcc44_espf.h.patch
1475 + 30_all_gcc44_espf.h.patch
1476 - 35_all_gcc44_config_crtbegints.patch
1477 + 35_all_gcc44_config_crtbegints.patch
1478 + 33_all_gcc44_config_rs6000_linux64.h.patch
1479 - README.Changelog
1480 + README.Changelog
1481 - README.history
1482 + README.history
1483 + README.Gentoo.patches
1484
1485 0.3.4 11-09-2009
1486 - 10_all_gcc44_configure.patch
1487 + 10_all_gcc44_configure.patch
1488 - 11_all_gcc44_config.in.patch
1489 + 11_all_gcc44_config.in.patch
1490 - 12_all_gcc44_Makefile.in.patch
1491 + 12_all_gcc44_Makefile.in.patch
1492 - 20_all_gcc44_gcc.c.patch
1493 + 20_all_gcc44_gcc.c.patch
1494 - 23_all_gcc44_opts.c.patch
1495 - 30_all_gcc44_espf.h.patch
1496 + 30_all_gcc44_espf.h.patch
1497 + 35_all_gcc44_config_crtbegints.patch
1498 + 60_all_gcc44_invoke.texi.patch
1499 - README.Changelog
1500 + README.Changelog
1501 - README.history
1502 + README.history
1503 - README
1504 + README
1505
1506 0.3.3 14-08-2009
1507 - 23_all_gcc44_opts.c.patch
1508 + 23_all_gcc44_opts.c.patch
1509
1510 0.3.2 09-08-2009
1511 + 50_all_gcc44_no_ssp_tls_uclibc.patch
1512 + README.Changelog
1513 + README.history
1514 - 23_all_gcc44_opts.c.patch
1515 + 23_all_gcc44_opts.c.patch
1516 - 30_all_gcc44-espf.h.patch
1517 + 30_all_gcc44-espf.h.patch
1518
1519 0.3.1 23-07-2009
1520 - 10_all_gcc44_configure.patch
1521 + 10_all_gcc44_configure.patch
1522
1523 0.3.0 23-07-2009
1524 - 10_all_gcc44_configure.patch
1525 + 10_all_gcc44_configure.patch
1526 - 11_all_gcc44_config.in.patch
1527 + 11_all_gcc44_config.in.patch
1528 - 12_all_gcc44_Makefile.in.patch
1529 + 12_all_gcc44_Makefile.in.patch
1530 - 20_all_gcc44_gcc.c.patch
1531 + 20_all_gcc44_gcc.c.patch
1532 + 40_all_gcc44_obj_lang-specs.h.patch
1533 + 40_all_gcc44_objp_lang-specs.h.patch
1534 + 40_all_gcc44_cp_lang-specs.h.patch
1535 - 50_all_gcc44_gentoo_v20090614.1.patch
1536 - 30_all_gcc44-espf.h.patch
1537 + 30_all_gcc44-espf.h.patch
1538
1539 0.2.9 14-06-2009
1540 - 12_all_gcc44_Makefile.in.patch
1541 + 12_all_gcc44_Makefile.in.patch
1542 - 30_all_gcc44-espf.h.patch
1543 + 30_all_gcc44-espf.h.patch
1544 - 50_all_gcc44_gentoo_v20090612.2.patch
1545 + 50_all_gcc44_gentoo_v20090614.1.patch
1546
1547 0.2.8 12-06-2009
1548 - 10_all_gcc44_configure.patch
1549 + 10_all_gcc44_configure.patch
1550 - 11_all_gcc44_config.in.patch
1551 + 11_all_gcc44_config.in.patch
1552 - 12_all_gcc44_Makefile.in.patch
1553 + 12_all_gcc44_Makefile.in.patch
1554 - 22_all_gcc44-toplev.c.patch
1555 - 25_all_gcc44-espf.h.patch
1556 + 30_all_gcc44-espf.h.patch
1557 + 50_all_gcc44_gentoo_v20090612.2.patch
1558
1559 0.2.7 29-05-2009
1560 - 11_all_gcc44_config.in.patch
1561 + 11_all_gcc44_config.in.patch
1562 - 12_all_gcc44_Makefile.in.patch
1563 + 12_all_gcc44_Makefile.in.patch
1564 - 20_all_gcc44_gcc.c.patch
1565 + 20_all_gcc44_gcc.c.patch
1566 + 23_all_gcc44_opts.c.patch
1567 - 25_all_gcc44-espf.h.patch
1568 + 25_all_gcc44-espf.h.patch
1569 - 30_all_gcc44-config-defaul-linux.patch
1570
1571 0.2.6 28-05-2009
1572 + 22_all_gcc44-toplev.c.patch
1573 - 25_all_gcc44-espf.h.patch
1574 + 25_all_gcc44-espf.h.patch
1575 - 30_all_gcc44-config-defaul-linux.patch
1576 + 30_all_gcc44-config-defaul-linux.patch
1577
1578 0.2.5 27-05-2009
1579 - 10_all_gcc44_configure.patch
1580 + 10_all_gcc44_configure.patch
1581 - 12_all_gcc44_Makefile.in.patch
1582 + 12_all_gcc44_Makefile.in.patch
1583 - 20_all_gcc44_gcc.c.patch
1584 + 20_all_gcc44_gcc.c.patch
1585 - 25_all_gcc44-espf.h.patch
1586 + 25_all_gcc44-espf.h.patch
1587 - 30_all_gcc44-config-defaul-linux.patch
1588 + 30_all_gcc44-config-defaul-linux.patch
1589 - 40_all_gcc44-gentoo.patch
1590
1591 0.2.4 08-05-2009
1592 - 12_all_gcc44_Makefile.in.patch
1593 + 12_all_gcc44_Makefile.in.patch
1594
1595 0.2.3 08-05-2009
1596 - 20_all_gcc44_gcc.c.patch
1597 + 20_all_gcc44_gcc.c.patch
1598 - 40_all_gcc44-gentoo.patch
1599 + 40_all_gcc44-gentoo.patch
1600
1601 0.2.2 04-05-2009
1602 + 10_all_gcc44_configure.patch
1603 + 11_all_gcc44_config.in.patch
1604 + 12_all_gcc44_Makefile.in.patch
1605 + 20_all_gcc44_gcc.c.patch
1606 + 21_all_gcc44_decl-tls-model.patch
1607 + 25_all_gcc44-espf.h.patch
1608 + 30_all_gcc44-config-defaul-linux.patch
1609 + 40_all_gcc44-gentoo.patch
1610 - 01_all_gcc44-configure.patch
1611 - 10_all_gcc44-gcc_configure.patch
1612 - 11_all_gcc44-gcc_config.in.patch
1613 - 12_all_gcc44-gcc_config.gcc.patch
1614 - 13_all_gcc44-gcc_Makefile.in.patch
1615 - 15_all_gcc44-libgcc_config.host.patch
1616 - 16_all_gcc44-libgcc_configure.patch
1617 - 17_all_gcc44-libgcc_Makefile.in.patch
1618 - 21_all_gcc44-gcc_espf.h.patch
1619 - 22_all_gcc44-gcc_gcc.c.patch
1620 - 23_all_gcc44-gcc_varasm.c.patch
1621 - 30_all_gcc44-add-crt-start-endfiles-linux.patch
1622
1623 0.2.1 28-04-2009
1624 + 01_all_gcc44-configure.patch
1625 + 10_all_gcc44-gcc_configure.patch
1626 + 11_all_gcc44-gcc_config.in.patch
1627 + 12_all_gcc44-gcc_config.gcc.patch
1628 + 13_all_gcc44-gcc_Makefile.in.patch
1629 + 15_all_gcc44-libgcc_config.host.patch
1630 + 16_all_gcc44-libgcc_configure.patch
1631 + 17_all_gcc44-libgcc_Makefile.in.patch
1632 + 21_all_gcc44-gcc_espf.h.patch
1633 + 22_all_gcc44-gcc_gcc.c.patch
1634 + 23_all_gcc44-gcc_varasm.c.patch
1635 + 30_all_gcc44-add-crt-start-endfiles-linux.patch
1636 - 00_all_gcc4.4-cvs-incompat.patch
1637 - 05_all_gcc4.4-compile-no-ssp.patch
1638 - 10_all_gcc4.4-hardened-minispecs-support.patch
1639 - 11_all_gcc4.4-decl-tls-model.patch
1640 - 12_all_gcc4.4-fortify-minispecs-support.patch
1641 - 20-all_gcc4.4-default-crt-start-endfile.patch
1642 - 30-all_gcc4.4-crtbeginTS-fno-PIE.patch
1643
1644 0.1.0 16.04.2009
1645 + 00_all_gcc4.4-cvs-incompat.patch
1646 + 05_all_gcc4.4-compile-no-ssp.patch
1647 + 10_all_gcc4.4-hardened-minispecs-support.patch
1648 + 11_all_gcc4.4-decl-tls-model.patch
1649 + 12_all_gcc4.4-fortify-minispecs-support.patch
1650 + 20-all_gcc4.4-default-crt-start-endfile.patch
1651 + 30-all_gcc4.4-crtbeginTS-fno-PIE.patch