Gentoo Archives: gentoo-commits

From: "Anthony G. Basile (blueness)" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/gcc/4.8.5/pie: 01_all_gcc48_configure.patch 02_all_gcc48_config.in.patch 03_all_gcc48_Makefile.in.patch 05_all_gcc48_gcc.c.patch 16_all_gcc47_nopie_option.patch 20_all_gcc46_config_crtbeginp.patch 24_all_gcc48_invoke.texi.patch 33_all_gcc48_config_rs6000.patch 34_all_gcc48_config_i386.patch 35_all_gcc48_config_arm.patch 36_all_gcc48_config_mips.patch 37_all_gcc48_config_ia64.patch 40_all_gcc48_config_esp.patch README README.Changelog README.history
Date: Wed, 24 Jun 2015 13:39:25
Message-Id: 20150624133851.A04BBA54@oystercatcher.gentoo.org
1 blueness 15/06/24 13:38:51
2
3 Added: 01_all_gcc48_configure.patch
4 02_all_gcc48_config.in.patch
5 03_all_gcc48_Makefile.in.patch
6 05_all_gcc48_gcc.c.patch
7 16_all_gcc47_nopie_option.patch
8 20_all_gcc46_config_crtbeginp.patch
9 24_all_gcc48_invoke.texi.patch
10 33_all_gcc48_config_rs6000.patch
11 34_all_gcc48_config_i386.patch
12 35_all_gcc48_config_arm.patch
13 36_all_gcc48_config_mips.patch
14 37_all_gcc48_config_ia64.patch
15 40_all_gcc48_config_esp.patch README
16 README.Changelog README.history
17 Log:
18 intial 4.8.5 patchset based on 4.8.4. bug #553144.
19
20 Revision Changes Path
21 1.1 src/patchsets/gcc/4.8.5/pie/01_all_gcc48_configure.patch
22
23 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/01_all_gcc48_configure.patch?rev=1.1&view=markup
24 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/01_all_gcc48_configure.patch?rev=1.1&content-type=text/plain
25
26 Index: 01_all_gcc48_configure.patch
27 ===================================================================
28 2013-12-30 Magnus Granberg <zorry@g.o>
29
30 * gcc/configure.ac Add --enable-esp and define ENABLE_ESP.
31 Check if we support crtbeginP and define ENABLE_CRTBEGINP.
32 * gcc/configure Regenerated
33
34
35 --- a/gcc/configure.ac 2011-11-18 11:52:32.000000000 +0100
36 +++ b/gcc/configure.ac 2012-10-02 17:39:15.649526241 +0200
37 @@ -5130,6 +5237,55 @@ if test x"${LINKER_HASH_STYLE}" != x; th
38 [The linker hash style])
39 fi
40
41 +# --------------
42 +# Esp checks
43 +# --------------
44 +
45 +# Check whether --enable-esp was given and target have the support.
46 +AC_ARG_ENABLE([esp],
47 +[AS_HELP_STRING([--enable-esp],
48 + [Enable Stack protector and Position independent executable as
49 + default if we have suppot for it when compiling
50 + and link with -z now as default.
51 + Linux targets supported i*86, x86_64, x32,
52 + powerpc, powerpc64, ia64, arm and mips.])],
53 + enable_esp=$enableval,
54 + enable_esp=no)
55 +if test $enable_esp = yes ; then
56 + AC_MSG_CHECKING(if $target support esp)
57 + case "$target" in
58 + i?86*-*-linux* | x86_64-*-linux* | powerpc*-*-linux* | mips-*-linux* | arm*-*-linux* | ia64-*-linux*)
59 + enable_esp=yes
60 + AC_DEFINE(ENABLE_ESP, 1,
61 + [Define if your target support esp and you have enable it.])
62 + ;;
63 + *)
64 + enable_esp=no
65 + ;;
66 + esac
67 +AC_MSG_RESULT($enable_esp)
68 +fi
69 +AC_SUBST([enable_esp])
70 +if test $enable_esp = yes ; then
71 + AC_MSG_CHECKING(checking for crtbeginP.o support)
72 + if test x$enable_esp = xyes ; then
73 + case "$target" in
74 + ia64*-*-linux*)
75 + enable_crtbeginP=no ;;
76 + *-*-linux*)
77 + if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then
78 + enable_crtbeginP=yes
79 + AC_DEFINE(ENABLE_CRTBEGINP, 1,
80 + [Define if your compiler will support crtbeginP.])
81 + fi
82 + ;;
83 + *) enable_crtbeginP=no ;;
84 + esac
85 + fi
86 + AC_MSG_RESULT($enable_crtbeginP)
87 +fi
88 +AC_SUBST([enable_crtbeginP])
89 +
90 # Configure the subdirectories
91 # AC_CONFIG_SUBDIRS($subdirs)
92
93 --- a/gcc/configure 2013-02-01 21:26:24.000000000 +0100
94 +++ b/gcc/configure 2013-02-12 01:59:20.000000000 +0100
95 @@ -600,6 +600,8 @@
96
97 ac_subst_vars='LTLIBOBJS
98 LIBOBJS
99 +enable_crtbeginP
100 +enable_esp
101 enable_plugin
102 pluginlibs
103 CLOOGINC
104 @@ -920,6 +922,7 @@
105 enable_plugin
106 enable_libquadmath_support
107 with_linker_hash_style
108 +enable_esp
109 '
110 ac_precious_vars='build_alias
111 host_alias
112 @@ -1633,6 +1636,11 @@
113 --enable-plugin enable plugin support
114 --disable-libquadmath-support
115 disable libquadmath support for Fortran
116 + --enable-esp Enable Stack protector and Position independent
117 + executable as default if we have suppot for it when
118 + compiling and link with -z now as default.
119 + Linux targets supported i*86, x86_64, x32,
120 + powerpc, powerpc64, ia64, arm and mips.
121
122 Optional Packages:
123 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
124 @@ -27419,6 +27427,59 @@
125
126 fi
127
128 +# --------------
129 +# Esp checks
130 +# --------------
131 +
132 +# Check whether --enable-esp was given and target have the support.
133 +# Check whether --enable-esp was given.
134 +if test "${enable_esp+set}" = set; then :
135 + enableval=$enable_esp; enable_esp=$enableval
136 +else
137 + enable_esp=no
138 +fi
139 +
140 +if test $enable_esp = yes ; then
141 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $target support esp" >&5
142 +$as_echo_n "checking if $target support esp... " >&6; }
143 + case "$target" in
144 + i?86*-*-linux* | x86_64-*-linux* | powerpc*-*-linux* | mips*-*-linux* | arm*-*-linux* | ia64-*-linux*)
145 + enable_esp=yes
146 +
147 +$as_echo "#define ENABLE_ESP 1" >>confdefs.h
148 +
149 + ;;
150 + *)
151 + enable_esp=no
152 + ;;
153 + esac
154 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_esp" >&5
155 +$as_echo "$enable_esp" >&6; }
156 +fi
157 +
158 +if test $enable_esp = yes ; then
159 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking checking for crtbeginP.o support" >&5
160 +$as_echo_n "checking checking for crtbeginP.o support... " >&6; }
161 + if test x$enable_esp = xyes ; then
162 + case "$target" in
163 + ia64*-*-linux*)
164 + enable_crtbeginP=no ;;
165 + *-*-linux*)
166 + if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then
167 + enable_crtbeginP=yes
168 +
169 +$as_echo "#define ENABLE_CRTBEGINP 1" >>confdefs.h
170 +
171 + fi
172 + ;;
173 + *) enable_crtbeginP=no ;;
174 + esac
175 + fi
176 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_crtbeginP" >&5
177 +$as_echo "$enable_crtbeginP" >&6; }
178 +fi
179 +
180 +
181 # Configure the subdirectories
182 # AC_CONFIG_SUBDIRS($subdirs)
183
184
185
186
187 1.1 src/patchsets/gcc/4.8.5/pie/02_all_gcc48_config.in.patch
188
189 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/02_all_gcc48_config.in.patch?rev=1.1&view=markup
190 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/02_all_gcc48_config.in.patch?rev=1.1&content-type=text/plain
191
192 Index: 02_all_gcc48_config.in.patch
193 ===================================================================
194 2013-02-13 Magnus Granberg <zorry@g.o>
195
196 * gcc/config.in Add ENABLE_CRTBEGINP, ENABLE_ESP
197
198 --- gcc/config.in 2009-04-21 11:08:08.000000000 +0200
199 +++ gcc/config.in 2009-05-12 00:10:08.000000000 +0200
200 @@ -46,6 +46,12 @@
201 #endif
202
203
204 +/* Define to 1 to enable crtbeginP.o. */
205 +#ifndef USED_FOR_TARGET
206 +#undef ENABLE_CRTBEGINP
207 +#endif
208 +
209 +
210 /* Define to 1 to specify that we are using the BID decimal floating point
211 format instead of DPD */
212 #ifndef USED_FOR_TARGET
213 @@ -65,6 +65,12 @@
214 #endif
215
216
217 +/* Define to 1 to enable esp. */
218 +#ifndef USED_FOR_TARGET
219 +#undef ENABLE_ESP
220 +#endif
221 +
222 +
223 /* Define to 1 to enable fixed-point arithmetic extension to C. */
224 #ifndef USED_FOR_TARGET
225 #undef ENABLE_FIXED_POINT
226
227
228
229 1.1 src/patchsets/gcc/4.8.5/pie/03_all_gcc48_Makefile.in.patch
230
231 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/03_all_gcc48_Makefile.in.patch?rev=1.1&view=markup
232 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/03_all_gcc48_Makefile.in.patch?rev=1.1&content-type=text/plain
233
234 Index: 03_all_gcc48_Makefile.in.patch
235 ===================================================================
236 2012-01-17 Magnus Granberg <zorry@g.o>
237
238 * gcc/Makefile.in Add -fno-PIE. to ALL_CFLAGS and
239 ALL_CXXFLAGS if enable_esp yes.
240 Echo enable_esp and enable_crtbeginP to tmp-libgcc.mvars.
241 * libgcc/Makefile.in Add crtbeginP.o to EXTRA_PARTS if enable_crtbeginP yes
242 We add new file crtbeginP.o if enable_crtbeginP yes
243 Add -fno-PIE. to CRTSTUFF_CFLAGS.
244 Disable -fstack-check
245
246 --- a/gcc/Makefile.in 2011-11-09 02:20:14.000000000 +0100
247 +++ b/gcc/Makefile.in 2011-12-24 22:28:08.864804375 +0100
248 @@ -247,6 +247,14 @@ LINKER_FLAGS = $(CFLAGS)
249 endif
250 endif
251
252 +# We don't want to compile the compiler with -fPIE, it make PCH fail.
253 +enable_esp = @enable_esp@
254 +ifeq ($(enable_esp),yes)
255 +ESP_NOPIE_CFLAGS = -fno-PIE
256 +else
257 +ESP_NOPIE_CFLAGS=
258 +endif
259 +
260 # -------------------------------------------
261 # Programs which operate on the build machine
262 # -------------------------------------------
263 @@ -974,12 +982,13 @@ INTERNAL_CFLAGS = -DIN_GCC @CROSS@
264
265 # This is the variable actually used when we compile. If you change this,
266 # you probably want to update BUILD_CFLAGS in configure.ac
267 -ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \
268 +ALL_CFLAGS = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) \
269 $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@
270
271 # The C++ version.
272 -ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
273 - $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) $(WARN_CXXFLAGS) @DEFS@
274 +ALL_CXXFLAGS = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) \
275 + $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) \
276 + $(WARN_CXXFLAGS) @DEFS@
277
278 # Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro
279 # puts -I options in CPPFLAGS, our include files in the srcdir will always
280 @@ -1814,6 +1823,8 @@ libgcc.mvars: config.status Makefile spe
281 echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars
282 echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars
283 echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
284 + echo enable_esp = '$(enable_esp)' >> tmp-libgcc.mvars
285 + echo enable_crtbeginP = '@enable_crtbeginP@' >> tmp-libgcc.mvars
286
287 mv tmp-libgcc.mvars libgcc.mvars
288
289 --- a/libgcc/Makefile.in 2011-11-22 04:01:02.000000000 +0100
290 +++ b/libgcc/Makefile.in 2011-12-25 15:18:22.449610631 +0100
291 @@ -219,6 +219,17 @@ else
292 DECNUMINC =
293 endif
294
295 +ifeq ($(enable_esp),yes)
296 +ESP_NOPIE_CFLAGS = -fno-PIE
297 +else
298 +ESP_NOPIE_CFLAGS=
299 +endif
300 +
301 +# We add crtbeginP.o to the EXTRA_PARTS list if enable_crtbeginP = yes
302 +ifeq ($(enable_crtbeginP),yes)
303 +EXTRA_PARTS += crtbeginP.o
304 +endif
305 +
306 # Options to use when compiling libgcc2.a.
307 #
308 LIBGCC2_DEBUG_CFLAGS = -g
309 @@ -225,7 +225,7 @@ endif
310 LIBGCC2_DEBUG_CFLAGS = -g
311 LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
312 $(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \
313 - -fbuilding-libgcc -fno-stack-protector \
314 + -fbuilding-libgcc -fno-stack-protector -fstack-check=no \
315 $(INHIBIT_LIBC_CFLAGS)
316
317 # Additional options to use when compiling libgcc2.a.
318 @@ -279,7 +290,7 @@ INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CF
319 CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
320 -finhibit-size-directive -fno-inline -fno-exceptions \
321 -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
322 - -fno-stack-protector \
323 + -fno-stack-protector $(ESP_NOPIE_CFLAGS) -fstack-check=no \
324 $(INHIBIT_LIBC_CFLAGS)
325
326 # Extra flags to use when compiling crt{begin,end}.o.
327 @@ -966,6 +977,13 @@ crtendS$(objext): $(srcdir)/crtstuff.c
328 # This is a version of crtbegin for -static links.
329 crtbeginT$(objext): $(srcdir)/crtstuff.c
330 $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN -DCRTSTUFFT_O
331 +
332 +# This is a version of crtbegin for -static -fPIE links.
333 +ifeq ($(enable_crtbeginP),yes)
334 +crtbeginP$(objext): $(srcdir)/crtstuff.c
335 + $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
336 + -c $< -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O
337 +endif
338 endif
339
340 ifeq ($(CUSTOM_CRTIN),)
341
342
343
344 1.1 src/patchsets/gcc/4.8.5/pie/05_all_gcc48_gcc.c.patch
345
346 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/05_all_gcc48_gcc.c.patch?rev=1.1&view=markup
347 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/05_all_gcc48_gcc.c.patch?rev=1.1&content-type=text/plain
348
349 Index: 05_all_gcc48_gcc.c.patch
350 ===================================================================
351 2014-01-01 Magnus Granberg <zorry@g.o>
352
353 * gcc/gcc.c include esp.h
354 static const char *cc1_spec We set that in esp.h if ENABLE_ESP.
355
356 --- gcc/gcc.c 2010-01-21 10:29:30.000000000 -0500
357 +++ gcc/gcc.c 2010-01-29 23:29:16.000000000 -0500
358 @@ -44,6 +44,7 @@
359 #include "opts.h"
360 #include "params.h"
361 #include "vec.h"
362 +#include "config/esp.h" /* for --enable-esp support */
363 #include "filenames.h"
364
365 /* By default there is no special suffix for target executables. */
366 @@ -822,7 +823,9 @@
367
368 static const char *asm_debug;
369 static const char *cpp_spec = CPP_SPEC;
370 +#ifndef ENABLE_ESP
371 static const char *cc1_spec = CC1_SPEC CC1_SSP_DEFAULT_SPEC;
372 +#endif
373 static const char *cc1plus_spec = CC1PLUS_SPEC;
374 static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
375 static const char *link_ssp_spec = LINK_SSP_SPEC;
376
377
378
379 1.1 src/patchsets/gcc/4.8.5/pie/16_all_gcc47_nopie_option.patch
380
381 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/16_all_gcc47_nopie_option.patch?rev=1.1&view=markup
382 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/16_all_gcc47_nopie_option.patch?rev=1.1&content-type=text/plain
383
384 Index: 16_all_gcc47_nopie_option.patch
385 ===================================================================
386 2012-01-24 Magnus Granberg <zorry@g.o>
387
388 * gcc/common.opt Add -nopie
389
390 --- a/gcc/common.opt 2011-11-23 19:51:17.000000000 +0100
391 +++ b//gcc/common.opt 2012-01-24 16:56:24.302224357 +0100
392 @@ -2280,6 +2280,9 @@ Driver
393 nodefaultlibs
394 Driver
395
396 +nopie
397 +Driver
398 +
399 nostartfiles
400 Driver
401
402
403
404
405 1.1 src/patchsets/gcc/4.8.5/pie/20_all_gcc46_config_crtbeginp.patch
406
407 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/20_all_gcc46_config_crtbeginp.patch?rev=1.1&view=markup
408 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/20_all_gcc46_config_crtbeginp.patch?rev=1.1&content-type=text/plain
409
410 Index: 20_all_gcc46_config_crtbeginp.patch
411 ===================================================================
412 2011-03-05 Magnus Granberg <zorry@g.o>
413
414 * gcc/config/gnu-user.h If ENABLE_CRTBEGINP, -static and -pie use crtbegineP.o.
415 * gcc/config/rs6000/sysv4.h If ENABLE_CRTBEGINP, -static and -pie use crtbegineP.o.
416
417 --- gcc/config/gnu-user.h 2009-04-10 01:23:07.000000000 +0200
418 +++ gcc/config/gnu-user.h 2009-09-08 04:08:06.000000000 +0200
419 @@ -39,7 +39,11 @@
420 provides part of the support for getting C++ file-scope static
421 object constructed before entering `main'. */
422
423 -#if defined HAVE_LD_PIE
424 +#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINP)
425 +#define GNU_USER_TARGET_STARTFILE_SPEC \
426 + "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} crti.o%s \
427 + %{static:%{pie:crtbeginP.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}"
428 +#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINP)
429 #define GNU_USER_TARGET_STARTFILE_SPEC \
430 "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
431 crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
432 --- gcc/config/rs6000/sysv4.h 2009-04-10 01:23:07.000000000 +0200
433 +++ gcc/config/rs6000/sysv4.h 2009-09-08 04:41:50.000000000 +0200
434 @@ -883,7 +883,12 @@
435 %{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
436 %{!shared: %{profile:-lc_p} %{!profile:-lc}}}"
437
438 -#ifdef HAVE_LD_PIE
439 +#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINP)
440 +#define STARTFILE_LINUX_SPEC "\
441 +%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
442 +%{mnewlib:ecrti.o%s;:crti.o%s} \
443 +%{static:%{pie:crtbeginP.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}"
444 +#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINP)
445 #define STARTFILE_LINUX_SPEC "\
446 %{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
447 %{mnewlib:ecrti.o%s;:crti.o%s} \
448
449
450
451 1.1 src/patchsets/gcc/4.8.5/pie/24_all_gcc48_invoke.texi.patch
452
453 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/24_all_gcc48_invoke.texi.patch?rev=1.1&view=markup
454 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/24_all_gcc48_invoke.texi.patch?rev=1.1&content-type=text/plain
455
456 Index: 24_all_gcc48_invoke.texi.patch
457 ===================================================================
458 2014-01-04 Magnus Granberg <zorry@g.o>
459
460 * gcc/doc/invoke.texi Add NOTES about -fstack-protector-all, -pie and
461 -fPIE/-fpie when --enable-esp is enable, this options is on by default.
462
463 --- gcc/doc/invoke.texi 2009-04-01 09:18:47.000000000 +0200
464 +++ gcc/doc/invoke.texi 2009-06-18 14:08:38.000000000 +0200
465 @@ -7134,6 +7134,11 @@
466 @opindex fstack-protector-all
467 Like @option{-fstack-protector} except that all functions are protected.
468
469 +NOTE: When --enable-esp this option is enabled by default
470 +for C, C++, ObjC, ObjC++, if neither @option{-fno-stack-protector}
471 +or @option{-nostdlib} or @option{-nodefaultlibs} or
472 +@option{@-ffreestanding} or @option{-fstack-protector} are found.
473 +
474 @item -fsection-anchors
475 @opindex fsection-anchors
476 Try to reduce the number of symbolic address calculations by using
477 @@ -7960,6 +7965,12 @@
478 that were used to generate code (@option{-fpie}, @option{-fPIE},
479 or model suboptions) when you specify this option.
480
481 +NOTE: When --enable-esp this option is enabled by default
482 +for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE}
483 +or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or
484 +@option{-nostartfiles} or @option{-shared} or @option{-pg} or @option{-p}
485 +are found.
486 +
487 @item -rdynamic
488 @opindex rdynamic
489 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
490 @@ -15889,6 +15910,11 @@
491 @code{__pie__} and @code{__PIE__}. The macros have the value 1
492 for @option{-fpie} and 2 for @option{-fPIE}.
493
494 +NOTE: When --enable-esp this option is enabled by default
495 +for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE}
496 +or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or
497 +@option{-nostartfiles} or @option{-shared} are found.
498 +
499 @item -fno-jump-tables
500 @opindex fno-jump-tables
501 Do not use jump tables for switch statements even where it would be
502
503
504
505 1.1 src/patchsets/gcc/4.8.5/pie/33_all_gcc48_config_rs6000.patch
506
507 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/33_all_gcc48_config_rs6000.patch?rev=1.1&view=markup
508 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/33_all_gcc48_config_rs6000.patch?rev=1.1&content-type=text/plain
509
510 Index: 33_all_gcc48_config_rs6000.patch
511 ===================================================================
512 2014-08-07 Magnus Granberg <zorry@g.o>
513
514 * gcc/config/rs6000/sysv4.h (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC.
515 (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
516
517 --- a/gcc/config/rs6000/sysv4.h 2013-01-10 21:38:27.000000000 +0100
518 +++ b/gcc/config/rs6000/sysv4.h 2013-03-26 01:30:33.257003189 +0100
519 @@ -627,8 +627,13 @@ extern int fixuplabelno;
520
521 #define LINK_OS_DEFAULT_SPEC ""
522
523 +#ifdef ENABLE_ESP
524 +#define DRIVER_SELF_SPECS "%{mfpu=none: %<mfpu=* \
525 + %<msingle-float %<mdouble-float}", ESP_DRIVER_SELF_SPEC
526 +#else
527 #define DRIVER_SELF_SPECS "%{mfpu=none: %<mfpu=* \
528 %<msingle-float %<mdouble-float}"
529 +#endif
530
531 /* Override rs6000.h definition. */
532 #undef CPP_SPEC
533 @@ -933,7 +938,11 @@ ncrtn.o%s"
534 { "cpp_os_openbsd", CPP_OS_OPENBSD_SPEC }, \
535 { "cpp_os_default", CPP_OS_DEFAULT_SPEC }, \
536 { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }, \
537 - SUBSUBTARGET_EXTRA_SPECS
538 + SUBSUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS
539 +
540 +#ifndef ENABLE_ESP
541 +#define ESP_EXTRA_SPECS
542 +#endif
543
544 #define SUBSUBTARGET_EXTRA_SPECS
545
546
547
548
549 1.1 src/patchsets/gcc/4.8.5/pie/34_all_gcc48_config_i386.patch
550
551 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/34_all_gcc48_config_i386.patch?rev=1.1&view=markup
552 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/34_all_gcc48_config_i386.patch?rev=1.1&content-type=text/plain
553
554 Index: 34_all_gcc48_config_i386.patch
555 ===================================================================
556 2013-03-24 Magnus Granberg <zorry@g.o>
557
558 * gcc/config/i386/gnu-user-common.h (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC.
559 * gcc/config/i386/gnu-user.h (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
560 * gcc/config/i386/i386.h (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
561
562 --- a/gcc/config/i386/gnu-user-common.h 2013-01-10 21:38:27.000000000 +0100
563 +++ b/gcc/config/i386/gnu-user-common.h 2013-02-14 00:51:44.689637605 +0100
564 @@ -70,3 +70,7 @@ along with GCC; see the file COPYING3.
565
566 /* Static stack checking is supported by means of probes. */
567 #define STACK_CHECK_STATIC_BUILTIN 1
568 +
569 +#ifdef ENABLE_ESP
570 +#define DRIVER_SELF_SPECS ESP_DRIVER_SELF_SPEC
571 +#endif
572 --- a/gcc/config/i386/gnu-user.h 2011-05-05 14:32:50.000000000 +0200
573 +++ b/gcc/config/i386/gnu-user.h 2012-07-09 14:28:38.726289455 +0200
574 @@ -93,9 +93,16 @@ along with GCC; see the file COPYING3.
575 "--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
576
577 #undef SUBTARGET_EXTRA_SPECS
578 +#ifdef ENABLE_ESP
579 #define SUBTARGET_EXTRA_SPECS \
580 { "link_emulation", GNU_USER_LINK_EMULATION },\
581 - { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
582 + { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }, \
583 + ESP_EXTRA_SPECS
584 +#else
585 +#define SUBTARGET_EXTRA_SPECS \
586 + { "link_emulation", GNU_USER_LINK_EMULATION },\
587 + { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
588 +#endif
589
590 #undef LINK_SPEC
591 #define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
592 --- a/gcc/config/i386/i386.h 2011-11-24 23:11:12.000000000 +0100
593 +++ b/gcc/config/i386/i386.h 2012-07-09 14:21:24.575276517 +0200
594 @@ -617,13 +617,16 @@ enum target_cpu_default
595 Do not define this macro if it does not need to do anything. */
596
597 #ifndef SUBTARGET_EXTRA_SPECS
598 +#ifdef ENABLE_ESP
599 +#define SUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS
600 +#else
601 #define SUBTARGET_EXTRA_SPECS
602 #endif
603 +#endif
604
605 #define EXTRA_SPECS \
606 { "cc1_cpu", CC1_CPU_SPEC }, \
607 SUBTARGET_EXTRA_SPECS
608 -
609
610 /* Set the value of FLT_EVAL_METHOD in float.h. When using only the
611 FPU, assume that the fpcw is set to extended precision; when using
612
613
614
615 1.1 src/patchsets/gcc/4.8.5/pie/35_all_gcc48_config_arm.patch
616
617 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/35_all_gcc48_config_arm.patch?rev=1.1&view=markup
618 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/35_all_gcc48_config_arm.patch?rev=1.1&content-type=text/plain
619
620 Index: 35_all_gcc48_config_arm.patch
621 ===================================================================
622 2013-06-03 Magnus Granberg <zorry@g.o>
623
624 * gcc/config/arm/arm.h (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC.
625 * gcc/config/arm/elf.h (SUBSUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
626
627 --- a/gcc/config/arm/arm.h 2013-01-15 17:17:28.000000000 +0100
628 +++ b/gcc/config/arm/arm.h 2013-02-18 22:45:18.327284928 +0100
629 @@ -2326,6 +2326,11 @@ extern const char *host_detect_local_cpu
630 # define MCPU_MTUNE_NATIVE_SPECS ""
631 #endif
632
633 -#define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
634 -
635 +#ifdef ENABLE_ESP
636 +# define DRIVER_SELF_SPECS \
637 + MCPU_MTUNE_NATIVE_SPECS, \
638 + ESP_DRIVER_SELF_SPEC
639 +#else
640 +# define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
641 +#endif
642 #endif /* ! GCC_ARM_H */
643 --- a/gcc/config/arm/elf.h 2013-01-10 21:38:27.000000000 +0100
644 +++ b/gcc/config/arm/elf.h 2013-05-19 02:15:49.595855825 +0200
645 @@ -49,7 +49,11 @@
646 #endif
647
648 #undef SUBSUBTARGET_EXTRA_SPECS
649 +#ifdef ENABLE_ESP
650 +#define SUBSUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS
651 +#else
652 #define SUBSUBTARGET_EXTRA_SPECS
653 +#endif
654
655 #ifndef ASM_SPEC
656 #define ASM_SPEC "\
657
658
659
660 1.1 src/patchsets/gcc/4.8.5/pie/36_all_gcc48_config_mips.patch
661
662 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/36_all_gcc48_config_mips.patch?rev=1.1&view=markup
663 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/36_all_gcc48_config_mips.patch?rev=1.1&content-type=text/plain
664
665 Index: 36_all_gcc48_config_mips.patch
666 ===================================================================
667 2013-04-01 Magnus Granberg <zorry@g.o>
668
669 * gcc/config/mips/gnu-user.h (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC.
670 * gcc/config/mips/gnu-user64.h (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC.
671 * gcc/config/mips/mips.h (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
672
673 --- a/gcc/config/mips/gnu-user.h 2013-01-10 21:38:27.000000000 +0100
674 +++ b/gcc/config/mips/gnu-user.h 2013-03-10 22:37:33.743176388 +0100
675 @@ -125,9 +125,16 @@ extern const char *host_detect_local_cpu
676 "%{mabi=64:%{!msym32:%<mplt}}"
677
678 #undef DRIVER_SELF_SPECS
679 +#ifdef ENABLE_ESP
680 #define DRIVER_SELF_SPECS \
681 BASE_DRIVER_SELF_SPECS, \
682 + ESP_DRIVER_SELF_SPEC, \
683 LINUX_DRIVER_SELF_SPECS
684 +# else
685 +#define DRIVER_SELF_SPECS \
686 + BASE_DRIVER_SELF_SPECS, \
687 + LINUX_DRIVER_SELF_SPECS
688 +#endif
689
690 /* Similar to standard Linux, but adding -ffast-math support. */
691 #undef GNU_USER_TARGET_MATHFILE_SPEC
692 --- a/gcc/config/mips/gnu-user64.h 2013-01-10 21:38:27.000000000 +0100
693 +++ b/gcc/config/mips/gnu-user64.h 2013-03-10 22:32:11.209166777 +0100
694 @@ -26,9 +26,16 @@ along with GCC; see the file COPYING3.
695 " %{!mabi=*: -" MULTILIB_ABI_DEFAULT "}"
696
697 #undef DRIVER_SELF_SPECS
698 +#ifdef ENABLE_ESP
699 #define DRIVER_SELF_SPECS \
700 BASE_DRIVER_SELF_SPECS, \
701 + ESP_DRIVER_SELF_SPEC, \
702 LINUX64_DRIVER_SELF_SPECS
703 +# else
704 +#define DRIVER_SELF_SPECS \
705 + BASE_DRIVER_SELF_SPECS, \
706 + LINUX64_DRIVER_SELF_SPECS
707 +#endif
708
709 #undef GNU_USER_TARGET_LINK_SPEC
710 #define GNU_USER_TARGET_LINK_SPEC "\
711 --- a/gcc/config/mips/mips.h 2013-01-10 21:38:27.000000000 +0100
712 +++ b/gcc/config/mips/mips.h 2013-03-24 16:59:01.474513910 +0100
713 @@ -1197,9 +1197,13 @@ struct mips_cpu_info {
714 SUBTARGET_EXTRA_SPECS
715
716 #ifndef SUBTARGET_EXTRA_SPECS
717 +#ifdef ENABLE_ESP
718 +#define SUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS
719 +#else
720 #define SUBTARGET_EXTRA_SPECS
721 #endif
722 -
723 +#endif
724 +
725 #define DBX_DEBUGGING_INFO 1 /* generate stabs (OSF/rose) */
726 #define DWARF2_DEBUGGING_INFO 1 /* dwarf2 debugging info */
727
728
729
730
731 1.1 src/patchsets/gcc/4.8.5/pie/37_all_gcc48_config_ia64.patch
732
733 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/37_all_gcc48_config_ia64.patch?rev=1.1&view=markup
734 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/37_all_gcc48_config_ia64.patch?rev=1.1&content-type=text/plain
735
736 Index: 37_all_gcc48_config_ia64.patch
737 ===================================================================
738 2013-06-03 Magnus Granberg <zorry@g.o>
739
740 * gcc/config/ia64/linux.h Define DRIVER_SELF_SPECS ESP_DRIVER_SELF_SPEC.
741 * gcc/config/ia64/ia64.h (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
742
743 --- a/gcc/config/ia64/linux.h 2013-01-10 21:38:27.000000000 +0100
744 +++ b/gcc/config/ia64/linux.h 2013-03-16 22:50:10.363049291 +0100
745 @@ -88,3 +88,7 @@ do { \
746
747 /* Define this to be nonzero if static stack checking is supported. */
748 #define STACK_CHECK_STATIC_BUILTIN 1
749 +
750 +#ifdef ENABLE_ESP
751 +#define DRIVER_SELF_SPECS ESP_DRIVER_SELF_SPEC
752 +#endif
753 --- a/gcc/config/ia64/ia64.h 2013-01-10 21:38:27.000000000 +0100
754 +++ b/gcc/config/ia64/ia64.h 2013-03-26 02:03:21.052061828 +0100
755 @@ -41,8 +41,12 @@ do { \
756 } while (0)
757
758 #ifndef SUBTARGET_EXTRA_SPECS
759 +#ifdef ENABLE_ESP
760 +#define SUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS
761 +#else
762 #define SUBTARGET_EXTRA_SPECS
763 #endif
764 +#endif
765
766 #define EXTRA_SPECS \
767 { "asm_extra", ASM_EXTRA_SPEC }, \
768
769
770
771 1.1 src/patchsets/gcc/4.8.5/pie/40_all_gcc48_config_esp.patch
772
773 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/40_all_gcc48_config_esp.patch?rev=1.1&view=markup
774 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/40_all_gcc48_config_esp.patch?rev=1.1&content-type=text/plain
775
776 Index: 40_all_gcc48_config_esp.patch
777 ===================================================================
778 2014-01-04 Magnus Granberg <zorry@g.o>
779
780 * gcc/esp.h New file to support --enable-esp
781 Version 20140104.1
782
783 --- gcc/config/esp.h 2010-04-09 16:14:00.000000000 +0200
784 +++ gcc/config/esp.h 2012-06-23 01:00:31.248348491 +0200
785 @@ -0,0 +1,128 @@
786 +/* License terms see GNU GENERAL PUBLIC LICENSE Version 3.
787 + * Version 20140104.1
788 + * Magnus Granberg (Zorry) <zorry@g.o> */
789 +#ifndef GCC_ESP_H
790 +#define GCC_ESP_H
791 +
792 +/* This file will add -fstack-protector-all, -fstack-check, -fPIE, -pie and -z now
793 + as default if the defines and the spec allow it.
794 + Added a hack for gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass
795 + to support older hardened GCC patches and we don't need to change the code on gcc-specs-* and _filter-hardened.
796 + This will add some unsupported upstream commands options as -nopie and -nonow.
797 + -D__KERNEL__ is added so we don't have -fPIE, -pie and -fstack-protector-all and -fstack-check when building kernels.
798 + ESP_CC1_SPEC is added to CC1_SPEC.
799 + ESP_CC1_STRICT_OVERFLOW_SPEC is added so we don't disable the strict-overflow check.
800 + ESP_LINK_PIE_CHECK_SPEC check for -pie, -p, -pg, -profile and -static.
801 + ENABLE_CRTBEGINP add support for crtbeginP.o, build -static with -fPIE or -fpie.
802 +*/
803 +#ifdef ENABLE_ESP
804 +
805 + /* Hack to support gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass */
806 + #define ESP_CC1_SPEC " %(esp_cc1_ssp) %(esp_cc1_pie) %(esp_cc1_strict_overflow)"
807 + #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
808 + #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: %{!fno-stack-check: }}}"
809 + #else
810 + #define ESP_CC1_SSP_SPEC ""
811 + #endif
812 + #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP )
813 + #define ESP_CC1_PIE_SPEC "%{!nopie: }"
814 + #else
815 + #define ESP_CC1_PIE_SPEC ""
816 + #endif
817 + #define ESP_CC1_STRICT_OVERFLOW_SPEC "%{!fstrict-overflow:%{!fno-strict-overflow: -fno-strict-overflow}}"
818 +
819 + /* ESP_LINK_SPEC is added to LINK_PIE_SPEC if esp is enable
820 + -z now will be added if we don't have -vanilla spec. We do a -pie incompatible check
821 + Don't remove the specs in the end */
822 + #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_pie_check) "
823 + #define ESP_LINK_NOW_SPEC "%{!nonow:-z now}"
824 +
825 + /* We use ESP_ESP_DRIVER_SELF_SPEC to add pie and ssp command-line options. */
826 + #define ESP_DRIVER_SELF_SPEC "%{D__KERNEL__:;:%{!nopie:%(esp_options_pie) \
827 + %(esp_link_pie)} %(esp_options_ssp) }"
828 +
829 + /* This will add -fstack-protector-all if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector
830 + -fstack-protector-all and we have EFAULT_SSP or EFAULT_PIE_SSP defined. */
831 + #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP )
832 + #define ESP_OPTIONS_SSP_SPEC \
833 + "%{nostdlib|nodefaultlibs|ffreestanding|fno-stack-protector| \
834 + fstack-protector|fstack-protector-all:;:-fstack-protector-all} \
835 + %{fstack-check|fstack-check=*:;: -fstack-check}"
836 + #else
837 + #define ESP_OPTIONS_SSP_SPEC ""
838 + #endif
839 +
840 + /* If EFAULT_PIE or EFAULT_PIE_SSP is defined we will add -fPIE -pie */
841 + #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP )
842 +
843 + /* This will add -fPIE if we don't have -pie -fpic -fPIC -fpie -fPIE -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static
844 + -nostdlib -nostartfiles. */
845 + /* With ENABLE_CRTBEGINP we don't need to check for -static */
846 + #ifdef ENABLE_CRTBEGINP
847 + #define ESP_OPTIONS_PIE_SPEC \
848 + "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \
849 + %{!shared: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }"
850 + #else
851 + #define ESP_OPTIONS_PIE_SPEC \
852 + "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \
853 + %{!shared: %{!static: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }}"
854 + #endif
855 +
856 + /* This will add -pie if we don't have -pie -A -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static -r -nostdlib
857 + -nostartfiles */
858 + /* With ENABLE_CRTBEGINP we don't need to check for -static
859 + and we add -pie only to get the start and endfiles. -pie will not go to the linker. */
860 + #ifdef ENABLE_CRTBEGINP
861 + #define ESP_LINK_PIE_SPEC \
862 + "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!r: \
863 + %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}"
864 + #else
865 + #define ESP_LINK_PIE_SPEC \
866 + "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!static:%{!r: \
867 + %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}}"
868 + #endif
869 +
870 + /* This will check if -pie is set when (-static) -pg -p -profile. If set it will make gcc print out
871 + "-pie and (static)|pg|p|profile are incompatible when linking" */
872 + /* With ENABLE_CRTBEGINP we don't need to check for -static */
873 + #ifdef ENABLE_CRTBEGINP
874 + #define ESP_LINK_PIE_CHECK_SPEC \
875 + "%{pie:%{pg|p|profile:%e-pie and -pg|p|profile are incompatible when linking}}"
876 + #else
877 + #define ESP_LINK_PIE_CHECK_SPEC \
878 + "%{pie:%{static|pg|p|profile:%e-pie and -static|pg|p|profile are incompatible when linking}}"
879 + #endif
880 +
881 + /* We don't pass -pie to the linker when -static. */
882 + #ifdef ENABLE_CRTBEGINP
883 + #define LINK_PIE_SPEC "%{!static:%{pie:-pie}} %(esp_link)"
884 + #else
885 + #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)"
886 + #endif
887 +
888 + #else
889 + #define ESP_OPTIONS_PIE_SPEC ""
890 + #define ESP_LINK_PIE_CHECK_SPEC ""
891 + #define ESP_LINK_PIE_SPEC ""
892 + #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)"
893 + #endif
894 +
895 + /* We add extra spec name's to the EXTRA_SPECS list */
896 + #define ESP_EXTRA_SPECS \
897 + { "esp_cc1", ESP_CC1_SPEC }, \
898 + { "esp_cc1_pie", ESP_CC1_PIE_SPEC }, \
899 + { "esp_cc1_ssp", ESP_CC1_SSP_SPEC }, \
900 + { "esp_cc1_strict_overflow", ESP_CC1_STRICT_OVERFLOW_SPEC }, \
901 + { "esp_link", ESP_LINK_SPEC }, \
902 + { "esp_link_now", ESP_LINK_NOW_SPEC }, \
903 + { "esp_link_pie", ESP_LINK_PIE_SPEC }, \
904 + { "esp_link_pie_check", ESP_LINK_PIE_CHECK_SPEC }, \
905 + { "esp_driver_self", ESP_DRIVER_SELF_SPEC }, \
906 + { "esp_options_pie", ESP_OPTIONS_PIE_SPEC }, \
907 + { "esp_options_ssp", ESP_OPTIONS_SSP_SPEC }
908 +
909 + static const char *esp_driver_self_spec = ESP_DRIVER_SELF_SPEC;
910 + static const char *cc1_spec = CC1_SPEC ESP_CC1_SPEC;
911 +
912 +#endif
913 +#endif /* End GCC_ESP_H */
914
915
916
917 1.1 src/patchsets/gcc/4.8.5/pie/README
918
919 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/README?rev=1.1&view=markup
920 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/README?rev=1.1&content-type=text/plain
921
922 Index: README
923 ===================================================================
924 This work started with bugs #94325 #100689 #106222 #149292 #149649 and the overlay on http://overlays.gentoo.org/dev/kevquinn.
925 By Kevin K. Quinn, Peter S. Mazinger, Natanael Copa, Alexander Gabert, Solar, PaX Team, SpanKY and mentor.
926
927 The work stalled. Some threads on the Gentoo forum started to do their own fixes to get it working.
928 Xake started the thread where most of the new work is done: "How long until hardened and toolchain will produce a hardened gcc4?"
929 http://forums.gentoo.org/viewtopic-t-668885.html. I joined the thread and started to code.
930
931 We started with the pieworld code from kevquinn's overlay. The PIE and minispecs part hit the tree later on.
932 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
933 configure command line. On GCC 4.8.0 we use DRIVER_SELF_SPECS for the specs.
934 From gcc 4.8.2-r1 it will have -fstack-protector on as default.
935
936 Thank you all:
937 Kevin K. Quinn, Peter S. Mazinger, Natanael Copa, Alexander Gabert, Solar, PaX Team, SpanKY, Xake, Dwokfur,
938 KernelOfTruth, SteveL, nixnut, Hopeless, forsaken1, XioXous, obrut<-, mv, qjim, Tommy[D], Genewb, radegand,
939 unk, neuron, alexxy, hellboi64, likewhoa, g0rg0n, costel78, polsas, 7v5w7go9ub0o, uberpinguin, Naib, cilly,
940 bonsaikitten, kerframil, agaffney, Gordon Malm, blueness, Matthias Klose, Kees Cook, mentor, Anarchy,
941 devurandom and everyone else for helping to test, suggestions, fixes and anything else we have missed.
942 /2013-12-30 Magnus Grenberg (Zorry) <zorry@g.o>
943
944
945
946 1.1 src/patchsets/gcc/4.8.5/pie/README.Changelog
947
948 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/README.Changelog?rev=1.1&view=markup
949 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/README.Changelog?rev=1.1&content-type=text/plain
950
951 Index: README.Changelog
952 ===================================================================
953 0.6.1 Magnus Granberg <zorry@g.o>
954
955 #528690
956 * libgcc/Makefile Disable -fstack-check
957
958 0.6.0 Magnus Granberg <zorry@g.o>
959
960 # 528968
961 * gcc/config/rs6000/sysv4.h Fix a typo in ESP_DRIVER_SELF_SPEC
962
963 0.5.9 Magnus Granberg <zorry@g.o>
964
965 * configure.ac Remove
966 * configure Remove
967 * Makefile.in -fno-stack-protector moved to gentoo gcc patchset.
968 * gcc/gcc.c Update cc1_spec define
969 * gcc/doc/invoke.texi And note on ssp-all for --enable-esp and -ffreestanding
970
971 0.5.8 Magnus Granberg <zorry@g.o>
972
973 * gcc/config/rs6000/linux64 (ASM_SPEC32): Allready applay.
974
975 0.5.7 Magnus Granberg <zorry@g.o>
976
977 * gcc/config/esp.h Add -fstack-check as default.
978
979 0.5.6 Magnus Granberg <zorry@g.o>
980
981 * gcc/config/ia64/linux.h Change ESP_DRIVER_SELF_SPECS To ESP_DRIVER_SELF_SPEC
982 * gcc/config/arm/elf.h (SUBSUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS.
983
984 0.5.5 Magnus Granberg <zorry@g.o>
985
986 * configure.ac Add mips
987 * configure Regenerated
988 * gcc/configure.ac Clean up the checksand add mips.
989 * gcc/configure Regenerated
990 * gcc/config.in Remove ENABLE_ESP_SSP
991 * gcc/Makefile.in Bumped for 4.8.0 release
992 * gcc/gcc.c Remove ESP_EXTRA_SPECS and
993 ESP_COMMAND_OPTIONS_SPEC
994 * gcc/config/rs6000/sysv4.h Add ESP_DRIVER_SELF_SPEC
995 and ESP_EXTRA_SPECS
996 * gcc/config/i386/gnu-user-common.h Add ESP_DRIVER_SELF_SPEC
997 * gcc/config/i386/gnu-user.h Add ESP_DRIVER_SELF_SPEC
998 * gcc/config/i386/i386.h Add ESP_DRIVER_SELF_SPEC
999 * gcc/config/arm/arm.h Add ESP_DRIVER_SELF_SPEC and
1000 ESP_EXTRA_SPECS
1001 * gcc/config/mips/gnu-user.h Add ESP_DRIVER_SELF_SPEC
1002 * gcc/config/mips/gnu-user64.h Add ESP_DRIVER_SELF_SPEC
1003 * gcc/config/mips/mips.h Add ESP_EXTRA_SPECS
1004 * gcc/config/ia64/linux.h Add ESP_DRIVER_SELF_SPECS
1005 * gcc/config/ia64/ia64.h Add ESP_EXTRA_SPECS
1006 * gcc/config/esp.h Bump for ESP_DRIVER_SELF_SPEC support
1007
1008 0.5.4 Magnus Granberg <zorry@g.o>
1009
1010 #436924
1011 * configure.ac Add --enable-esp. Add -fno-stack-protector
1012 to stage1_cflags.
1013 * gcc/configure.ac Add --enable-esp and check if SSP works.
1014 Define ENABLE_ESP ENABLE_ESP_SSP.
1015 Check if we support crtbeginP and define ENABLE_CRTBEGINP.
1016 * gcc/configure Fix a typo
1017
1018 0.5.3 Magnus Granberg <zorry@g.o>
1019
1020 * gcc/configure Clean up the checks and added
1021 check for uclibc ssp support.
1022 * gcc/config.in Add define for ENABLE_ESP_SSP
1023 * gcc/esp.h Check for ENABLE_ESP_SSP
1024
1025 0.5.2 Magnus Granberg <zorry@g.o>
1026
1027 * gcc/common.opt Add -nopie
1028
1029 0.5.1 Magnus Granberg <zorry@g.o>
1030
1031 * configure Bumped for 4.7.0 release
1032 * gcc/configure Bumped for 4.7.0 release and
1033 added some checks.
1034 * gcc/Makefile Bumped for 4.7.0 release
1035 * gcc/gcc.c Bumped for 4.7.0 release
1036 * libgcc/Makefile Bumped for 4.7.0 release
1037
1038 0.5.0 Magnus Granberg <zorry@g.o>
1039
1040 #393321
1041 * gcc/Makefile.in Rename crtbeginTS.o to crtbeginP.o
1042 * gcc/config/gnu-user.h Rename crtbeginTS.o to crtbeginP.o
1043 * gcc/config/rs6000/sysv4.h Rename crtbeginTS.o to crtbeginP.o
1044 * gcc/esp.h Rename crtbeginTS.o to crtbeginP.o
1045 * gcc/configure Rename crtbeginTS.o to crtbeginP.o
1046 * gcc/config.in Rename crtbeginTS.o to crtbeginP.o
1047 * libgcc/Makefile.in Rename crtbeginTS.o to crtbeginP.o
1048
1049 0.4.9 Magnus Granberg <zorry@g.o>
1050
1051 #380823
1052 * gcc/Makefile.in added ESP_NOPIE_CFLAGS to ALL_CXXFLAGS
1053
1054 0.4.8 Magnus Granberg <zorry@g.o>
1055
1056 * gcc/objc/lang-specs.h Bumped for gcc 4.6.0 release
1057 * gcc/objcp/lang-specs.h Bumped for gcc 4.6.0 release
1058 * gcc/cp/lang-specs.h Bumped for gcc 4.6.0 release
1059
1060 0.4.7 Magnus Granberg <zorry@g.o>
1061
1062 * gcc/gcc.c Add %(esp_options) and %(esp_cpp_options)
1063 * gcc/esp.h Use the esp.h patch from gcc-4.4 patchset
1064 * gcc/config/rs6000/linux64.h Bumed for >2011-02-26 snapshot
1065 * gcc/objc/lang-specs.h Add %(esp_options)
1066 * gcc/objcp/lang-specs.h Add %(esp_options)
1067 * gcc/cp/lang-specs.h Add %(esp_options)
1068 * gcc/config/gnu-user.h Add crtbeginTS.o support
1069
1070 0.4.6 Magnus Granberg <zorry@g.o>
1071
1072 * Makefile.in Bumped for gcc 4.6
1073 * gcc/Makefile.in Bumped for gcc 4.6
1074 added ESP_NOPIE_CFLAGS to ALL_CFLAGS
1075 remove any ESP_NOSSP_CFLAGS
1076 remove any ESP_NOPIE_CFLAGS from crt* when not needed
1077 * gcc/gcc.c Bumped for gcc 4.6
1078 moved espf_options_ssp to espf_command_options_spec
1079 * gcc/esp.h Added espf_options_ssp to espf_cc1_command_spec
1080 * gcc/config/rs6000/linux64.h Bumped for gcc 4.6
1081 * gcc/config/linux.h Bumped for gcc 4.6
1082
1083 0.4.5 Magnus Granberg <zorry@g.o>
1084
1085 * gcc/config/rs6000/sysv4.h Fix a typo in the static spec rules
1086
1087 0.4.4 Magnus Granberg <zorry@g.o>
1088
1089 * gcc/esp.h Renamed ESP_CC1_STRICT_SPEC to ESP_CC1_STRICT_OVERFLOW_SPEC
1090 Renamed ESP_OPTIONS_PIE_CHECK_SPEC to ESP_LINK_PIE_CHECK_SPEC
1091
1092 0.4.3 Magnus Granberg <zorry@g.o>
1093
1094 #299061 b.g.o
1095 * gcc/gcc.c removed the pie incompatible specs rule call
1096 * gcc/esp.h Move the -pie incompatible check to esp_link
1097 remove the -shared incompatible check
1098
1099 0.4.2 Magnus granberg <zorry@g.o>
1100
1101 * configure remove the changes from 0.4.1
1102 * Makefile.in remove the changes from 0.4.1 remove -fstack-protector check.
1103 * gcc/configure remove the changes from 0.4.1
1104 * gcc/config.in remove the changes from 0.4.1 remove HAVE_GCC_SSP
1105 * gcc/Makefile remove the changes from 0.4.1
1106 * gcc/esp.h change HAVE_GCC_LD_PIE to (EFAULT_PIE || EFAULT_PIE_SSP)
1107 change HAVE_GCC_SSP to (EFAULT_SSP || EFAULT_PIE_SSP)
1108 * libmudflap/Makefiles.in remove the changes from 0.4.1
1109
1110 0.4.1 Magnus Granberg <zorry@g.o>
1111
1112 *configure removed check for --enable-esp removed enable_esp
1113 added check for --enable-esp=(no|all|nopie|nossp). added enable_esp_set
1114 *Makefile.in renamed enable_esp to enable_esp_set
1115 *gcc/configure removed check for --enable-esp removed enable_esp
1116 added check for --enable-esp=(no|all|nopie|nossp). added enable_esp_set
1117 added a -fPIE -pie check. change AC_COMPILE_IFELSE to AC_LINK_IFELSE in the
1118 -fstack-protector check.
1119 * gcc/config.in Added HAVE_GCC_LD_PIE
1120 *gcc/Makefile.in renamed enable_esp to enable_esp_set
1121 *gcc/esp.h Renamed HAVE_LD_PIE to HAVE_GCC_LD_PIE
1122 Added HAVE_GCC_LD_PIE to #define ESP_CC1_PIE_SPEC. Move ESP_COMMAND_OPTIONS_SPEC
1123 * libmudflap/Makefiles.in In enable_esp change ifeq to ifdef.
1124
1125 #293843 b.g.o
1126 *gcc/esp.h Added -nonow to the -z now specs.
1127
1128 0.4.0 Anthony G. Basile <basile@××××××××××××××.edu>
1129
1130 rename espf to esp and change espf-patchset to piepatchset
1131
1132 0.3.9 Magnus Granberg <zorry@g.o>
1133
1134 * gcc/configure Added check for TLS on the target in the SSP check.
1135
1136 #149292 b.g.o
1137 * gcc/config/i386/linux.h Removed uclibc don't support TLS on stack-protector
1138 * gcc/config/i386/linux64.h Removed uclibc don't support TLS on stack-protector
1139 * gcc/config/rs6000/linux.h Removed uclibc don't support TLS on stack-protector
1140 * gcc/config/i386/linux.h Removed uclibc don't support TLS on stack-protector
1141 * gcc/config/sparc/linux.h Removed uclibc don't support TLS on stack-protector
1142 * gcc/config/sparc/linux64.h Removed uclibc don't support TLS on stack-protector
1143
1144 0.3.8 Magnus Granberg <zorry@g.o>
1145
1146 * gcc/configure Redone the -fstack-protector check.
1147 * gcc/config.in Added HAVE_GCC_SSP
1148 * gcc/gcc.c Removed code for espf_link_spec in X
1149 * gcc/espf.h Added ifdef HAVE_GCC_SSP, change code for espf_link_spec and link_pie_spec
1150
1151 0.3.7_beta Anthony G. Basile <basile@××××××××××××××.edu>
1152
1153 * gcc/configure Check if -fstack-protector is supported by gcc on ARCH
1154 Updated AC_SUBST enable_espf
1155 * gcc/Makefile.in Remove the fix for $(out_object_file): ix86_split_to_parts() stack smashing attack b.g.o #149292.
1156 * gcc/gcc.c Updaded the .c .cc compiler specs.
1157
1158 0.3.6 Magnus Granberg <zorry@×××.nu>
1159
1160 * configure Check --enable-espf change ppc* to powerpc*, powerpc64 and add ia64.
1161 * gcc/configure Don't check for -z,relro on ia64. Disable crtbeginTS for ia64.
1162 * gcc/espf.h ia64 don't support -fstack-protector*
1163
1164 0.3.5 Maguns Granberg <zorry@×××.nu>
1165
1166 * gcc/espf.h Change the specs for crtbegin.TS.o.
1167 * gcc/gcc.c Rename espf_cc1_options to espf_options_pie_check.
1168 * gcc/config/linux.h Fix typos ENABLE_CRTBEGINS to ENABLE_CRTBEGINTS
1169 * gcc/config/rs6000/linux64.h ASM_SPEC32: %{fpic:-K PIC} %{fPIC:-K PIC} to
1170 %{fpic|fPIC|fpie|fPIE:-K PIC}
1171
1172 0.3.4 Magnus Granberg <zorry@×××.nu>
1173
1174 * gcc/configure Add crtbeginTS.o support.
1175 * gcc/Makefile.in Add crtbeginTS.o support.
1176 * gcc/gcc.c Add espf_cc1_options.
1177 * gcc/espf.h Added espf_cc1_options, crtbeginTS.o support,
1178 espf_cc1_options and espf_cc1_strictoverflow.
1179 * gcc/config.in Add crtbeginTS.o support.
1180 * gcc/config/linux.h Add crtbeginTS.o support.
1181 * gcc/config/rs6000/sysv4.h Add crtbeginTS.o support.
1182 * gcc/doc/invoke.texi Add NOTES about -fstack-protector-all,
1183 -pie and -fPIE.
1184 * libgcc/Makefile.in Add crtbeginTS.o support.
1185
1186 0.3.3 Magnus Granberg <zorry@×××.nu>
1187
1188 * gcc/opts.c change #ifdef ENABLE_ESPF to #ifndef ENABLE_ESPF
1189
1190 0.3.2 Magnus Granberg <zorry@×××.nu>
1191
1192 * gcc/opts.c disable flag_delete_null_pointer_checks >= -O2
1193 * gcc/espf.h add ESPF_CC1_SSP_SPEC and ESPF_CC1_PIE_SPEC to fix bugs on -vanilla spec
1194
1195 #149292 b.g.o
1196 * gcc/config/i386/linux.h uclibc don't support TLS on stack-protector
1197 * gcc/config/i386/linux64.h uclibc don't support TLS on stack-protector
1198 * gcc/config/rs6000/linux.h uclibc don't support TLS on stack-protector
1199 * gcc/config/i386/linux.h uclibc don't support TLS on stack-protector
1200 * gcc/config/sparc/linux.h uclibc don't support TLS on stack-protector
1201 * gcc/config/sparc/linux64.h uclibc don't support TLS on stack-protector
1202
1203 0.3.1 Magnus Granberg <zorry@×××.nu>
1204
1205 * gcc/cp/Make-lang.in cc1plus: pch test fail when cc1plus is compile with -fPIE.
1206 * gcc/configure fix --enable-espf when USE"-hardened"
1207
1208 4.4.1-espf-0.3.0 Magnus Granberg <zorry@×××.nu>
1209
1210 * gcc/espf.h add ESPF_LINK_SPEC ESPF_LINK_NOW_SPEC
1211 * gcc/gcc.c move do_self_spec (espf_command_options_spec)
1212 do_spec_1() add espf_link_spec
1213
1214 0.3.0 Magnus Granberg <zorry@×××.nu>
1215
1216 * gcc/objc/lang-specs.h Add %(espf_options)
1217 * gcc/objcp/lang-specs.h Add %(espf_options)
1218 * gcc/cp/lang-specs.h Add %(espf_options)
1219 * gcc/config.in removed ENABLE_LIBSSP
1220 * Makefile.in We add -fno-stack-protector to
1221 BOOT_CFLAGS, LIBCFLAGS and LIBCXXFLAGS
1222 cc1: pch.exp test fail when cc1 is compile with -fPIE
1223 * libmudflap/Makefiles.in Add -fno-stack-protector -U_FORTIFY_SOURCE
1224 to AM_CFLAGS
1225 * configure add --enable-espf
1226 add -fno-stack-protector to stage1_cflags
1227 add targes ppc* arm sparc*
1228 * gcc/configure change code for check --enable-espf
1229 * libmudflap/configure add enable_espf
1230 * gcc/espf.h ESPF_CC1_OPTIONS_SPEC renamed to ESPF_OPTIONS_SPEC
1231 add ESPF_CPP_OPTIONS_SPEC ESPF_COMMAND_OPTIONS_SPEC
1232 ESPF_CC1_OPTIONS_SSP_SPEC renamed to ESPF_OPTIONS_SSP_SPEC
1233 ESPF_COMPILER_COMMAND_PIE_SPEC renamed to ESPF_OPTIONS_PIE_SPEC
1234 ESPF_LINK_COMMAND_PIE_SPEC renamed to ESPF_LINK_PIE_SPEC
1235 add !p !pg to ESPF_LINK_PIE_SPEC
1236 removed ESPF_LINK_SPEC ESPF_CC1_OPTIONS_PIE_INCOMPATIBLE_SPEC
1237 * gcc/gcc.c cpp_options add %(espf_cpp_options)
1238 compiler spec add %(espf_options)
1239 change code for ESPF_EXTRA_SPECS
1240 process_command(): Check for lazy, or now
1241 do_spec_1(): Add -z now and -z relro
1242 main() add do_self_spec (espf_command_options_spec)
1243 removed do_self_spec (espf_cc1_command_spec) do_self_spec (espf_link_command_spec)
1244
1245 0.2.9 Magnus Granberg <zorry@×××.nu>
1246
1247 * gcc/espf.h add ESPF_COMPILER_COMMAND_PIE_SPEC
1248 add ESPF_LINK_COMMAND_PIE_SPEC
1249 change ESPF_COMPILER_COMMAND_SPEC ESPF_LINK_COMMAND_SPEC
1250
1251 0.2.8 Magnus Granberg <zorry@×××.nu>
1252
1253 * gcc/configure removed check crtbeginTS.o
1254 * gcc/espf.h added notes
1255 add ESPF_CC1_SPEC
1256 removed ESPF_CPP_UNIQUE_OPTIONS espf_override_options()
1257 * gcc/gcc.c cc1_spec Set it to CC1_SPEC if ! ENABLE_ESPF
1258 * gcc/toplev.c removed ESPF_OVERRIDE_OPTIONS
1259
1260 0.2.7 Magnus Granberg <zorry@×××.nu>
1261
1262 * gcc/opts.c (decode_options): Remove flag_strict_overflow as opt2
1263 * gcc/config.in removed HAVE_CRTBEGINTS
1264 * gcc/Makefile removed crtbeginTS.o
1265 * libgcc/Makefile.in removed crtbeginTS.o
1266 * gcc/config/i386/i386.h removed espf_override_options ESPF_EXTRA_SPECS
1267 * gcc/config/linux.h remoevd crtbeginTS.o
1268 * gcc/espf.h ESPF_CC1_OPTIONS_PIE_SPEC renamed to ESPF_CC1_COMMAND_SPEC
1269 * gcc/gcc.c add ESPF_EXTRA_SPECS
1270 main() add do_self_spec (espf_cc1_command_spec)
1271
1272 0.2.6 Magnus Granberg <zorry@×××.nu>
1273
1274 * gcc/config/i386/i386.h add espf_override_options() to OVERRIDE_OPTIONS
1275 * gcc/espf.h add espf_override_options()
1276 * gcc/toplev.c add ESPF_OVERRIDE_OPTIONS
1277
1278 0.2.5 Magnus Granberg <zorry@×××.nu>
1279
1280 * gcc/config/i386/i386.h removed espf_cc1
1281 * gcc/config/i386/linux.h removed espf_cc1 %(crtend_gen)
1282 * gcc/config/i386/x86-64.h removed espf_cc1 %(crtend_gen)
1283 * gcc/config/linux.h removed espf_cc1 %(crtfile_gen)
1284 %(crtbegin_t_gen) %(crtend_gen)
1285 add crtbeginTS.o
1286 * gcc/config.in removed TARGET_LIBC_PROVIDES_PIE
1287 add HAVE_CRTBEGINTS
1288 * gcc/Makefile.in add ESPF_NOPIE_CFLAGS ESPF_NOSSP_CFLAGS to
1289 CRTSTUFF_T_CFLAGS
1290 add ESPF_NOSSP_CFLAGS to CRTSTUFF_T_CFLAGS_S
1291 * espf.h ESPF_CC1_SPEC renamed to ESPF_CC1_OPTIONS_SPEC
1292 add ESPF_LINK_SPEC
1293 ESPF_CC1_SSP_SPEC renamed to ESPF_CC1_OPTIONS_SSP_SPEC
1294 ESPF_CC1_PIE_SPEC renamed to ESPF_CC1_OPTIONS_PIE_SPEC
1295 ESPF_CC1_OPTIONS_SPEC renamed to ESPF_CC1_OPTIONS_PIE_INCOMPATIBLE_SPEC
1296 LINK_PIE_SPEC renamed to ESPF_LINK_COMMAND_SPEC
1297 removed ESPF_CC1_STRICT_SPEC CRTFILE_GEN_SPEC CRTBEGIN_GEN_SPEC
1298 CRTBEGIN_T_GEN_SPEC CRTEND_GEN_SPEC
1299 * gcc/configure remove TARGET_LIBC_PROVIDES_PIE
1300 define HAVE_CRTBEGINTS
1301 * gcc/gcc.c LINK_COMMAND_SPEC add %(espf_link)
1302 main() add do_self_spec (espf_link_command_spec)
1303
1304 0.2.4 Magnus Granberg <zorry@×××.nu>
1305
1306 libgcc/Makefile.in clean specs
1307
1308 0.2.3 Magnus Granberg <zorry@×××.nu>
1309
1310 *gcc/espf.h add ESPF_CC1_STRICT_SPEC
1311
1312 0.2.2 Magnus Granberg <zorry@×××.nu>
1313
1314 * gcc/config/i386/i386.h Add espf_cc1
1315 Add ESPF_EXTRA_SPECS
1316 * gcc/config/i386/linux.h Add espf_cc1
1317 * gcc/config/i386/x86-64.h Add espf_cc1
1318 * gcc/config/linux.h Add espf_cc1
1319 * gcc/Makefile.in add crtbeginTS.o to EXTRA_PARTS list
1320 * libgcc/Makefile.in add crtbeginTS.o to EXTRA_PARTS list
1321 * gcc/configure add define ENABLE_LIBSSP
1322 * gcc/gcc.c %(fortify_default) renamed to %(espf_cpp_unique_options)
1323 %(pie_incompatible) renamed to %(espf_cc1_options)
1324 removed ESPF_EXTRA_SPECS
1325 * gcc/espf.h ESPF_DEFAULT_SPEC renamed to ESPF_CC1_SPEC
1326 SSP_DEFAULT_SPEC renamed to ESPF_CC1_SSP_SPEC
1327 FORTIFY_DEFAULT_SPEC renamed to ESPF_CPP_UNIQUE_OPTIONS
1328 PIE_DEFAULT_SPEC renamed to ESPF_CC1_PIE_SPEC
1329 PIE_INCOMPATIBLE_SPEC renamed to ESPF_CC1_OPTIONS_SPEC
1330 add new CRTFILE_GEN_SPEC CRTBEGIN_T_GEN_SPEC CRTEND_GEN_SPEC if !
1331 TARGET_LIBC_PROVIDES_PIE
1332
1333 4.4.0-espf-0.2.1 Magnus Granberg <zorry@×××.nu>
1334
1335 * gcc/gcc.c include: espf.h
1336 cc1_spec = CC1_SPEC if not ENABLE_ESPF
1337 cpp_unique_options add %(fortify_default)
1338 cc1_options add %(pie_incompatible)
1339 EXTRA_SPECS add ESPF_EXTRA_SPECS
1340 * libgcc/Makefile.in add crtbeginTs.o
1341 gcc/Makefile.in add ESPF_NOPIE_CFLAGS and ESPF_NOSSP_CFLAGS
1342 LIBGCC2_CFLAGS add ESPF_NOSSP_CFLAGS
1343 CRTSTUFF_CFLAGS add ESPF_NOPIE_CFLAGS and ESPF_NOSSP_CFLAGS
1344 crtbegin* add crtbeginTS
1345 $(out_object_file): ix86_split_to_parts() stack smashing attack b.g.o #149292
1346 * libgcc/configure add enable_espf
1347 * gcc/config/linux.h add %(crtfile_gen) %(crtbegin_t_gen) %(crtend_gen)
1348 * gcc/config/i386/linux.h add %(crtend_gen)
1349 * gcc/config/i386/linux64.h add %(crtend_gen)
1350 * gcc/config.gcc extra_parts add crtbeginTS.o
1351 * libgcc/config.host extra_parts add crtbeginTS.o
1352 * gcc/configure check -z relro
1353 check -z now
1354 check FORTIFY_SOURCES level 2
1355 check Scrt1.o
1356 check --enable-espf
1357 check crtbeginTS.o
1358 * gcc/espf.h new file
1359 * gcc/varasm.c (decl_tls_model): Check flag_pic instead of flag_shlib
1360 * gcc/config.in add ENABLE_LIBSSP
1361 add ENABLE_ESPF
1362 add TARGET_LIBC_PROVIDES_FORTIFY2
1363 add TARGET_LIBC_PROVIDES_PIE
1364 * configure define ENABLE_LIBSSP
1365
1366 gcc-4.3.3-piepatches-v10.2.1
1367
1368
1369
1370 1.1 src/patchsets/gcc/4.8.5/pie/README.history
1371
1372 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/README.history?rev=1.1&view=markup
1373 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.8.5/pie/README.history?rev=1.1&content-type=text/plain
1374
1375 Index: README.history
1376 ===================================================================
1377 0.6.1 3 Dec 2014
1378 U 03_all_gcc48_Makefile.in.patch
1379 0.6.0 7 jun 2014
1380 U 33_all_gcc48_config_rs6000.patch
1381 0.5.9 4 Jan 2014
1382 U 01_all_gcc48_configure.patch
1383 U 03_all_gcc48_Makefile.in.patch
1384 U 05_all_gcc48_gcc.c.patch
1385 - 24_all_gcc44_invoke.texi.patch
1386 + 24_all_gcc48_invoke.texi.patch
1387 U README
1388 0.5.8 11 Nov 2013
1389 U 33_all_gcc48_config_rs6000.patch
1390 0.5.7 10 Jul 2013
1391 U 35_all_gcc48_config_esp.h.patch
1392 - 15_all_gcc44_decl-tls-model.patch
1393 0.5.6 03 Jun 2013
1394 U 35_all_gcc48_config_arm.patch
1395 U 37_all_gcc48_config_ia64.patch
1396 0.5.5 31 Mar 2013
1397 - 01_all_gcc47_configure.patch
1398 + 01_all_gcc48_configure.patch
1399 - 02_all_gcc47_config.in.patch
1400 + 02_all_gcc48_config.in.patch
1401 - 03_all_gcc47_Makefile.in.patch
1402 + 03_all_gcc48_Makefile.in.patch
1403 - 05_all_gcc47_gcc.c.patch
1404 + 05_all_gcc48_gcc.c.patch
1405 - 33_all_gcc46_config_rs6000_linux64.h.patch
1406 + 33_all_gcc48_config_rs6000.patch
1407 - 34_all_gcc47_config_all_gnu_user.patch
1408 + 34_all_gcc48_config_i386.patch
1409 + 35_all_gcc48_config_arm.patch
1410 + 36_all_gcc48_config_mips.patch
1411 + 37_all_gcc48_config_ia64.patch
1412 - 35_all_gcc47_config_esp.h.patch
1413 - 35_all_gcc48_config_esp.h.patch
1414 U README
1415 0.5.4 02 Oct 2012
1416 U 01_all_gcc47_configure.patch
1417 + 01_all_gcc47_configure.ac.patch
1418 0.5.3 06 Apr 2012
1419 U 01_all_gcc47_configure.patch
1420 + 02_all_gcc47_config.in.patch
1421 - 02_all_gcc45_config.in.patch
1422 + 06_all_gcc46_esp.h.patch
1423 - 06_all_gcc45_esp.h.patch
1424 0.5.2 24 Jan 2012
1425 + 16_all_gcc47_nopie_option.patch
1426 0.5.1 17 Jan 2012
1427 + 01_all_gcc47_configure.patch
1428 - 10_all_gcc45_configure.patch
1429 + 03_all_gcc47_Makefile.in.patch
1430 - 12_all_gcc46_Makefile.in.patch
1431 + 02_all_gcc45_config.in.patch
1432 - 11_all_gcc45_config.in.patch
1433 + 05_all_gcc46_gcc.c.patch
1434 - 20_all_gcc46_gcc.c.patch
1435 + 06_all_gcc45_esp.h.patch
1436 - 30_all_gcc45_esp.h.patch
1437 + 10_all_gcc46_default-ssp.patch
1438 - 22_all_gcc46-default-ssp.patch
1439 + 15_all_gcc44_decl-tls-model.patch
1440 - 21_all_gcc44_decl-tls-model.patch
1441 + 20_all_gcc46_config_crtbeginp.patch
1442 - 35_all_gcc46_config_crtbegints.patch
1443 + 24_all_gcc44_invoke.texi.patch
1444 + 60_all_gcc44_invoke.texi.patch
1445 0.5.0 07 Dec 2011
1446 + 35_all_gcc46_config_crtbeginp.patch
1447 - 35_all_gcc46_config_crtbegints.patch
1448 U 10_all_gcc45_configure.patch
1449 U 12_all_gcc46_Makefile.in.patch
1450 + 11_all_gcc45_config.in.patch
1451 - 11_all_gcc44_config.in.patch
1452 + 30_all_gcc45_esp.h.patch
1453 - 30_all_gcc44_esp.h.patch
1454 0.4.9 09 Nov 2011
1455 U 12_all_gcc46_Makefile.in.patch
1456 0.4.8 26 Mar 2011
1457 U 22_all_gcc46-default-ssp.patch
1458 0.4.7 05 Mar 2011
1459 U 20_all_gcc46_gcc.c.patch
1460 + 22_all_gcc46-default-ssp.patch
1461 - 30_all_gcc46_esp.h.patch
1462 + 30_all_gcc44_esp.h.patch
1463 U 33_all_gcc46_config_rs6000_linux64.h.patch
1464 U 35_all_gcc46_config_crtbegints.patch
1465 0.4.6 07 Jan 2011
1466 + 12_all_gcc46_Makefile.in.patch
1467 - 12_all_gcc44_Makefile.in.patch
1468 + 20_all_gcc46_gcc.c.patch
1469 - 20_all_gcc44_gcc.c.patch
1470 + 30_all_gcc46_esp.h.patch
1471 - 30_all_gcc44_esp.h.patch
1472 + 33_all_gcc46_config_rs6000_linux64.h.patch
1473 - 33_all_gcc45_config_rs6000_linux64.h.patch
1474 + 35_all_gcc46_config_crtbegints.patch
1475 - 35_all_gcc44_config_crtbegints.patch
1476 - 40_all_gcc44_obj_lang-specs.h.patch
1477 - 40_all_gcc44_objp_lang-specs.h.patch
1478 - 40_all_gcc44_cp_lang-specs.h.patch
1479 0.4.5 18 Jun 2010
1480 U 35_all_gcc44_config_crtbegints.patch
1481 0.4.4 26 May 2010
1482 U 30_all_gcc44_esp.h.patch
1483 0.4.3 26 May 2010
1484 U 20_all_gcc44_gcc.c.patch
1485 U 30_all_gcc44_esp.h.patch
1486 0.4.2 24 May 2010
1487 U 10_all_gcc44_configure.patch
1488 U 12_all_gcc44_Makefile.in.patch
1489 U 11_all_gcc44_config.in.patch
1490 U 30_all_gcc44_esp.h.patch
1491 0.4.1 29 Apr 2010
1492 U 10_all_gcc45_configure.patch
1493 U 12_all_gcc45_Makefile.in.patch
1494 U 11_all_gcc44_config.in.patch
1495 U 30_all_gcc44_esp.h.patch
1496
1497 0.4.0 19 Apr 2010
1498 U 10_all_gcc45_configure.patch
1499 U 12_all_gcc45_Makefile.in.patch
1500 U 11_all_gcc44_config.in.patch
1501 U 20_all_gcc45_gcc.c.patch
1502 - 30_all_gcc44_espf.h.patch
1503 + 30_all_gcc44_esp.h.patch
1504
1505 0.3.9 14 Apr 2010
1506 U 10_all_gcc45_configure.patch
1507 - 50_all_gcc44_no_ssp_tls_uclibc.patch
1508 U 33_all_gcc45_config_rs6000_linux64.h.patch
1509
1510 0.3.8 10 Apr 2010
1511 10_all_gcc44_configure.patch
1512 11_all_gcc44_config.in.patch
1513 20_all_gcc44_gcc.c.patch
1514 30_all_gcc44_espf.h.patch
1515
1516 0.3.7 10 Feb 2010
1517 20_all_gcc44_gcc.c.patch
1518 30_all_gcc44_espf.h.patch
1519 10_all_gcc44_configure.patch
1520
1521 0.3.6 23 Dec 2009
1522 - 10_all_gcc44_configure.patch
1523 + 10_all_gcc44_configure.patch
1524 - 30_all_gcc44_espf.h.patch
1525 + 30_all_gcc44_espf.h.patch
1526 - README.Changelog
1527 + README.Changelog
1528 - README.history
1529 + README.history
1530 - README
1531 + README
1532
1533 0.3.5 24 Sep 2009
1534 - 30_all_gcc44_espf.h.patch
1535 + 30_all_gcc44_espf.h.patch
1536 - 35_all_gcc44_config_crtbegints.patch
1537 + 35_all_gcc44_config_crtbegints.patch
1538 + 33_all_gcc44_config_rs6000_linux64.h.patch
1539 - README.Changelog
1540 + README.Changelog
1541 - README.history
1542 + README.history
1543 + README.Gentoo.patches
1544
1545 0.3.4 11 Sep 2009
1546 - 10_all_gcc44_configure.patch
1547 + 10_all_gcc44_configure.patch
1548 - 11_all_gcc44_config.in.patch
1549 + 11_all_gcc44_config.in.patch
1550 - 12_all_gcc44_Makefile.in.patch
1551 + 12_all_gcc44_Makefile.in.patch
1552 - 20_all_gcc44_gcc.c.patch
1553 + 20_all_gcc44_gcc.c.patch
1554 - 23_all_gcc44_opts.c.patch
1555 - 30_all_gcc44_espf.h.patch
1556 + 30_all_gcc44_espf.h.patch
1557 + 35_all_gcc44_config_crtbegints.patch
1558 + 60_all_gcc44_invoke.texi.patch
1559 - README.Changelog
1560 + README.Changelog
1561 - README.history
1562 + README.history
1563 - README
1564 + README
1565
1566 0.3.3 14 Aug 2009
1567 - 23_all_gcc44_opts.c.patch
1568 + 23_all_gcc44_opts.c.patch
1569
1570 0.3.2 09 Aug 2009
1571 + 50_all_gcc44_no_ssp_tls_uclibc.patch
1572 + README.Changelog
1573 + README.history
1574 - 23_all_gcc44_opts.c.patch
1575 + 23_all_gcc44_opts.c.patch
1576 - 30_all_gcc44-espf.h.patch
1577 + 30_all_gcc44-espf.h.patch
1578
1579 0.3.1 23 Jul 2009
1580 - 10_all_gcc44_configure.patch
1581 + 10_all_gcc44_configure.patch
1582
1583 0.3.0 23 Jul 2009
1584 - 10_all_gcc44_configure.patch
1585 + 10_all_gcc44_configure.patch
1586 - 11_all_gcc44_config.in.patch
1587 + 11_all_gcc44_config.in.patch
1588 - 12_all_gcc44_Makefile.in.patch
1589 + 12_all_gcc44_Makefile.in.patch
1590 - 20_all_gcc44_gcc.c.patch
1591 + 20_all_gcc44_gcc.c.patch
1592 + 40_all_gcc44_obj_lang-specs.h.patch
1593 + 40_all_gcc44_objp_lang-specs.h.patch
1594 + 40_all_gcc44_cp_lang-specs.h.patch
1595 - 50_all_gcc44_gentoo_v20090614.1.patch
1596 - 30_all_gcc44-espf.h.patch
1597 + 30_all_gcc44-espf.h.patch
1598
1599 0.2.9 14 Jun 2009
1600 - 12_all_gcc44_Makefile.in.patch
1601 + 12_all_gcc44_Makefile.in.patch
1602 - 30_all_gcc44-espf.h.patch
1603 + 30_all_gcc44-espf.h.patch
1604 - 50_all_gcc44_gentoo_v20090612.2.patch
1605 + 50_all_gcc44_gentoo_v20090614.1.patch
1606
1607 0.2.8 12 Jun 2009
1608 - 10_all_gcc44_configure.patch
1609 + 10_all_gcc44_configure.patch
1610 - 11_all_gcc44_config.in.patch
1611 + 11_all_gcc44_config.in.patch
1612 - 12_all_gcc44_Makefile.in.patch
1613 + 12_all_gcc44_Makefile.in.patch
1614 - 22_all_gcc44-toplev.c.patch
1615 - 25_all_gcc44-espf.h.patch
1616 + 30_all_gcc44-espf.h.patch
1617 + 50_all_gcc44_gentoo_v20090612.2.patch
1618
1619 0.2.7 29 May 2009
1620 - 11_all_gcc44_config.in.patch
1621 + 11_all_gcc44_config.in.patch
1622 - 12_all_gcc44_Makefile.in.patch
1623 + 12_all_gcc44_Makefile.in.patch
1624 - 20_all_gcc44_gcc.c.patch
1625 + 20_all_gcc44_gcc.c.patch
1626 + 23_all_gcc44_opts.c.patch
1627 - 25_all_gcc44-espf.h.patch
1628 + 25_all_gcc44-espf.h.patch
1629 - 30_all_gcc44-config-defaul-linux.patch
1630
1631 0.2.6 28 May 2009
1632 + 22_all_gcc44-toplev.c.patch
1633 - 25_all_gcc44-espf.h.patch
1634 + 25_all_gcc44-espf.h.patch
1635 - 30_all_gcc44-config-defaul-linux.patch
1636 + 30_all_gcc44-config-defaul-linux.patch
1637
1638 0.2.5 27 May 2009
1639 - 10_all_gcc44_configure.patch
1640 + 10_all_gcc44_configure.patch
1641 - 12_all_gcc44_Makefile.in.patch
1642 + 12_all_gcc44_Makefile.in.patch
1643 - 20_all_gcc44_gcc.c.patch
1644 + 20_all_gcc44_gcc.c.patch
1645 - 25_all_gcc44-espf.h.patch
1646 + 25_all_gcc44-espf.h.patch
1647 - 30_all_gcc44-config-defaul-linux.patch
1648 + 30_all_gcc44-config-defaul-linux.patch
1649 - 40_all_gcc44-gentoo.patch
1650
1651 0.2.4 08 May 2009
1652 - 12_all_gcc44_Makefile.in.patch
1653 + 12_all_gcc44_Makefile.in.patch
1654
1655 0.2.3 08 May 2009
1656 - 20_all_gcc44_gcc.c.patch
1657 + 20_all_gcc44_gcc.c.patch
1658 - 40_all_gcc44-gentoo.patch
1659 + 40_all_gcc44-gentoo.patch
1660
1661 0.2.2 04 May 2009
1662 + 10_all_gcc44_configure.patch
1663 + 11_all_gcc44_config.in.patch
1664 + 12_all_gcc44_Makefile.in.patch
1665 + 20_all_gcc44_gcc.c.patch
1666 + 21_all_gcc44_decl-tls-model.patch
1667 + 25_all_gcc44-espf.h.patch
1668 + 30_all_gcc44-config-defaul-linux.patch
1669 + 40_all_gcc44-gentoo.patch
1670 - 01_all_gcc44-configure.patch
1671 - 10_all_gcc44-gcc_configure.patch
1672 - 11_all_gcc44-gcc_config.in.patch
1673 - 12_all_gcc44-gcc_config.gcc.patch
1674 - 13_all_gcc44-gcc_Makefile.in.patch
1675 - 15_all_gcc44-libgcc_config.host.patch
1676 - 16_all_gcc44-libgcc_configure.patch
1677 - 17_all_gcc44-libgcc_Makefile.in.patch
1678 - 21_all_gcc44-gcc_espf.h.patch
1679 - 22_all_gcc44-gcc_gcc.c.patch
1680 - 23_all_gcc44-gcc_varasm.c.patch
1681 - 30_all_gcc44-add-crt-start-endfiles-linux.patch
1682
1683 0.2.1 28 Apr 2009
1684 + 01_all_gcc44-configure.patch
1685 + 10_all_gcc44-gcc_configure.patch
1686 + 11_all_gcc44-gcc_config.in.patch
1687 + 12_all_gcc44-gcc_config.gcc.patch
1688 + 13_all_gcc44-gcc_Makefile.in.patch
1689 + 15_all_gcc44-libgcc_config.host.patch
1690 + 16_all_gcc44-libgcc_configure.patch
1691 + 17_all_gcc44-libgcc_Makefile.in.patch
1692 + 21_all_gcc44-gcc_espf.h.patch
1693 + 22_all_gcc44-gcc_gcc.c.patch
1694 + 23_all_gcc44-gcc_varasm.c.patch
1695 + 30_all_gcc44-add-crt-start-endfiles-linux.patch
1696 - 00_all_gcc4.4-cvs-incompat.patch
1697 - 05_all_gcc4.4-compile-no-ssp.patch
1698 - 10_all_gcc4.4-hardened-minispecs-support.patch
1699 - 11_all_gcc4.4-decl-tls-model.patch
1700 - 12_all_gcc4.4-fortify-minispecs-support.patch
1701 - 20-all_gcc4.4-default-crt-start-endfile.patch
1702 - 30-all_gcc4.4-crtbeginTS-fno-PIE.patch
1703
1704 0.1.0 16 Apr 2009
1705 + 00_all_gcc4.4-cvs-incompat.patch
1706 + 05_all_gcc4.4-compile-no-ssp.patch
1707 + 10_all_gcc4.4-hardened-minispecs-support.patch
1708 + 11_all_gcc4.4-decl-tls-model.patch
1709 + 12_all_gcc4.4-fortify-minispecs-support.patch
1710 + 20-all_gcc4.4-default-crt-start-endfile.patch
1711 + 30-all_gcc4.4-crtbeginTS-fno-PIE.patch