diff options
author | 2012-07-08 23:35:30 +0200 | |
---|---|---|
committer | 2012-07-08 23:35:30 +0200 | |
commit | f75c7f873e548b69686fcff48519d8edb8ddeb32 (patch) | |
tree | 9e498a19f04028d0131911d16aadda69a9f86c79 | |
parent | Fix a typo in the ssp_uclibc_check patch tag 0.5.2 (diff) | |
download | hardened-gccpatchset-f75c7f873e548b69686fcff48519d8edb8ddeb32.tar.gz hardened-gccpatchset-f75c7f873e548b69686fcff48519d8edb8ddeb32.tar.bz2 hardened-gccpatchset-f75c7f873e548b69686fcff48519d8edb8ddeb32.zip |
Updete of the upstrem patches
-rw-r--r-- | gcc-4.6.0/piepatch/10_all_gcc45_configure.patch | 215 | ||||
-rw-r--r-- | gcc-4.6.0/piepatch/20_all_gcc46_gcc.c.patch | 24 | ||||
-rw-r--r-- | gcc-4.6.0/piepatch/README.Changelog | 8 | ||||
-rw-r--r-- | gcc-4.6.0/piepatch/README.history | 8 | ||||
-rw-r--r-- | gcc-4.7.0/piepatch/05_all_gcc47_gcc.c.patch | 18 | ||||
-rw-r--r-- | gcc-4.7.0/piepatch/06_all_gcc46_esp.h.patch | 153 | ||||
-rw-r--r-- | gcc-4.7.0/piepatch/10_all_gcc46_default-ssp.patch | 130 | ||||
-rw-r--r-- | upstream/Makefile.in.patch | 92 | ||||
-rw-r--r-- | upstream/config_all.patch | 32 | ||||
-rw-r--r-- | upstream/config_i386.patch | 41 | ||||
-rw-r--r-- | upstream/configure.ac.patch | 186 | ||||
-rw-r--r-- | upstream/espf-ssp.patch | 130 | ||||
-rw-r--r-- | upstream/gcc.c.patch | 43 |
13 files changed, 267 insertions, 813 deletions
diff --git a/gcc-4.6.0/piepatch/10_all_gcc45_configure.patch b/gcc-4.6.0/piepatch/10_all_gcc45_configure.patch deleted file mode 100644 index a526b00..0000000 --- a/gcc-4.6.0/piepatch/10_all_gcc45_configure.patch +++ /dev/null @@ -1,215 +0,0 @@ -2012-02-14 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. - Define ENABLE_ESP. - Check if we support crtbeginP and define ENABLE_CRTBEGINP. - * 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 - host_subdir - build_subdir - build_libsubdir -@@ -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 -+ 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. -+ 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 +2150,25 @@ - noconfigdirs="$noconfigdirs gnattools" - fi - -+# Check whether --enable-esp was given and target have the support. -+# Check whether --enable-esp or --disable-esp was given. -+if test "${enable_esp+set}" = set; then -+ enableval="$enable_esp" -+ -+ case $target in -+ 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 -+echo "$as_me: error: *** --enable-esp is not supported on this $target target." >&2;} -+ { (exit 1); exit 1; }; } -+ ;; -+ esac -+ -+fi; -+ -+ - # Check whether --enable-libssp was given. - if test "${enable_libssp+set}" = set; then : - enableval=$enable_libssp; ENABLE_LIBSSP=$enableval -@@ -14266,6 +14290,9 @@ - *) stage1_cflags="-g -J" ;; - esac ;; - esac -+if test x$enable_esp = xyes; then -+ stage1_cflags="$stage1_cflags -fno-stack-protector" -+fi - - # This is aimed to mimic bootstrap with a non-GCC compiler to catch problems. - if test "$GCC" = yes -a "$ENABLE_BUILD_WITH_CXX" != yes; then ---- gcc/configure 2010-01-31 10:01:53.000000000 -0500 -+++ gcc/configure 2010-02-07 14:29:56.000000000 -0500 -@@ -678,6 +678,8 @@ - HOST_LIBS - GGC - libgcc_visibility -+enable_esp -+enable_crtbeginP - gcc_cv_readelf - gcc_cv_objdump - ORIGINAL_NM_FOR_TARGET -@@ -24480,6 +24481,50 @@ - ;; - esac - -+echo "$as_me:$LINENO: checking linker -z now support" >&5 -+echo $ECHO_N "checking linker -z now support... $ECHO_C" >&6 -+if test "${gcc_cv_ld_now+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ gcc_cv_ld_now=no -+if test $in_tree_ld = yes ; then -+ 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 \ -+ && test $in_tree_ld_is_elf = yes; then -+ gcc_cv_ld_now=yes -+ fi -+elif test x$gcc_cv_ld != x; then -+ # Check if linker supports -z now options -+ if $gcc_cv_ld --help 2>/dev/null | grep now > /dev/null; then -+ gcc_cv_ld_now=yes -+ fi -+fi -+ -+fi -+echo "$as_me:$LINENO: result: $gcc_cv_ld_now" >&5 -+echo "${ECHO_T}$gcc_cv_ld_now" >&6 -+ -+echo "$as_me:$LINENO: checking linker -z relro support" >&5 -+echo $ECHO_N "checking linker -z relro support... $ECHO_C" >&6 -+if test "${gcc_cv_ld_relro+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ gcc_cv_ld_relro=no -+if test $in_tree_ld = yes ; then -+ 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 \ -+ && test $in_tree_ld_is_elf = yes; then -+ gcc_cv_ld_relro=yes -+ fi -+elif test x$gcc_cv_ld != x; then -+ # Check if linker supports -z relro and -z norelro options -+ if $gcc_cv_ld --help 2>/dev/null | grep relro > /dev/null; then -+ gcc_cv_ld_relro=yes -+ fi -+fi -+ -+fi -+echo "$as_me:$LINENO: result: $gcc_cv_ld_relro" >&5 -+echo "${ECHO_T}$gcc_cv_ld_relro" >&6 -+ - { $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,74 @@ - - fi - -+if test x$enable_esp = xyes ; then -+case $target in -+ ia64*-*-linux*) -+ if test x$gcc_cv_ld_now = xyes; then -+ enable_esp_ld=yes -+ else -+ enable_esp_ld=no -+ fi -+ ;; -+ *-*-linux*) -+ if test x$gcc_cv_ld_relro = xyes && test x$gcc_cv_ld_now = xyes; then -+ enable_esp_ld=yes -+ else -+ enable_esp_ld=no -+ fi -+ ;; -+ *) -+ enable_esp_ld=no -+ ;; -+ esac -+else -+ enable_espf_ld=no -+fi -+if test x$enable_esp_ld = xyes; then -+ -+cat >>confdefs.h <<\_ACEOF -+#define ENABLE_ESP 1 -+_ACEOF -+ -+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;} -+ { (exit 1); exit 1; }; } -+fi -+ -+echo "$as_me:$LINENO: checking for crtbeginP.o support" >&5 -+echo $ECHO_N "checking for crtbeginP.o support... $ECHO_C" >&6 -+if test "${enable_crtbeginP+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ -+if test x$enable_esp = xyes ; then -+ case "$target" in -+ ia64*-*-linux*) -+ enable_crtbeginP=no ;; -+ *-*-linux*) -+ if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then -+ enable_crtbeginP=yes -+ fi -+ ;; -+ *) enable_crtbeginP=no ;; -+ esac -+fi -+ -+fi -+echo "$as_me:$LINENO: result: $enable_crtbeginP" >&5 -+echo "${ECHO_T}$enable_crtbeginP" >&6 -+ -+if test x$enable_crtbeginP = xyes; then -+ -+cat >>confdefs.h <<\_ACEOF -+#define ENABLE_CRTBEGINP 1 -+_ACEOF -+ -+fi -+ - # Check if TFmode long double should be used by default or not. - # Some glibc targets used DFmode long double, but with glibc 2.4 - # and later they can use TFmode. ---- libmudflap/configure 2009-12-05 12:18:53.000000000 -0500 -+++ libmudflap/configure 2010-02-07 14:29:51.000000000 -0500 -@@ -652,6 +652,7 @@ - MAINTAINER_MODE_FALSE - MAINTAINER_MODE_TRUE - am__untar -+enable_esp - am__tar - AMTAR - am__leading_dot diff --git a/gcc-4.6.0/piepatch/20_all_gcc46_gcc.c.patch b/gcc-4.6.0/piepatch/20_all_gcc46_gcc.c.patch index 6f02a11..bb7476c 100644 --- a/gcc-4.6.0/piepatch/20_all_gcc46_gcc.c.patch +++ b/gcc-4.6.0/piepatch/20_all_gcc46_gcc.c.patch @@ -1,12 +1,12 @@ -2011-01-01 Magnus Granberg <zorry@gentoo.org> +2012-06-23 Magnus Granberg <zorry@gentoo.org> * gcc/gcc.c include esp.h static const char *cc1_spec We set that in esp.h if ENABLE_ESP. #ifdef EXTRA_SPECS: Add ESP_EXTRA_SPECS - main(): Add do_self_spec esp_command_options_spec() + main(): Add do_self_spec esp_command_options_spec() ---- gcc/gcc.c 2010-01-21 10:29:30.000000000 -0500 -+++ gcc/gcc.c 2010-01-29 23:29:16.000000000 -0500 +--- a/gcc/gcc.c 2010-01-21 10:29:30.000000000 -0500 ++++ b/gcc/gcc.c 2010-01-29 23:29:16.000000000 -0500 @@ -44,6 +44,7 @@ #include "flags.h" #include "opts.h" @@ -69,16 +69,16 @@ for (i = ARRAY_SIZE (static_specs) - 1; i >= 0; i--) { -@@ -7096,6 +7123,12 @@ - gcc_exec_prefix = concat (gcc_exec_prefix, spec_machine, dir_separator_str, - spec_version, dir_separator_str, NULL); +@@ -6256,6 +6256,12 @@ main (int argc, char **argv) + do_option_spec (option_default_specs[i].name, + option_default_specs[i].spec); +#ifdef ENABLE_ESP -+ /* Process ESP_COMMAND_OPTIONS_SPEC, adding any new options to the end -+ of the command line. */ ++ /* Process ESP_COMMAND_OPTIONS_SPEC, adding any new options to the end ++ of the command line. */ + do_self_spec (esp_command_options_spec); +#endif -+ - /* Now we have the specs. - Set the `valid' bits for switches that match anything in any spec. */ ++ + /* Process DRIVER_SELF_SPECS, adding any new options to the end + of the command line. */ diff --git a/gcc-4.6.0/piepatch/README.Changelog b/gcc-4.6.0/piepatch/README.Changelog index f17d195..368ac15 100644 --- a/gcc-4.6.0/piepatch/README.Changelog +++ b/gcc-4.6.0/piepatch/README.Changelog @@ -1,3 +1,11 @@ +0.5.4 Magnus Granberg <zorry@gentoo.org> + + * gcc/gcc.c Move do_self_spec esp_command_options_spec() + +0.5.3 Magnus Granberg <zorry@gentoo.org> + * configure Add mips support + * gcc/configs/mips/linux.h Don't define NO_SHARED_SPECS if ENABLE_ESP + 0.5.2 Magnus Granberg <zorry@gentoo.org> * gcc/configure Fix a type in the ENABLE_ESP_SSP check diff --git a/gcc-4.6.0/piepatch/README.history b/gcc-4.6.0/piepatch/README.history index 8d3ee19..85ff8e8 100644 --- a/gcc-4.6.0/piepatch/README.history +++ b/gcc-4.6.0/piepatch/README.history @@ -1,3 +1,11 @@ +0.5.4 22 jun 2012 + - 31_all_gcc46_config_all_linux.patch + U 20_all_gcc46_gcc.c.patch + - 34_all_gcc46_mips_noshared.patch +0.5.3 16 jun 2012 + + 10_all_gcc46_configure.patch + - 10_all_gcc45_configure.patch + + 34_all_gcc46_mips_noshared.patch 0.5.2 17 Apr 2012 U 13_all_gcc46_ssp_uclibc_check.patch 0.5.1 03 Apr 2012 diff --git a/gcc-4.7.0/piepatch/05_all_gcc47_gcc.c.patch b/gcc-4.7.0/piepatch/05_all_gcc47_gcc.c.patch index ca03258..7f5a5d4 100644 --- a/gcc-4.7.0/piepatch/05_all_gcc47_gcc.c.patch +++ b/gcc-4.7.0/piepatch/05_all_gcc47_gcc.c.patch @@ -1,9 +1,8 @@ -2012-01-15 Magnus Granberg <zorry@gentoo.org> +2012-06-22 Magnus Granberg <zorry@gentoo.org> * gcc/gcc.c include esp.h static const char *cc1_spec We set that in esp.h if ENABLE_ESP. #ifdef EXTRA_SPECS: Add ESP_EXTRA_SPECS - main(): Add do_self_spec esp_command_options_spec() --- gcc/gcc.c 2010-01-21 10:29:30.000000000 -0500 +++ gcc/gcc.c 2010-01-29 23:29:16.000000000 -0500 @@ -11,7 +10,7 @@ #include "opts.h" #include "params.h" #include "vec.h" -+#include "esp.h" /* for --enable-esp support */ ++#include "config/esp.h" /* for --enable-esp support */ #include "filenames.h" /* By default there is no special suffix for target executables. */ @@ -69,16 +68,3 @@ for (i = ARRAY_SIZE (static_specs) - 1; i >= 0; i--) { -@@ -7096,6 +7123,12 @@ - gcc_exec_prefix = concat (gcc_exec_prefix, spec_machine, dir_separator_str, - spec_version, dir_separator_str, NULL); - -+#ifdef ENABLE_ESP -+ /* Process ESP_COMMAND_OPTIONS_SPEC, adding any new options to the end -+ of the command line. */ -+ do_self_spec (esp_command_options_spec); -+#endif -+ - /* Now we have the specs. - Set the `valid' bits for switches that match anything in any spec. */ - diff --git a/gcc-4.7.0/piepatch/06_all_gcc46_esp.h.patch b/gcc-4.7.0/piepatch/06_all_gcc46_esp.h.patch deleted file mode 100644 index e11c910..0000000 --- a/gcc-4.7.0/piepatch/06_all_gcc46_esp.h.patch +++ /dev/null @@ -1,153 +0,0 @@ -2012-04-03 Magnus Granberg <zorry@gentoo.org> - - * gcc/esp.h New file to support --enable-esp - Version 20120403.2 - ---- 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,145 @@ -+/* License terms see GNU GENERAL PUBLIC LICENSE Version 3. -+ * Version 20120403.2 -+ * Magnus Granberg (Zorry) <zorry@gentoo.org> */ -+#ifndef GCC_ESP_H -+#define GCC_ESP_H -+ -+/* This file will add -fstack-protector-all, -fPIE, -pie and -z now -+ as default if the defines and the spec allow it. -+ Added a hack for gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass -+ to support older hardened GCC patches and we don't need to change the code on gcc-specs-* and _filter-hardened. -+ This will add some unsupported upstream commands options as -nopie and -nonow. -+ -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_OVERFLOW_SPEC is added so we don't disable the strict-overflow check. -+ ESP_LINK_PIE_CHECK_SPEC check for -pie, -p, -pg, -profile and -static. -+ ENABLE_CRTBEGINP add support for crtbeginP.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_overflow)" -+ #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 -+ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP ) -+ #define ESP_CC1_PIE_SPEC "%{!nopie: }" -+ #else -+ #define ESP_CC1_PIE_SPEC "" -+ #endif -+ #define ESP_CC1_STRICT_OVERFLOW_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. We do a -pie incompatible check -+ Don't remove the specs in the end */ -+ #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_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)}}" -+ -+ /* ESP_OPTIONS_SPEC is added to the compiler spec in gcc/gcc.c */ -+ #define ESP_OPTIONS_SPEC "%(esp_options_ssp)" -+ -+ /* ESP_CPP_OPTIONS_SPEC is added to the cpp_options spec in gcc/gcc.c -+ For precompiling headers. */ -+ #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 EFAULT_SSP or EFAULT_PIE_SSP defined. */ -+ #if ( defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP ) ) && defined ( ENABLE_ESP_SSP ) -+ #define ESP_OPTIONS_SSP_SPEC \ -+ "%{!D__KERNEL__:%{!nostdlib:%{!nodefaultlibs: %{!fno-stack-protector: \ -+ %{!fstack-protector:%{!fstack-protector-all:-fstack-protector-all}}}}}}" -+ #else -+ #define ESP_OPTIONS_SSP_SPEC "" -+ #endif -+ -+ /* 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. */ -+ /* With ENABLE_CRTBEGINP we don't need to check for -static */ -+ #ifdef ENABLE_CRTBEGINP -+ #define ESP_OPTIONS_PIE_SPEC \ -+ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \ -+ %{!shared: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }" -+ #else -+ #define ESP_OPTIONS_PIE_SPEC \ -+ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \ -+ %{!shared: %{!static: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }}" -+ #endif -+ -+ /* This will add -pie if we don't have -pie -A -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static -r -nostdlib -+ -nostartfiles */ -+ /* With ENABLE_CRTBEGINP we don't need to check for -static -+ and we add -pie only to get the start and endfiles. -pie will not go to the linker. */ -+ #ifdef ENABLE_CRTBEGINP -+ #define ESP_LINK_PIE_SPEC \ -+ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!r: \ -+ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}" -+ #else -+ #define ESP_LINK_PIE_SPEC \ -+ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!static:%{!r: \ -+ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}}" -+ #endif -+ -+ /* 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_CRTBEGINP we don't need to check for -static */ -+ #ifdef ENABLE_CRTBEGINP -+ #define ESP_LINK_PIE_CHECK_SPEC \ -+ "%{pie:%{pg|p|profile:%e-pie and -pg|p|profile are incompatible when linking}}" -+ #else -+ #define ESP_LINK_PIE_CHECK_SPEC \ -+ "%{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. */ -+ #ifdef ENABLE_CRTBEGINP -+ #define LINK_PIE_SPEC "%{!static:%{pie:-pie}} %(esp_link)" -+ #else -+ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)" -+ #endif -+ -+ #else -+ #define ESP_OPTIONS_PIE_SPEC "" -+ #define ESP_LINK_PIE_CHECK_SPEC "" -+ #define ESP_LINK_PIE_SPEC "" -+ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)" -+ #endif -+ -+ /* We add extra spec name's to the EXTRA_SPECS list */ -+ #define ESP_EXTRA_SPECS \ -+ { "esp_cc1", ESP_CC1_SPEC }, \ -+ { "esp_cc1_pie", ESP_CC1_PIE_SPEC }, \ -+ { "esp_cc1_ssp", ESP_CC1_SSP_SPEC }, \ -+ { "esp_cc1_strict_overflow", ESP_CC1_STRICT_OVERFLOW_SPEC }, \ -+ { "esp_link", ESP_LINK_SPEC }, \ -+ { "esp_link_now", ESP_LINK_NOW_SPEC }, \ -+ { "esp_link_pie", ESP_LINK_PIE_SPEC }, \ -+ { "esp_link_pie_check", ESP_LINK_PIE_CHECK_SPEC }, \ -+ { "esp_command_options", ESP_COMMAND_OPTIONS_SPEC }, \ -+ { "esp_cpp_options", ESP_CPP_OPTIONS_SPEC }, \ -+ { "esp_options", ESP_OPTIONS_SPEC }, \ -+ { "esp_options_pie", ESP_OPTIONS_PIE_SPEC }, \ -+ { "esp_options_ssp", ESP_OPTIONS_SSP_SPEC } -+ -+ static const char *esp_command_options_spec = ESP_COMMAND_OPTIONS_SPEC; -+ static const char *cc1_spec = CC1_SPEC ESP_CC1_SPEC; -+ -+#else /* If not ESP_ENABLE defined do this. */ -+ -+ #define ESP_OPTIONS_SPEC "" -+ #define ESP_CPP_OPTIONS_SPEC "" -+ -+ /* We add extra spec name's to the EXTRA_SPECS list */ -+ #define ESP_EXTRA_SPECS \ -+ { "esp_options", ESP_OPTIONS_SPEC }, \ -+ { "esp_cpp_options", ESP_CPP_OPTIONS_SPEC } -+ -+#endif -+#endif /* End GCC_ESP_H */ diff --git a/gcc-4.7.0/piepatch/10_all_gcc46_default-ssp.patch b/gcc-4.7.0/piepatch/10_all_gcc46_default-ssp.patch deleted file mode 100644 index ea4be77..0000000 --- a/gcc-4.7.0/piepatch/10_all_gcc46_default-ssp.patch +++ /dev/null @@ -1,130 +0,0 @@ -2011-03-05 Matthias Klose <doko@ubuntu.com>, Kees Cook <kees@outflux.net>, - Magnus Granberg <zorry@gentoo.org> - - * gcc/objc/lang-specs.h compiler spec Add %(esp_options) - * gcc/objcp/lang-specs.h compiler spec Add %(esp_options) - * gcc/gcc.c *cpp_options Add %(esp_cpp_options) - * gcc/gcc.c default_compilers[] Add %(esp_options) - * gcc/cp/lang-specs.h compiler spec Add %(esp_options) - ---- a/gcc/gcc.c.orig 2009-12-21 -+++ b/gcc/gcc.c 2009-12-21 -@@ -740,7 +749,7 @@ - static const char *cpp_options = - "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ - %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*}\ -- %{undef} %{save-temps*:-fpch-preprocess}"; -+ %{undef} %{save-temps*:-fpch-preprocess} %(esp_cpp_options)"; - - /* This contains cpp options which are not passed when the preprocessor - output will be used by another program. */ -@@ -914,9 +923,9 @@ - %{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \ - %(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\ - cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \ -- %(cc1_options)}\ -+ %(cc1_options) %(esp_options)}\ - %{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\ -- cc1 %(cpp_unique_options) %(cc1_options)}}}\ -+ cc1 %(cpp_unique_options) %(cc1_options) %(esp_options)}}}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 1}, - {"-", - "%{!E:%e-E or -x required when input is from standard input}\ -@@ -953,7 +953,7 @@ - %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0}, - {".i", "@cpp-output", 0, 0, 0}, - {"@cpp-output", -- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, -+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %(esp_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {".s", "@assembler", 0, 0, 0}, - {"@assembler", - "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0}, ---- a/gcc/cp/lang-specs.h 2011-03-06 17:27:57.000000000 +0100 -+++ b/gcc/cp/lang-specs.h 2011-03-26 13:30:40.312423000 +0100 -@@ -47,7 +47,7 @@ - %(cpp_options) %2 -o %{save-temps*:%b.ii} %{!save-temps*:%g.ii} \n}\ - cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\ - %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2\ -+ %(cc1_options) %(esp_options) %2\ - %{!fsyntax-only:%{!fdump-ada-spec*:-o %g.s %{!o*:--output-pch=%i.gch}\ - %W{o*:--output-pch=%*}}%V}}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, -@@ -58,7 +58,7 @@ - %(cpp_options) %2 -o %{save-temps*:%b.ii} %{!save-temps*:%g.ii} \n}\ - cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\ - %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2\ -+ %(cc1_options) %(esp_options) %2\ - %{!fsyntax-only:%(invoke_as)}}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, - {".ii", "@c++-cpp-output", 0, 0, 0}, - ---- a/gcc/objcp/lang-specs.h 2011-03-06 17:27:57.000000000 +0100 -+++ a/gcc/objcp/lang-specs.h 2011-03-26 14:19:12.596423000 +0100 -@@ -36,7 +36,7 @@ - %(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\ - cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\ - %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2\ -+ %(cc1_options) %(esp_options) %2\ - -o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, - {"@objective-c++", -@@ -46,16 +46,16 @@ - %(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\ - cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\ - %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2\ -+ %(cc1_options) %(esp_options) %2\ - %{!fsyntax-only:%(invoke_as)}}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, - {".mii", "@objective-c++-cpp-output", 0, 0, 0}, - {"@objective-c++-cpp-output", - "%{!M:%{!MM:%{!E:\ -- cc1objplus -fpreprocessed %i %(cc1_options) %2\ -+ cc1objplus -fpreprocessed %i %(cc1_options) %(esp_options) %2\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {"@objc++-cpp-output", - "%nobjc++-cpp-output is deprecated; please use objective-c++-cpp-output instead\n\ - %{!M:%{!MM:%{!E:\ -- cc1objplus -fpreprocessed %i %(cc1_options) %2\ -+ cc1objplus -fpreprocessed %i %(cc1_options) %(esp_options) %2\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, ---- a/gcc/objc/lang-specs.h 2011-03-06 17:27:57.000000000 +0100 -+++ b/gcc/objc/lang-specs.h 2011-03-26 14:56:27.668423000 +0100 -@@ -30,9 +30,9 @@ - %{traditional|traditional-cpp:\ - %eGNU Objective C no longer supports traditional compilation}\ - %{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\ -- cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}\ -+ cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}}\ - %{!save-temps*:%{!no-integrated-cpp:\ -- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}}\ -+ cc1obj %(cpp_unique_options) %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}}}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {"@objective-c-header", - "%{E|M|MM:cc1obj -E %{traditional|traditional-cpp:-traditional-cpp}\ -@@ -41,18 +41,18 @@ - %{traditional|traditional-cpp:\ - %eGNU Objective C no longer supports traditional compilation}\ - %{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\ -- cc1obj -fpreprocessed %b.mi %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ cc1obj -fpreprocessed %b.mi %(cc1_options)%(esp_options) %{print-objc-runtime-info} %{gen-decls}\ - -o %g.s %{!o*:--output-pch=%i.gch}\ - %W{o*:--output-pch=%*}%V}\ - %{!save-temps*:%{!no-integrated-cpp:\ -- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ cc1obj %(cpp_unique_options) %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\ - -o %g.s %{!o*:--output-pch=%i.gch}\ - %W{o*:--output-pch=%*}%V}}}}}", 0, 0, 0}, - {".mi", "@objective-c-cpp-output", 0, 0, 0}, - {"@objective-c-cpp-output", -- "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {"@objc-cpp-output", - "%nobjc-cpp-output is deprecated; please use objective-c-cpp-output instead\n\ -- %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, diff --git a/upstream/Makefile.in.patch b/upstream/Makefile.in.patch index df93c63..cc7d0f0 100644 --- a/upstream/Makefile.in.patch +++ b/upstream/Makefile.in.patch @@ -1,15 +1,10 @@ -2011-06-04 Magnus Granberg <zorry@gentoo.org> - - * Makefile.in We add -fno-stack-protector to BOOT_CFLAGS, LIBCFLAGS and LIBCXXFLAGS if enable_espf yes. - * gcc/Makefile.in Add -fno-PIE. to CRTSTUFF_CFLAGS and ALL_CFLAGS if enable_espf yes - ---- Makefile.in 2010-01-22 08:35:38.000000000 -0500 -+++ Makefile.in 2010-02-07 15:10:59.000000000 -0500 -@@ -350,9 +350,17 @@ +--- a/Makefile.in 2012-01-02 11:59:04.000000000 +0100 ++++ b/Makefile.in 2012-06-29 00:11:30.886010145 +0200 +@@ -362,9 +362,17 @@ WINDRES_FOR_BUILD = @WINDRES_FOR_BUILD@ BUILD_PREFIX = @BUILD_PREFIX@ BUILD_PREFIX_1 = @BUILD_PREFIX_1@ -+# Some stuff don't work well with SSP ++# Disable SSP on BOOT_CFLAGS, LIBCFLAGS and LIBCXXFLAGS +enable_espf = @enable_espf@ +ifeq ($(enable_espf),yes) +ESPF_NOSSP_CFLAGS = -fno-stack-protector @@ -24,7 +19,7 @@ BOOT_LDFLAGS= BOOT_ADAFLAGS=-gnatpg -gnata -@@ -403,9 +403,9 @@ +@@ -410,9 +418,9 @@ GNATMAKE = @GNATMAKE@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ @@ -36,13 +31,13 @@ GOCFLAGS = $(CFLAGS) TFLAGS = ---- a/gcc/Makefile.in 2011-04-22 22:04:42.000000000 +0200 -+++ b/gcc/Makefile.in 2011-06-24 15:03:02.440236923 +0200 -@@ -642,13 +642,21 @@ - INHIBIT_LIBC_CFLAGS = -Dinhibit_libc - endif +--- a/gcc/Makefile.in 2012-02-11 09:50:23.000000000 +0100 ++++ b/gcc/Makefile.in 2012-06-29 00:07:45.230003420 +0200 +@@ -973,14 +973,23 @@ LIBFUNCS_H = libfuncs.h $(HASHTAB_H) + # cross compiler which does not use the native headers and libraries. + INTERNAL_CFLAGS = -DIN_GCC @CROSS@ -+# We don't want to compile the gcc tree with -fPIE when we have espf enable. ++# We don't want to compile the compiler with -fPIE, it make PCH fail. +enable_espf = @enable_espf@ +ifeq ($(enable_espf),yes) +ESPF_NOPIE_CFLAGS = -fno-PIE @@ -50,28 +45,6 @@ +ESPF_NOPIE_CFLAGS= +endif + - # Options to use when compiling libgcc2.a. - # - LIBGCC2_DEBUG_CFLAGS = -g - LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) \ - $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) \ - -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \ -- -fno-stack-protector \ -+ -fno-stack-protector $(ESPF_NOPIE_CFLAGS) \ - $(INHIBIT_LIBC_CFLAGS) - - # Additional options to use when compiling libgcc2.a. -@@ -662,7 +670,7 @@ - CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ - -finhibit-size-directive -fno-inline -fno-exceptions \ - -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \ -- -fno-stack-protector \ -+ -fno-stack-protector $(ESPF_NOPIE_CFLAGS) \ - $(INHIBIT_LIBC_CFLAGS) - - # Additional sources to handle exceptions; overridden by targets as needed. -@@ -1002,7 +1010,7 @@ - # This is the variable actually used when we compile. If you change this, # you probably want to update BUILD_CFLAGS in configure.ac -ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \ @@ -79,12 +52,39 @@ $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@ # The C++ version. -@@ -1928,7 +1936,7 @@ - echo LIBGCC_SYNC = '$(LIBGCC_SYNC)' >> tmp-libgcc.mvars - echo LIBGCC_SYNC_CFLAGS = '$(LIBGCC_SYNC_CFLAGS)' >> tmp-libgcc.mvars - echo CRTSTUFF_CFLAGS = '$(CRTSTUFF_CFLAGS)' >> tmp-libgcc.mvars -- echo CRTSTUFF_T_CFLAGS = '$(CRTSTUFF_T_CFLAGS)' >> tmp-libgcc.mvars -+ echo CRTSTUFF_T_CFLAGS = '$(CRTSTUFF_T_CFLAGS) $(ESPF_NOPIE_CFLAGS)' >> tmp-libgcc.mvars - echo CRTSTUFF_T_CFLAGS_S = '$(CRTSTUFF_T_CFLAGS_S)' >> tmp-libgcc.mvars +-ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \ +- $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) $(WARN_CXXFLAGS) @DEFS@ ++ALL_CXXFLAGS =$(ESPF_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) \ ++ $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) \ ++ $(WARN_CXXFLAGS) @DEFS@ + + # Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro + # puts -I options in CPPFLAGS, our include files in the srcdir will always +@@ -1815,6 +1824,7 @@ libgcc.mvars: config.status Makefile spe + echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars + echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars -
\ No newline at end of file ++ echo enable_espf = '$(enable_espf)' >> tmp-libgcc.mvars + + mv tmp-libgcc.mvars libgcc.mvars + +--- a/libgcc/Makefile.in 2011-11-22 04:01:02.000000000 +0100 ++++ b/libgcc/Makefile.in 2012-06-29 00:15:04.534016511 +0200 +@@ -275,11 +275,16 @@ override CFLAGS := $(filter-out -fprofil + INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \ + $(INCLUDES) @set_have_cc_tls@ @set_use_emutls@ + ++ifeq ($(enable_espf),yes) ++ESPF_NOPIE_CFLAGS = -fno-PIE ++else ++ESPF_NOPIE_CFLAGS= ++endif + # Options to use when compiling crtbegin/end. + CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ + -finhibit-size-directive -fno-inline -fno-exceptions \ + -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \ +- -fno-stack-protector \ ++ -fno-stack-protector $(ESPF_NOPIE_CFLAGS) \ + $(INHIBIT_LIBC_CFLAGS) + + # Extra flags to use when compiling crt{begin,end}.o. diff --git a/upstream/config_all.patch b/upstream/config_all.patch new file mode 100644 index 0000000..f3af62d --- /dev/null +++ b/upstream/config_all.patch @@ -0,0 +1,32 @@ +--- a/gcc/config/linux.h 2011-07-07 17:38:34.000000000 +0200 ++++ b/gcc/config/linux.h 2012-07-06 17:09:54.414853750 +0200 +@@ -104,3 +104,29 @@ see the files COPYING3 and COPYING.RUNTI + /* Whether we have sincos that follows the GNU extension. */ + #undef TARGET_HAS_SINCOS + #define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC) ++ ++#ifdef ENABLE_ESPF ++#ifdef ENABLE_ESPF_PIE ++#define ESPF_GCC_PIE_SPEC \ ++ "%{pie|fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC|fno-pie|fno-PIE| \ ++ shared|static|nostdlib|nostartfiles:;:-fPIE -pie}" ++#else ++#define ESPF_GCC_PIE_SPEC "" ++#endif ++#ifdef ENABLE_ESPF_SSP ++#define ESPF_GCC_SSP_SPEC \ ++ "%{nostdlib|nodefaultlibs|fno-stack-protector| \ ++ fstack-protector|fstack-protector-all:;:-fstack-protector}" ++#else ++#define ESPF_GCC_SSP_SPEC "" ++#endif ++#ifdef ENABLE_ESPF_FORTIFY ++#define ESPF_CPP_UNIQUE_OPTIONS_SPEC \ ++ "%{D_FORTIFY_SOURCE|D_FORTIFY_SOURCE=*|U_FORTIFY_SOURCE:;:-D _FORTIFY_SOURCE=2}" ++#else ++#define ESPF_CPP_UNIQUE_OPTIONS_SPEC "" ++#endif ++#define ESPF_DRIVER_SELF_SPECS \ ++ ESPF_GCC_PIE_SPEC, \ ++ ESPF_GCC_SSP_SPEC ++#endif diff --git a/upstream/config_i386.patch b/upstream/config_i386.patch new file mode 100644 index 0000000..c6632c9 --- /dev/null +++ b/upstream/config_i386.patch @@ -0,0 +1,41 @@ +--- a/gcc/config/i386/linux.h 2011-06-03 20:30:39.000000000 +0200 ++++ b/gcc/config/i386/linux.h 2012-07-05 21:00:38.304691613 +0200 +@@ -22,3 +22,7 @@ along with GCC; see the file COPYING3. + + #define GNU_USER_LINK_EMULATION "elf_i386" + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++ ++#ifdef ENABLE_ESPF ++#define DRIVER_SELF_SPECS ESPF_DRIVER_SELF_SPECS ++#endif +--- a/gcc/config/i386/linux64.h 2011-07-07 17:38:34.000000000 +0200 ++++ b/gcc/config/i386/linux64.h 2012-07-05 20:59:39.342689855 +0200 +@@ -31,3 +31,7 @@ see the files COPYING3 and COPYING.RUNTI + #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" + #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" + #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" ++ ++#ifdef ENABLE_ESPF ++#define DRIVER_SELF_SPECS ESPF_DRIVER_SELF_SPECS ++#endif +--- a/gcc/config/i386/i386.h 2011-11-24 23:11:12.000000000 +0100 ++++ b/gcc/config/i386/i386.h 2012-07-06 17:30:46.694891067 +0200 +@@ -620,10 +620,17 @@ enum target_cpu_default + #define SUBTARGET_EXTRA_SPECS + #endif + ++#ifdef ENABLE_ESPF ++#define ESPF_EXTRA_SPECS \ ++ { "espf_cpp_unique_options", ESPF_CPP_UNIQUE_OPTIONS_SPEC } ++#else ++#define ESPF_EXTRA_SPECS { "", "" } ++#endif ++ + #define EXTRA_SPECS \ + { "cc1_cpu", CC1_CPU_SPEC }, \ ++ ESPF_EXTRA_SPECS, \ + SUBTARGET_EXTRA_SPECS +- + + /* Set the value of FLT_EVAL_METHOD in float.h. When using only the + FPU, assume that the fpcw is set to extended precision; when using diff --git a/upstream/configure.ac.patch b/upstream/configure.ac.patch index 86bab05..49a7e21 100644 --- a/upstream/configure.ac.patch +++ b/upstream/configure.ac.patch @@ -1,31 +1,42 @@ ---- a/configure.ac 2011-11-29 22:36:43.000000000 +0100 -+++ b/configure.ac 2011-12-07 23:29:26.125712475 +0100 -@@ -419,6 +419,24 @@ if test "${ENABLE_LIBADA}" != "yes" ; th - noconfigdirs="$noconfigdirs gnattools" - fi +--- a/configure.ac 2012-02-02 11:20:32.000000000 +0100 ++++ b/configure.ac 2012-07-01 00:44:27.845218414 +0200 +@@ -424,6 +424,35 @@ AC_ARG_ENABLE(libssp, + ENABLE_LIBSSP=$enableval, + ENABLE_LIBSSP=yes) +# Check whether --enable-espf was given and target have the support. +AC_ARG_ENABLE([espf], -+[AS_HELP_STRING([--enable-espf], -+ [Enable Stack protector, Position independent executable as -+ default if we have suppot for it when compiling. -+ Linux targets supported i*86, x86_64 and x86_x32.])], -+[ -+ case $target in -+ i?86*-*-linux* | x86_??*-*-linux*) -+ enable_espf=yes -+ ;; -+ *) -+ AC_MSG_WARN([*** --enable-espf is not supported on this $target target.]) -+ ;; -+ esac -+]) ++[AS_HELP_STRING([--enable-espf[=ARG]], ++ [Enable Stack protector, Position independent executable and ++ Fortify_source as default. If we have suppot for it when compiling. ++ Linux targets supported x86_64. @<:@ARG={all,pie,ssp,no}@:>@ ])], ++set_enable_espf=$enableval, ++set_enable_espf=no) ++case "${set_enable_espf}" in ++ all|pie|ssp) ++ case $target in ++ i?86*-*-linux* | x86_??*-*-linux*) ++ enable_espf=yes ++ ;; ++ *) ++ enable_espf=no ++ AC_MSG_WARN([*** --enable-espf is not supported on this $target target.]) ++ ;; ++ esac ++ ;; ++ no) ++ enable_espf=no ++ ;; ++ *) ++ AC_MSG_ERROR([invalid --enable-espf argument]) ++ ;; ++esac +AC_SUBST([enable_espf]) + - AC_ARG_ENABLE(libssp, - [AS_HELP_STRING([--enable-libssp], [build libssp directory])], - ENABLE_LIBSSP=$enableval, -@@ -3211,6 +3230,11 @@ if test "$GCC" = yes -a "$ENABLE_BUILD_W + # Save it here so that, even in case of --enable-libgcj, if the Java + # front-end isn't enabled, we still get libgcj disabled. + libgcj_saved=$libgcj +@@ -3213,6 +3242,11 @@ if test "$GCC" = yes -a "$ENABLE_BUILD_W CFLAGS="$saved_CFLAGS" fi @@ -37,9 +48,9 @@ AC_SUBST(stage1_cflags) # Enable --enable-checking in stage1 of the compiler. ---- a/gcc/configure.ac 2011-11-18 11:52:32.000000000 +0100 -+++ b/gcc/configure.ac 2012-04-04 16:18:00.269968226 +0200 -@@ -5130,6 +5146,148 @@ if test x"${LINKER_HASH_STYLE}" != x; th +--- a/gcc/configure.ac 2012-02-22 12:27:45.000000000 +0100 ++++ b/gcc/configure.ac 2012-07-01 00:43:14.054216215 +0200 +@@ -5193,6 +5193,155 @@ if test x"${LINKER_HASH_STYLE}" != x; th [The linker hash style]) fi @@ -49,41 +60,46 @@ + +# Check whether --enable-espf was given and target have the support. +AC_ARG_ENABLE([espf], -+[AS_HELP_STRING([--enable-espf], ++[AS_HELP_STRING([--enable-espf[=ARG]], + [Enable Stack protector, Position independent executable and -+ Fortify_sources as default if we have suppot for it when compiling. -+ Linux targets supported i*86, x86_64, and x86_x32.])], -+ set_enable_espf=$enableval, -+ set_enable_espf=no) -+if test $set_enable_espf = yes ; then -+ AC_MSG_CHECKING(if $target support espf) -+if test $set_enable_espf = yes ; then -+ case "$target" in -+ i?86*-*-linux* | x86_??*-*-linux*) -+ enable_espf=yes -+ AC_DEFINE(ENABLE_ESPF, 1, ++ Fortify_source as default. If we have suppot for it when compiling. ++ Linux targets supported x86_64. @<:@ARG={all,pie,ssp,no}@:>@ ])], ++set_enable_espf=$enableval, ++set_enable_espf=no) ++case "${set_enable_espf}" in ++ all|pie|ssp) ++ AC_MSG_CHECKING(if $target support espf) ++ case $target in ++ i?86*-*-linux* | x86_??*-*-linux*) ++ enable_espf=yes ++ AC_DEFINE(ENABLE_ESPF, 1, + [Define if your target support espf and you have enable it.]) -+ ;; -+ *) -+ enable_espf=no -+ ;; -+ esac -+else -+ enable_espf=no -+fi -+AC_MSG_RESULT($enable_espf) -+fi ++ ;; ++ *) ++ enable_espf=no ++ AC_MSG_WARN([*** --enable-espf is not supported on this $target target.]) ++ ;; ++ esac ++ AC_MSG_RESULT($enable_espf) ++ ;; ++ no) ++ enable_espf=no ++ ;; ++ *) ++ AC_MSG_ERROR([invalid --enable-espf argument]) ++ ;; ++esac +AC_SUBST([enable_espf]) -+if test $enable_espf = yes ; then ++if test x$enable_espf = xyes ; then + -+# Check for FORTIFY_SOURCES support in target C library. -+ AC_CACHE_CHECK(for _FORTIFY_SOURCES support in target C library, ++# Check for FORTIFY_SOURCE support in target C library. ++ AC_CACHE_CHECK(for _FORTIFY_SOURCE support in target C library, + gcc_cv_libc_provides_fortify, + [gcc_cv_libc_provides_fortify=no + case "$target" in + *-*-linux*) -+ [# glibc 2.8 and later provides _FORTIFY_SOURCES. -+ # uClibc 0.9.32 and later provides _FORTIFY_SOURCES. ++ [# glibc 2.8 and later provides _FORTIFY_SOURCE. ++ # uClibc 0.9.32 and later provides _FORTIFY_SOURCE. + if test -f $target_header_dir/features.h; then + if $EGREP '^[ ]*#[ ]*define[ ]+__GLIBC__[ ]+2' \ + $target_header_dir/features.h > /dev/null \ @@ -106,29 +122,30 @@ + esac]) + + AC_MSG_CHECKING(if we can default to use -fPIE and link with -pie) -+ if test x$gcc_cv_ld_pie = xyes; then -+ saved_LDFLAGS="$LDFLAGS" -+ saved_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS -fPIE -Werror" -+ LDFLAGS="$LDFLAGS -fPIE -pie" -+ AC_TRY_LINK(,, -+ [AC_MSG_RESULT([yes]); enable_espf_pie=yes], -+ [AC_MSG_RESULT([no]); enable_espf_pie=no]) -+ LDFLAGS="$saved_LDFLAGS" -+ CFLAGS="$saved_CFLAGS" -+ else -+ AC_MSG_RESULT([no]) -+ enable_espf_pie=no ++ enable_espf_pie=no ++ if test x$gcc_cv_ld_pie = xyes ;then ++ if test x$set_enable_espf = xall || test x$set_enable_espf = xpie; then ++ saved_LDFLAGS="$LDFLAGS" ++ saved_CFLAGS="$CFLAGS" ++ CFLAGS="$CFLAGS -fPIE -Werror" ++ LDFLAGS="$LDFLAGS -fPIE -pie" ++ AC_TRY_LINK(,, ++ [AC_MSG_RESULT([yes]); enable_espf_pie=yes],) ++ LDFLAGS="$saved_LDFLAGS" ++ CFLAGS="$saved_CFLAGS" ++ fi + fi -+ -+ if test $enable_espf_pie = yes ; then ++ if test x$enable_espf_pie = xyes ; then + AC_DEFINE(ENABLE_ESPF_PIE, 1, + [Define if your compiler will default to use -fPIE and link with -pie.]) ++ else ++ AC_MSG_RESULT([no]) + fi + + AC_MSG_CHECKING(if we can default to use -fstack-protector) + ssp_link_test=no -+ if test x$gcc_cv_libc_provides_ssp = xyes && test x$set_have_as_tls = yes; then ++ enable_espf_ssp=no ++ if test x$gcc_cv_libc_provides_ssp = xyes && test x$set_have_as_tls = xyes; then + if $EGREP '^[ ]*#[ ]*define[ ]+__UCLIBC__[ ]+1' \ + $target_header_dir/features.h > /dev/null; then + if test -f $target_header_dir/bits/uClibc_config.h && \ @@ -142,28 +159,28 @@ + ssp_link_test=yes + fi + fi -+ if test x$ssp_link_test=xyes ; then -+ saved_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS -O2 -fstack-protector -Werror" -+ AC_TRY_LINK(,, -+ [AC_MSG_RESULT([yes]); enable_espf_ssp=yes], -+ [AC_MSG_RESULT([no]); enable_espf_ssp=no]) -+ CFLAGS="$saved_CFLAGS" -+ else -+ AC_MSG_RESULT([no]) -+ enable_espf_ssp=no ++ if test x$ssp_link_test=xyes; then ++ if test x$set_enable_espf = xall || test x$set_enable_espf = xssp; then ++ saved_CFLAGS="$CFLAGS" ++ CFLAGS="$CFLAGS -O2 -fstack-protector -Werror" ++ AC_TRY_LINK(,, ++ [AC_MSG_RESULT([yes]); enable_espf_ssp=yes],) ++ CFLAGS="$saved_CFLAGS" ++ fi + fi -+ if test $enable_espf_ssp = yes ; then ++ if test x$enable_espf_ssp = xyes ; then + AC_DEFINE(ENABLE_ESPF_SSP, 1, + [Define if your compiler will default to use -fstack-protector.]) ++ else ++ AC_MSG_RESULT([no]) + fi + -+ AC_MSG_CHECKING(if we can default to use -D_FORTIFY_SOURCES=2) ++ AC_MSG_CHECKING(if we can default to use -D_FORTIFY_SOURCE=2) + if test x$gcc_cv_libc_provides_fortify = xyes; then + saved_CFLAGS="$CFLAGS" + saved_CPPFLAGS="$CPPFLAGS" + CFLAGS="$CFLAGS -O2 -Werror" -+ CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCES=2" ++ CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2" + AC_TRY_LINK([ + #include <sys/types.h> + #include <sys/stat.h> @@ -176,11 +193,12 @@ + CFLAGS="$saved_CFLAGS" + CPPFLAGS="$saved_CPPFLAGS" + else -+ [AC_MSG_RESULT([no]); enable_espf_fortify=no] ++ AC_MSG_RESULT([no]) ++ enable_espf_fortify=no + fi + if test x$enable_espf_fortify = xyes ; then + AC_DEFINE(ENABLE_ESPF_FORTIFY, 1, -+ [Define if your compiler will default to use -D_FORTIFY_SOURCES=2.]) ++ [Define if your compiler will default to use -D_FORTIFY_SOURCE=2.]) + fi + +fi diff --git a/upstream/espf-ssp.patch b/upstream/espf-ssp.patch deleted file mode 100644 index 38af0a6..0000000 --- a/upstream/espf-ssp.patch +++ /dev/null @@ -1,130 +0,0 @@ -2011-06-24 Matthias Klose <doko@ubuntu.com>, Kees Cook <kees@outflux.net>, - Magnus Granberg <zorry@gentoo.org> - - * gcc/objc/lang-specs.h compiler spec Add %(espf_options) - * gcc/objcp/lang-specs.h compiler spec Add %(espf_options) - * gcc/gcc.c *cpp_options Add %(espf_cpp_options) - * gcc/gcc.c default_compilers[] Add %(espf_options) - * gcc/cp/lang-specs.h compiler spec Add %(esp_options) - ---- a/gcc/gcc.c.orig 2009-12-21 -+++ b/gcc/gcc.c 2009-12-21 -@@ -740,7 +749,7 @@ - static const char *cpp_options = - "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ - %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*}\ -- %{undef} %{save-temps*:-fpch-preprocess}"; -+ %{undef} %{save-temps*:-fpch-preprocess} %(espf_cpp_options)"; - - /* This contains cpp options which are not passed when the preprocessor - output will be used by another program. */ -@@ -914,9 +923,9 @@ - %{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \ - %(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\ - cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \ -- %(cc1_options)}\ -+ %(cc1_options) %(espf_options)}\ - %{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\ -- cc1 %(cpp_unique_options) %(cc1_options)}}}\ -+ cc1 %(cpp_unique_options) %(cc1_options) %(espf_options)}}}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 1}, - {"-", - "%{!E:%e-E or -x required when input is from standard input}\ -@@ -953,7 +953,7 @@ - %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0}, - {".i", "@cpp-output", 0, 0, 0}, - {"@cpp-output", -- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, -+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %(espf_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {".s", "@assembler", 0, 0, 0}, - {"@assembler", - "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0}, ---- a/gcc/cp/lang-specs.h 2011-03-06 17:27:57.000000000 +0100 -+++ b/gcc/cp/lang-specs.h 2011-03-26 13:30:40.312423000 +0100 -@@ -47,7 +47,7 @@ - %(cpp_options) %2 -o %{save-temps*:%b.ii} %{!save-temps*:%g.ii} \n}\ - cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\ - %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2\ -+ %(cc1_options) %(espf_options) %2\ - %{!fsyntax-only:%{!fdump-ada-spec*:-o %g.s %{!o*:--output-pch=%i.gch}\ - %W{o*:--output-pch=%*}}%V}}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, -@@ -58,7 +58,7 @@ - %(cpp_options) %2 -o %{save-temps*:%b.ii} %{!save-temps*:%g.ii} \n}\ - cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\ - %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2\ -+ %(cc1_options) %(espf_options) %2\ - %{!fsyntax-only:%(invoke_as)}}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, - {".ii", "@c++-cpp-output", 0, 0, 0}, - ---- a/gcc/objcp/lang-specs.h 2011-03-06 17:27:57.000000000 +0100 -+++ a/gcc/objcp/lang-specs.h 2011-03-26 14:19:12.596423000 +0100 -@@ -36,7 +36,7 @@ - %(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\ - cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\ - %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2\ -+ %(cc1_options) %(espf_options) %2\ - -o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, - {"@objective-c++", -@@ -46,16 +46,16 @@ - %(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\ - cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\ - %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2\ -+ %(cc1_options) %(espf_options) %2\ - %{!fsyntax-only:%(invoke_as)}}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, - {".mii", "@objective-c++-cpp-output", 0, 0, 0}, - {"@objective-c++-cpp-output", - "%{!M:%{!MM:%{!E:\ -- cc1objplus -fpreprocessed %i %(cc1_options) %2\ -+ cc1objplus -fpreprocessed %i %(cc1_options) %(espf_options) %2\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {"@objc++-cpp-output", - "%nobjc++-cpp-output is deprecated; please use objective-c++-cpp-output instead\n\ - %{!M:%{!MM:%{!E:\ -- cc1objplus -fpreprocessed %i %(cc1_options) %2\ -+ cc1objplus -fpreprocessed %i %(cc1_options) %(espf_options) %2\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, ---- a/gcc/objc/lang-specs.h 2011-03-06 17:27:57.000000000 +0100 -+++ b/gcc/objc/lang-specs.h 2011-03-26 14:56:27.668423000 +0100 -@@ -30,9 +30,9 @@ - %{traditional|traditional-cpp:\ - %eGNU Objective C no longer supports traditional compilation}\ - %{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\ -- cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}\ -+ cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %(espf_options) %{print-objc-runtime-info} %{gen-decls}}\ - %{!save-temps*:%{!no-integrated-cpp:\ -- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}}\ -+ cc1obj %(cpp_unique_options) %(cc1_options) %(espf_options) %{print-objc-runtime-info} %{gen-decls}}}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {"@objective-c-header", - "%{E|M|MM:cc1obj -E %{traditional|traditional-cpp:-traditional-cpp}\ -@@ -41,18 +41,18 @@ - %{traditional|traditional-cpp:\ - %eGNU Objective C no longer supports traditional compilation}\ - %{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\ -- cc1obj -fpreprocessed %b.mi %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ cc1obj -fpreprocessed %b.mi %(cc1_options)%(espf_options) %{print-objc-runtime-info} %{gen-decls}\ - -o %g.s %{!o*:--output-pch=%i.gch}\ - %W{o*:--output-pch=%*}%V}\ - %{!save-temps*:%{!no-integrated-cpp:\ -- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ cc1obj %(cpp_unique_options) %(cc1_options) %(espf_options) %{print-objc-runtime-info} %{gen-decls}\ - -o %g.s %{!o*:--output-pch=%i.gch}\ - %W{o*:--output-pch=%*}%V}}}}}", 0, 0, 0}, - {".mi", "@objective-c-cpp-output", 0, 0, 0}, - {"@objective-c-cpp-output", -- "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(espf_options) %{print-objc-runtime-info} %{gen-decls}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {"@objc-cpp-output", - "%nobjc-cpp-output is deprecated; please use objective-c-cpp-output instead\n\ -- %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(espf_options) %{print-objc-runtime-info} %{gen-decls}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, diff --git a/upstream/gcc.c.patch b/upstream/gcc.c.patch index b1d5e89..556f0a5 100644 --- a/upstream/gcc.c.patch +++ b/upstream/gcc.c.patch @@ -1,28 +1,17 @@ -2011-06-24 Magnus Granberg <zorry@gentoo.org> - - * gcc/gcc.c include esp.h - main(): Add do_self_spec (espf_command_options_spec) - ---- gcc/gcc.c 2010-01-21 10:29:30.000000000 -0500 -+++ gcc/gcc.c 2010-01-29 23:29:16.000000000 -0500 -@@ -44,6 +44,7 @@ - #include "flags.h" - #include "opts.h" - #include "vec.h" -+#include "esp.h" /* for --enable-espf support */ - - /* By default there is no special suffix for target executables. */ - /* FIXME: when autoconf is fixed, remove the host check - dj */ -@@ -7096,6 +7123,12 @@ - gcc_exec_prefix = concat (gcc_exec_prefix, spec_machine, dir_separator_str, - spec_version, dir_separator_str, NULL); - -+#ifdef ENABLE_ESPF -+ /* Process ESPF_COMMAND_OPTIONS_SPEC, adding any new options to the end -+ of the command line. */ -+ do_self_spec (espf_command_options_spec); +--- a/gcc/gcc.c 2012-02-28 18:31:38.000000000 +0100 ++++ b/gcc/gcc.c 2012-07-06 17:03:20.505842011 +0200 +@@ -756,9 +756,11 @@ static const char *cpp_unique_options = + %{!iplugindir*:%{fplugin*:%:find-plugindir()}}\ + %{H} %C %{D*&U*&A*} %{i*} %Z %i\ + %{fmudflap:-D_MUDFLAP -include mf-runtime.h}\ +- %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h}\ +- %{E|M|MM:%W{o*}}"; +- ++ %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h} " ++#ifdef ENABLE_ESPF_FORTIFY ++"%(espf_cpp_unique_options) " +#endif -+ - /* Now we have the specs. - Set the `valid' bits for switches that match anything in any spec. */ - ++"%{E|M|MM:%W{o*}}"; + /* This contains cpp options which are common with cc1_options and are passed + only when preprocessing only to avoid duplication. We pass the cc1 spec + options to the preprocessor so that it the cc1 spec may manipulate |