diff options
author | 2010-05-26 22:36:56 +0200 | |
---|---|---|
committer | 2010-05-26 22:36:56 +0200 | |
commit | 291d6e5481a9b5fda2885f9864132caa52f11393 (patch) | |
tree | 53e7b49b1190918301d28536f8e22112890c5815 /gcc-4.5.0/piepatch | |
parent | Updated the README in warntrampolines (diff) | |
download | hardened-gccpatchset-291d6e5481a9b5fda2885f9864132caa52f11393.tar.gz hardened-gccpatchset-291d6e5481a9b5fda2885f9864132caa52f11393.tar.bz2 hardened-gccpatchset-291d6e5481a9b5fda2885f9864132caa52f11393.zip |
Updated all to 0.4.3
Diffstat (limited to 'gcc-4.5.0/piepatch')
-rw-r--r-- | gcc-4.5.0/piepatch/10_all_gcc45_configure.patch | 218 | ||||
-rw-r--r-- | gcc-4.5.0/piepatch/11_all_gcc44_config.in.patch | 24 | ||||
-rw-r--r-- | gcc-4.5.0/piepatch/12_all_gcc45_Makefile.in.patch | 9 | ||||
-rw-r--r-- | gcc-4.5.0/piepatch/20_all_gcc45_gcc.c.patch | 13 | ||||
-rw-r--r-- | gcc-4.5.0/piepatch/30_all_gcc44_esp.h.patch | 48 | ||||
-rw-r--r-- | gcc-4.5.0/piepatch/README.Changelog | 20 | ||||
-rw-r--r-- | gcc-4.5.0/piepatch/README.history | 8 |
7 files changed, 72 insertions, 268 deletions
diff --git a/gcc-4.5.0/piepatch/10_all_gcc45_configure.patch b/gcc-4.5.0/piepatch/10_all_gcc45_configure.patch index a6ffbb4..39893f3 100644 --- a/gcc-4.5.0/piepatch/10_all_gcc45_configure.patch +++ b/gcc-4.5.0/piepatch/10_all_gcc45_configure.patch @@ -1,40 +1,36 @@ -2010-04-25 Magnus Granberg <zorry@gentoo.org>, Anthony G. Basile <basile@opensource.dyc.edu> +2010-05-25 Magnus Granberg <zorry@gentoo.org>, Anthony G. Basile <basile@opensource.dyc.edu> * configure Add --enable-esp. Add-fno-stack-protector to stage1_cflags. * gcc/configure Add --enable-esp. Check -z now and -z relro. - Check if we support -fstack-protector and define HAVE_GCC_SSP. - Check if we support -fPIE and -pie and define HAVE_GCC_LD_PIE. Define ENABLE_ESP. Check if we support crtbeginTS and define ENABLE_CRTBEGINTS. * libmudflap/configure Add AC_SUBST enable_esp. + --- configure 2010-01-31 13:12:21.000000000 -0500 +++ configure 2010-02-07 14:29:51.000000000 -0500 @@ -707,6 +707,7 @@ CFLAGS CC target_subdir -+enable_esp_set ++enable_esp host_subdir build_subdir build_libsubdir -@@ -934,6 +934,14 @@ +@@ -934,6 +934,11 @@ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-gold use gold instead of ld --enable-libada build libada directory -+ --enable-esp[=all] ++ --enable-esp + Enable Stack protector, Position independent executable as + default if we have suppot for it when compiling + and link with -z relro and -z now as default. -+ --enable-esp=all will enable SSP and PIE -+ --enable-esp=nossp will disable SSP -+ --enable-esp=nopie will disable PIE + Linux targets supported i*86, x86_64, powerpc, powerpc64, ia64 and arm --enable-libssp build libssp directory --disable-ppl-version-check disable check for PPL version --disable-cloog-version-check disable check for CLooG version -@@ -2145,6 +2153,30 @@ +@@ -2145,6 +2150,25 @@ noconfigdirs="$noconfigdirs gnattools" fi @@ -44,13 +40,8 @@ + enableval="$enable_esp" + + case $target in -+ i?86*-*-linux* | x86_64*-*-linux* | powerpc-*-linux* | powerpc64-*-linux* | arm*-*-linux* | ia64-*-linux* | mips*-*-linux*) -+ case ,${enable_esp}, in -+ ,,) -+ enable_esp_set=no ;; -+ ,nopie,|,nossp,|,all,) -+ enable_esp_set=yes ;; -+ esac ++ i?86*-*-linux* | x86_64*-*-linux* | powerpc-*-linux* | powerpc64-*-linux* | arm*-*-linux* | ia64-*-linux*) ++ enable_esp=yes + ;; + *) + { { echo "$as_me:$LINENO: error: *** --enable-esp is not supported on this $target target." >&5 @@ -69,7 +60,7 @@ *) stage1_cflags="-g -J" ;; esac ;; esac -+if test x$enable_esp_set = xyes; then ++if test x$enable_esp = xyes; then + stage1_cflags="$stage1_cflags -fno-stack-protector" +fi @@ -81,7 +72,7 @@ HOST_LIBS GGC libgcc_visibility -+enable_esp_set ++enable_esp +enable_crtbeginTS gcc_cv_readelf gcc_cv_objdump @@ -137,188 +128,11 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker --build-id support" >&5 $as_echo_n "checking linker --build-id support... " >&6; } if test "${gcc_cv_ld_buildid+set}" = set; then : -@@ -24411,6 +23745,253 @@ +@@ -24411,6 +23745,74 @@ fi -+# Check whether --enable-esp=(no|nopie|nossp|all) was given. -+# Check whether --enable-esp or --disable-esp was given. -+if test "${enable_esp+set}" = set; then -+ enableval="$enable_esp" -+ -+ case ,${enable_esp}, in -+ ,no,|,,) -+ enable_esp_set=no -+ enable_esp_pie=no -+ enable_esp_ssp=no -+ ;; -+ ,nopie,) -+ enable_esp_set=yes -+ enable_esp_pie=no -+ enable_esp_ssp=yes -+ ;; -+ ,nossp,) -+ enable_esp_set=yes -+ enable_esp_pie=yes -+ enable_esp_ssp=no -+ ;; -+ ,all,) -+ enable_esp_set=yes -+ enable_esp_pie=yes -+ enable_esp_ssp=yes -+ ;; -+ esac -+ -+fi; -+ -+ -+if test x$gcc_cv_libc_provides_ssp = xyes; then -+ echo "$as_me:$LINENO: checking whether $CC support -fstack-protector" >&5 -+echo $ECHO_N "checking whether $CC support -fstack-protector... $ECHO_C" >&6 -+if test "${gcc_cv_cc_stack_protector+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ -+ saved_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS -fstack-protector" -+ cat >conftest.$ac_ext <<_ACEOF -+#ifndef __SSP__ -+#error -+#endif -+int -+main() { -+return 0 ; -+} -+ -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+ case $target in -+ i?86*-*-linux* | x86_64*-*-linux* | powerpc-*-linux* | powerpc64-*-linux*) -+ if test x$set_have_as_tls = xyes; then -+ gcc_cv_cc_stack_protector=yes -+ else -+ gcc_cv_cc_stack_protector=no -+ fi -+ ;; -+ *) -+ cc_cv_cc_stack_protector=yes -+ ;; -+ esac -+ -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gcc_cv_cc_stack_protector=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ CFLAGS="$saved_CFLAGS" -+ -+fi -+echo "$as_me:$LINENO: result: $gcc_cv_cc_stack_protector" >&5 -+echo "${ECHO_T}$gcc_cv_cc_stack_protector" >&6 -+fi -+if test x$gcc_cv_cc_stack_protector = xyes && test x$enable_esp_ssp = xyes; then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_GCC_SSP 1 -+_ACEOF -+ -+ enable_esp_default_ssp=yes -+ echo "$as_me:$LINENO: result: Adding -fstack-protector as default compiler options... $enable_esp_default_ssp" >&5 -+echo "${ECHO_T}Adding -fstack-protector as default compiler options... $enable_esp_default_ssp" >&6 -+fi -+ -+if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_pic_works = xyes; then -+ echo "$as_me:$LINENO: checking whether $CC support -fPIE and link with -pie" >&5 -+echo $ECHO_N "checking whether $CC support -fPIE and and link with -pie... $ECHO_C" >&6 -+if test "${gcc_cv_cc_ld_pie+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ -+ saved_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS -fPIE -pie" -+ cat >conftest.$ac_ext <<_ACEOF -+#ifndef __PIE__ -+#error -+#endif -+int -+main() { -+ return 0; -+} -+ -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ gcc_cv_cc_ld_pie=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gcc_cv_cc_ld_pie=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ CFLAGS="$saved_CFLAGS" -+ -+fi -+echo "$as_me:$LINENO: result: $gcc_cv_cc_ld_pie" >&5 -+echo "${ECHO_T}$gcc_cv_cc_ld_pie" >&6 -+fi -+if test x$gcc_cv_cc_ld_pie = xyes && test x$enable_esp_pie = xyes; then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_GCC_LD_PIE 1 -+_ACEOF -+ -+ enable_esp_default_pie=yes -+ echo "$as_me:$LINENO: result: Adding -fPIE as default compiler options and -pie as default linking options... $enable_esp_default_pie" >&5 -+echo "${ECHO_T}Adding -fPIE as default compiler options and -pie as default linking options... $enable_esp_default_pie" >&6 -+fi -+if test x$enable_esp_set = xyes ; then ++if test x$enable_esp = xyes ; then +case $target in + ia64*-*-linux*) + if test x$gcc_cv_ld_now = xyes; then @@ -347,10 +161,8 @@ +#define ENABLE_ESP 1 +_ACEOF + -+ enable_esp_default_nowrelro=yes -+ echo "$as_me:$LINENO: result: Adding -z now and -z relro as default linking options... $enable_esp_default_nowrelro" >&5 -+echo "${ECHO_T}Adding -z now and -z relro as default linking options... $enable_esp_default_nowrelro" >&6 +fi ++ +if test x$enable_esp = xyes && test x$enable_esp_ld = xno; then + { { echo "$as_me:$LINENO: error: *** --enable-esp is not supported. You don't have -z,relro or -z,now support in the linker." >&5 +echo "$as_me: error: *** --enable-esp is not supported. You don't have -z,relro or -z,now support in the linker." >&2;} @@ -363,12 +175,12 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + -+if test x$enable_esp_set = xyes ; then ++if test x$enable_esp = xyes ; then + case "$target" in + ia64*-*-linux*) + enable_crtbeginTS=no ;; + *-*-linux*) -+ if test x$enable_esp_default_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then ++ if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then + enable_crtbeginTS=yes + fi + ;; diff --git a/gcc-4.5.0/piepatch/11_all_gcc44_config.in.patch b/gcc-4.5.0/piepatch/11_all_gcc44_config.in.patch index efab612..3e49f03 100644 --- a/gcc-4.5.0/piepatch/11_all_gcc44_config.in.patch +++ b/gcc-4.5.0/piepatch/11_all_gcc44_config.in.patch @@ -1,7 +1,6 @@ -2010-04-22 Magnus Granberg <zorry@gentoo.org> +2010-05-24 Magnus Granberg <zorry@gentoo.org> - * gcc/config.in Add ENABLE_CRTBEGINTS ENABLE_ESP and - HAVE_GCC_SSP HAVE_GCC_LD_PIE + * gcc/config.in Add ENABLE_CRTBEGINTS and ENABLE_ESP --- gcc/config.in 2009-04-21 11:08:08.000000000 +0200 +++ gcc/config.in 2009-05-12 00:10:08.000000000 +0200 @@ -31,22 +30,3 @@ /* Define to 1 to enable fixed-point arithmetic extension to C. */ #ifndef USED_FOR_TARGET #undef ENABLE_FIXED_POINT -@@ -912,6 +924,18 @@ - #endif - - -+/* Define if your compiler supports SSP */ -+#ifndef USED_FOR_TARGET -+#undef HAVE_GCC_SSP -+#endif -+ -+ -+/* Define if your compiler and linker supports PIE */ -+#ifndef USED_FOR_TARGET -+#undef HAVE_GCC_LD_PIE -+#endif -+ -+ - /* Define to 1 if you have the `getchar_unlocked' function. */ - #ifndef USED_FOR_TARGET - #undef HAVE_GETCHAR_UNLOCKED diff --git a/gcc-4.5.0/piepatch/12_all_gcc45_Makefile.in.patch b/gcc-4.5.0/piepatch/12_all_gcc45_Makefile.in.patch index 418a267..6700f50 100644 --- a/gcc-4.5.0/piepatch/12_all_gcc45_Makefile.in.patch +++ b/gcc-4.5.0/piepatch/12_all_gcc45_Makefile.in.patch @@ -1,7 +1,6 @@ 2010-04-25 Magnus Granberg <zorry@gentoo.org> Anthony G. Basile <basile@opensource.dyc.edu> - * Makefile.in We add -fno-stack-protector to - BOOT_CFLAGS, LIBCFLAGS and LIBCXXFLAGS if enable_esp yes. + * Makefile.in We add -fno-stack-protector to BOOT_CFLAGS, LIBCFLAGS and LIBCXXFLAGS if enable_esp yes. * gcc/Makefile.in Add -fno-PIE and -fno-stack-protector. Libgcc2 doesn't compile with -fstack-protector. Crtstuff doesn't compile with -fPIE and -fstack-protector. @@ -24,7 +23,7 @@ BUILD_PREFIX_1 = @BUILD_PREFIX_1@ +# Some stuff don't compile with SSP -+enable_esp = @enable_esp_set@ ++enable_esp = @enable_esp@ +ifeq ($(enable_esp),yes) +ESP_NOSSP_CFLAGS = -fno-stack-protector +else @@ -58,7 +57,7 @@ +# We don't want __stack_chk_fail in crt* and libgcc2.a. +# We don't want to compile crtbegin, crtend and crtbeginT with -fPIE. -+enable_esp = @enable_esp_set@ ++enable_esp = @enable_esp@ +ifeq ($(enable_esp),yes) +ESP_NOPIE_CFLAGS = -fno-PIE +ESP_NOSSP_CFLAGS = -fno-stack-protector @@ -184,7 +183,7 @@ +# Some stuff don't compile with SSP and FORTIFY_SOURCE +enable_esp = @enable_esp@ -+ifdef enable_esp ++ifeq ($(enable_esp),yes) + NO_ESP_CFLAGS = -fno-stack-protector -U_FORTIFY_SOURCE +else + NO_ESP_CFLAGS = diff --git a/gcc-4.5.0/piepatch/20_all_gcc45_gcc.c.patch b/gcc-4.5.0/piepatch/20_all_gcc45_gcc.c.patch index 1783de5..714f3d4 100644 --- a/gcc-4.5.0/piepatch/20_all_gcc45_gcc.c.patch +++ b/gcc-4.5.0/piepatch/20_all_gcc45_gcc.c.patch @@ -1,8 +1,7 @@ -2010-04-19 Magnus Granberg <zorry@gentoo.org>, Anthony G. Basile <basile@opensource.dyc.edu> +2010-05-26 Magnus Granberg <zorry@gentoo.org>, Anthony G. Basile <basile@opensource.dyc.edu> * gcc/gcc.c include esp.h static const char *cc1_spec We set that in esp.h if ENABLE_ESP. - *cc1_options Add espf_options_pie_check if ENABLE_ESP. #ifdef EXTRA_SPECS: Add ESP_EXTRA_SPECS main(): Add do_self_spec esp_command_options_spec() @@ -44,16 +43,6 @@ /* This contains cpp options which are not passed when the preprocessor output will be used by another program. */ -@@ -893,6 +896,9 @@ - - /* NB: This is shared amongst all front-ends, except for Ada. */ - static const char *cc1_options = -+#ifdef ENABLE_ESP -+"%(esp_options_pie_check)" -+#endif - "%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ - %1 %{!Q:-quiet} %{!dumpbase:-dumpbase %B} %{d*} %{m*} %{a*}\ - %{fcompare-debug-second:%:compare-debug-auxbase-opt(%b)} \ @@ -1075,15 +1081,15 @@ %{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \ %(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\ diff --git a/gcc-4.5.0/piepatch/30_all_gcc44_esp.h.patch b/gcc-4.5.0/piepatch/30_all_gcc44_esp.h.patch index 1abec0b..e5e9700 100644 --- a/gcc-4.5.0/piepatch/30_all_gcc44_esp.h.patch +++ b/gcc-4.5.0/piepatch/30_all_gcc44_esp.h.patch @@ -1,13 +1,13 @@ -2010-04-29 Magnus Granberg <zorry@gentoo.org> +2010-05-26 Magnus Granberg <zorry@gentoo.org> * gcc/esp.h New file to support --enable-esp - Version 20100429.1 + Version 20100526.1 --- gcc/esp.h 2010-04-09 16:14:00.000000000 +0200 +++ gcc/esp.h 2010-04-29 21:30:47.000000000 +0200 -@@ -0,0 +1,147 @@ +@@ -0,0 +1,145 @@ +/* License terms see GNU GENERAL PUBLIC LICENSE Version 3. -+ * Version 20100429.1 ++ * Version 20100526.1 + * Magnus Granberg (Zorry) <zorry@gentoo.org> */ +#ifndef GCC_ESP_H +#define GCC_ESP_H @@ -20,19 +20,19 @@ + -D__KERNEL__ is added so we don't have -fPIE, -pie and -fstack-protector-all when building kernels. + ESP_CC1_SPEC is added to CC1_SPEC. + ESP_CC1_STRICT_SPEC is added so we don't disable the strict-overflow check. -+ ESP_OPTIONS_PIE_CHECK_SPEC check for -pie, -p, -pg, -profile, -static and -shared. ++ ESP_OPTIONS_PIE_CHECK_SPEC check for -pie, -p, -pg, -profile and -static. + ENABLE_CRTBEGINTS add support for crtbeginTS.o, build -static with -fPIE or -fpie. +*/ +#ifdef ENABLE_ESP + + /* Hack to support gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass */ + #define ESP_CC1_SPEC " %(esp_cc1_ssp) %(esp_cc1_pie) %(esp_cc1_strict)" -+ #ifdef HAVE_GCC_SSP ++ #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP ) + #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: }}" + #else + #define ESP_CC1_SSP_SPEC "" + #endif -+ #ifdef HAVE_GCC_LD_PIE ++ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP ) + #define ESP_CC1_PIE_SPEC "%{!nopie: }" + #else + #define ESP_CC1_PIE_SPEC "" @@ -40,9 +40,10 @@ + #define ESP_CC1_STRICT_SPEC "%{!fstrict-overflow:%{!fno-strict-overflow: -fno-strict-overflow}}" + + /* ESP_LINK_SPEC is added to LINK_PIE_SPEC if esp is enable -+ -z now will be added if we don't have -vanilla spec */ -+ #define ESP_LINK_SPEC "%(esp_link_now)" -+ #define ESP_LINK_NOW_SPEC "%{!now:-z now}" ++ -z now will be added if we don't have -vanilla spec. We do a -pie incompatible check ++ Don't remove the specs in the end */ ++ #define ESP_LINK_SPEC "%(esp_link_now) %(esp_options_pie_check) " ++ #define ESP_LINK_NOW_SPEC "%{!nonow:-z now}" + + /* We use ESP_COMMAND_OPTIONS_SPEC to add pie command-line options. */ + #define ESP_COMMAND_OPTIONS_SPEC "%{!D__KERNEL__:%{!nopie:%(esp_options_pie) %(esp_link_pie)}}" @@ -55,8 +56,8 @@ + #define ESP_CPP_OPTIONS_SPEC "%(esp_options_ssp)" + + /* This will add -fstack-protector-all if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector -+ -fstack-protector-all and we have HAVE_GCC_SSP defined. */ -+ #ifdef HAVE_GCC_SSP ++ -fstack-protector-all and we have EFAULT_SSP or EFAULT_PIE_SSP defined. */ ++ #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP ) + #define ESP_OPTIONS_SSP_SPEC \ + "%{!D__KERNEL__:%{!nostdlib:%{!nodefaultlibs: %{!fno-stack-protector: \ + %{!fstack-protector:%{!fstack-protector-all:-fstack-protector-all}}}}}}" @@ -64,8 +65,8 @@ + #define ESP_OPTIONS_SSP_SPEC "" + #endif + -+ /* If HAVE_GCC_LD_PIE not defined we will not add any -fPIE -pie */ -+ #ifdef HAVE_GCC_LD_PIE ++ /* If EFAULT_PIE or EFAULT_PIE_SSP is defined we will add -fPIE -pie */ ++ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP ) + + /* This will add -fPIE if we don't have -pie -fpic -fPIC -fpie -fPIE -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static + -nostdlib -nostartfiles. */ @@ -94,32 +95,29 @@ + %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}}" + #endif + -+ /* This will check if shared is set when -static -pie -fPIE -fpie -fno-PIC -fno-pic, -pie is set when -static -pg -p -profile. -+ If set it will make gcc print out "-shared and -static|pie|fPIE|fpie|fno-PIC|fno-pic are incompatible" or -+ "-pie and pg|p|profile are incompatible" */ ++ /* This will check if -pie is set when (-static) -pg -p -profile. If set it will make gcc print out ++ "-pie and (static)|pg|p|profile are incompatible when linking" */ + /* With ENABLE_CRTBEGINTS we don't need to check for -static */ + #ifdef ENABLE_CRTBEGINTS + #define ESP_OPTIONS_PIE_CHECK_SPEC \ -+ "%{shared:%{static|pie|fPIE|fpie|fno-PIC|fno-pic:%e-shared and -static|pie|fPIE|fpie|fno-PIC|fno-pic are incompatible}} \ -+ %{pie:%{pg|p|profile:%e-pie and -pg|p|profile are incompatible}}" ++ "%{pie:%{pg|p|profile:%e-pie and -pg|p|profile are incompatible when linking}}" + #else + #define ESP_OPTIONS_PIE_CHECK_SPEC \ -+ "%{shared:%{static|pie|fPIE|fpie|fno-PIC|fno-pic:%e-shared and -static|pie|fPIE|fpie|fno-PIC|fno-pic are incompatible}} \ -+ %{pie:%{static|pg|p|profile:%e-pie and -static|pg|p|profile are incompatible}}" ++ "%{pie:%{static|pg|p|profile:%e-pie and -static|pg|p|profile are incompatible when linking}}" + #endif + -+ /* We don't pass -pie to the linker when -static */ ++ /* We don't pass -pie to the linker when -static. */ + #ifdef ENABLE_CRTBEGINTS -+ #define LINK_PIE_SPEC "%{!static:%{pie:-pie}} %(esp_link) " ++ #define LINK_PIE_SPEC "%{!static:%{pie:-pie}} %(esp_link)" + #else -+ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link) " ++ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)" + #endif + + #else + #define ESP_OPTIONS_PIE_SPEC "" + #define ESP_OPTIONS_PIE_CHECK_SPEC "" + #define ESP_LINK_PIE_SPEC "" -+ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link) " ++ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)" + #endif + + /* We add extra spec name's to the EXTRA_SPECS list */ diff --git a/gcc-4.5.0/piepatch/README.Changelog b/gcc-4.5.0/piepatch/README.Changelog index 37fbc3f..302ed6b 100644 --- a/gcc-4.5.0/piepatch/README.Changelog +++ b/gcc-4.5.0/piepatch/README.Changelog @@ -1,3 +1,21 @@ +0.4.3 Magnus Granberg <zorry@gentoo.org> + + #299061 b.g.o + * gcc/gcc.c removed the pie incompatible specs rule call + * gcc/esp.h Move the -pie incompatible check to esp_link + remove the -shared incompatible check + +0.4.2 Magnus granberg <zorry@gentoo.org> + + * configure remove the changes from 0.4.1 + * Makefile.in remove the changes from 0.4.1 remove -fstack-protector check. + * gcc/configure remove the changes from 0.4.1 + * gcc/config.in remove the changes from 0.4.1 remove HAVE_GCC_SSP + * gcc/Makefile remove the changes from 0.4.1 + * gcc/esp.h change HAVE_GCC_LD_PIE to (EFAULT_PIE || EFAULT_PIE_SSP) + change HAVE_GCC_SSP to (EFAULT_SSP || EFAULT_PIE_SSP) + * libmudflap/Makefiles.in remove the changes from 0.4.1 + 0.4.1 Magnus Granberg <zorry@gentoo.org> *configure removed check for --enable-esp removed enable_esp @@ -9,7 +27,7 @@ -fstack-protector check. * gcc/config.in Added HAVE_GCC_LD_PIE *gcc/Makefile.in renamed enable_esp to enable_esp_set - *gcc/esp Renamed HAVE_LD_PIE to HAVE_GCC_LD_PIE + *gcc/esp.h Renamed HAVE_LD_PIE to HAVE_GCC_LD_PIE Added HAVE_GCC_LD_PIE to #define ESP_CC1_PIE_SPEC. Move ESP_COMMAND_OPTIONS_SPEC * libmudflap/Makefiles.in In enable_esp change ifeq to ifdef. diff --git a/gcc-4.5.0/piepatch/README.history b/gcc-4.5.0/piepatch/README.history index 8ed2d71..319245b 100644 --- a/gcc-4.5.0/piepatch/README.history +++ b/gcc-4.5.0/piepatch/README.history @@ -1,3 +1,11 @@ +0.4.3 26-05-2010 + U 20_all_gcc44_gcc.c.patch + U 30_all_gcc44_esp.h.patch +0.4.2 24-05-2010 + U 10_all_gcc44_configure.patch + U 12_all_gcc44_Makefile.in.patch + U 11_all_gcc44_config.in.patch + U 30_all_gcc44_esp.h.patch 0.4.1 29-04-2010 U 10_all_gcc45_configure.patch U 12_all_gcc45_Makefile.in.patch |