diff options
author | Magnus Granberg <zorry@gentoo.org> | 2013-08-21 01:24:51 +0200 |
---|---|---|
committer | Magnus Granberg <zorry@gentoo.org> | 2013-08-21 01:24:51 +0200 |
commit | 3c0da0c534af3033a0444baad7617d548c368759 (patch) | |
tree | e87e302de80c5e6baf853c46686eae1cfedfc27c | |
parent | commit what gose in to gcc 4.8 piepatchset 0.5.5 in tree (diff) | |
download | hardened-gccpatchset-3c0da0c534af3033a0444baad7617d548c368759.tar.gz hardened-gccpatchset-3c0da0c534af3033a0444baad7617d548c368759.tar.bz2 hardened-gccpatchset-3c0da0c534af3033a0444baad7617d548c368759.zip |
update gcc 4.8.X patchset
-rw-r--r-- | gcc-4.8.0/piepatch/05_all_gcc47_gcc.c.patch | 70 | ||||
-rw-r--r-- | gcc-4.8.0/piepatch/15_all_gcc44_decl-tls-model.patch | 20 | ||||
-rw-r--r-- | gcc-4.8.0/piepatch/33_all_gcc46_config_rs6000_linux64.h.patch | 16 | ||||
-rw-r--r-- | gcc-4.8.0/piepatch/34_all_gcc48_config_i386_gnu-user.patch | 15 | ||||
-rw-r--r-- | gcc-4.8.0/piepatch/35_all_gcc48_config_arm.patch | 33 | ||||
-rw-r--r-- | gcc-4.8.0/piepatch/37_all_gcc48_config_ia64.patch | 6 | ||||
-rw-r--r-- | gcc-4.8.0/piepatch/40_all_gcc48_config_esp.patch | 17 | ||||
-rw-r--r-- | gcc-4.8.0/piepatch/README.Changelog | 25 | ||||
-rw-r--r-- | gcc-4.8.0/piepatch/README.history | 6 |
9 files changed, 52 insertions, 156 deletions
diff --git a/gcc-4.8.0/piepatch/05_all_gcc47_gcc.c.patch b/gcc-4.8.0/piepatch/05_all_gcc47_gcc.c.patch deleted file mode 100644 index 7f5a5d4..0000000 --- a/gcc-4.8.0/piepatch/05_all_gcc47_gcc.c.patch +++ /dev/null @@ -1,70 +0,0 @@ -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 - ---- 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 "opts.h" - #include "params.h" - #include "vec.h" -+#include "config/esp.h" /* for --enable-esp support */ - #include "filenames.h" - - /* By default there is no special suffix for target executables. */ -@@ -822,7 +823,9 @@ - - static const char *asm_debug; - static const char *cpp_spec = CPP_SPEC; -+#ifndef ENABLE_ESP - static const char *cc1_spec = CC1_SPEC; -+#endif - static const char *cc1plus_spec = CC1PLUS_SPEC; - static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC; - static const char *link_ssp_spec = LINK_SSP_SPEC; -@@ -1699,18 +1705,23 @@ - INIT_STATIC_SPEC ("sysroot_hdrs_suffix_spec", &sysroot_hdrs_suffix_spec), - }; - --#ifdef EXTRA_SPECS /* additional specs needed */ -+/* EXTRA_SPECS needs to be defined */ -+#ifndef EXTRA_SPECS -+#define EXTRA_SPECS -+#endif -+ -+/* EXTRA_SPECS and ESP_EXTRA_SPECS add additional specs */ - /* Structure to keep track of just the first two args of a spec_list. -- That is all that the EXTRA_SPECS macro gives us. */ -+ That is all that the EXTRA_SPECS and ESP_EXTRA_SPECS macro gives us. */ - struct spec_list_1 - { - const char *const name; - const char *const ptr; - }; - --static const struct spec_list_1 extra_specs_1[] = { EXTRA_SPECS }; -+/* ESP_EXTRA_SPECS before EXTRA_SPECS */ -+static const struct spec_list_1 extra_specs_1[] = { ESP_EXTRA_SPECS, EXTRA_SPECS }; - static struct spec_list *extra_specs = (struct spec_list *) 0; --#endif - - /* List of dynamically allocates specs that have been defined so far. */ - -@@ -1798,7 +1809,6 @@ - if (verbose_flag) - notice ("Using built-in specs.\n"); - --#ifdef EXTRA_SPECS - extra_specs = XCNEWVEC (struct spec_list, ARRAY_SIZE (extra_specs_1)); - - for (i = ARRAY_SIZE (extra_specs_1) - 1; i >= 0; i--) -@@ -1811,7 +1821,6 @@ - sl->ptr_spec = &sl->ptr; - next = sl; - } --#endif - - for (i = ARRAY_SIZE (static_specs) - 1; i >= 0; i--) - { diff --git a/gcc-4.8.0/piepatch/15_all_gcc44_decl-tls-model.patch b/gcc-4.8.0/piepatch/15_all_gcc44_decl-tls-model.patch deleted file mode 100644 index 09438a0..0000000 --- a/gcc-4.8.0/piepatch/15_all_gcc44_decl-tls-model.patch +++ /dev/null @@ -1,20 +0,0 @@ -2009-06-13 Magnus Granberg <zorry@ume.nu> - - b.g.o #232601 - * gcc/varasm.c (decl_tls_model): Check flag_pic instead of flag_shlib. - ---- gcc/varasm.c 2009-03-17 21:18:21.000000000 +0100 -+++ gcc/varasm.c 2009-04-29 03:10:09.000000000 +0200 -@@ -5607,7 +5607,11 @@ - bool is_local; - - is_local = targetm.binds_local_p (decl); -- if (!flag_shlib) -+ #ifdef ENABLE_ESP -+ if (!flag_pic) -+ #else -+ if (!flag_shlib) -+ #endif - { - if (is_local) - kind = TLS_MODEL_LOCAL_EXEC; diff --git a/gcc-4.8.0/piepatch/33_all_gcc46_config_rs6000_linux64.h.patch b/gcc-4.8.0/piepatch/33_all_gcc46_config_rs6000_linux64.h.patch deleted file mode 100644 index bfd7b75..0000000 --- a/gcc-4.8.0/piepatch/33_all_gcc46_config_rs6000_linux64.h.patch +++ /dev/null @@ -1,16 +0,0 @@ -2011-03-05 Peter S. Mazinger <ps.m@gmx.net>, Magnus Granberg <zorry@gentoo.org> - - * gcc/config/rs6000/linux64.h ASM_SPEC32 Change %{fpic:-K PIC} %{fPIC:-K PIC} - to %{fpic|fPIC|fpie|fPIE:-K PIC} - ---- gcc/config/rs6000/linux64.h.psm 2009-04-10 01:23:07.000000000 +0200 -+++ gcc/config/rs6000/linux64.h 2009-09-23 12:34:26.000000000 +0200 -@@ -162,7 +162,7 @@ - #endif - - #define ASM_SPEC32 "-a32 \ --%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \ -+%{mrelocatable} %{mrelocatable-lib} %{fpic|fPIC|fpie|fPIE:-K PIC} \ - %{memb} %{!memb: %{msdata=eabi: -memb}} \ - %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ - %{mcall-freebsd: -mbig} \ diff --git a/gcc-4.8.0/piepatch/34_all_gcc48_config_i386_gnu-user.patch b/gcc-4.8.0/piepatch/34_all_gcc48_config_i386_gnu-user.patch deleted file mode 100644 index b7cdfd4..0000000 --- a/gcc-4.8.0/piepatch/34_all_gcc48_config_i386_gnu-user.patch +++ /dev/null @@ -1,15 +0,0 @@ -2013-02-13 Magnus Granberg <zorry@gentoo.org> - - * gcc/config/i386/gnu-user. Add ESP_DRIVER_SELF_SPEC - to DRIVER_SELF_SPECS if ENABLE_ESP defined. - ---- a/gcc/config/i386/gnu-user-common.h 2013-01-10 21:38:27.000000000 +0100 -+++ b/gcc/config/i386/gnu-user-common.h 2013-02-14 00:51:44.689637605 +0100 -@@ -70,3 +70,7 @@ along with GCC; see the file COPYING3. - - /* Static stack checking is supported by means of probes. */ - #define STACK_CHECK_STATIC_BUILTIN 1 -+ -+#ifdef ENABLE_ESP -+#define DRIVER_SELF_SPECS ESP_DRIVER_SELF_SPEC -+#endif diff --git a/gcc-4.8.0/piepatch/35_all_gcc48_config_arm.patch b/gcc-4.8.0/piepatch/35_all_gcc48_config_arm.patch index e50e78e..5aecc6b 100644 --- a/gcc-4.8.0/piepatch/35_all_gcc48_config_arm.patch +++ b/gcc-4.8.0/piepatch/35_all_gcc48_config_arm.patch @@ -1,23 +1,10 @@ -2013-04-01 Magnus Granberg <zorry@gentoo.org> +2013-06-03 Magnus Granberg <zorry@gentoo.org> - * gcc/config/arm/arm.h (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS. - (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC. + * gcc/config/arm/arm.h (DRIVER_SELF_SPECS): Add ESP_DRIVER_SELF_SPEC. + * gcc/config/arm/elf.h (SUBSUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS. --- a/gcc/config/arm/arm.h 2013-01-15 17:17:28.000000000 +0100 +++ b/gcc/config/arm/arm.h 2013-02-18 22:45:18.327284928 +0100 -@@ -226,8 +226,12 @@ extern void (*arm_lang_output_object_att - SUBTARGET_EXTRA_SPECS - - #ifndef SUBTARGET_EXTRA_SPECS -+#ifdef ENABLE_ESP -+#define SUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS -+#else - #define SUBTARGET_EXTRA_SPECS - #endif -+#endif - - #ifndef SUBTARGET_CPP_SPEC - #define SUBTARGET_CPP_SPEC "" @@ -2326,6 +2326,11 @@ extern const char *host_detect_local_cpu # define MCPU_MTUNE_NATIVE_SPECS "" #endif @@ -32,3 +19,17 @@ +# define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS +#endif #endif /* ! GCC_ARM_H */ +--- a/gcc/config/arm/elf.h 2013-01-10 21:38:27.000000000 +0100 ++++ b/gcc/config/arm/elf.h 2013-05-19 02:15:49.595855825 +0200 +@@ -49,7 +49,11 @@ + #endif + + #undef SUBSUBTARGET_EXTRA_SPECS ++#ifdef ENABLE_ESP ++#define SUBSUBTARGET_EXTRA_SPECS ESP_EXTRA_SPECS ++#else + #define SUBSUBTARGET_EXTRA_SPECS ++#endif + + #ifndef ASM_SPEC + #define ASM_SPEC "\ diff --git a/gcc-4.8.0/piepatch/37_all_gcc48_config_ia64.patch b/gcc-4.8.0/piepatch/37_all_gcc48_config_ia64.patch index bae8914..ba71922 100644 --- a/gcc-4.8.0/piepatch/37_all_gcc48_config_ia64.patch +++ b/gcc-4.8.0/piepatch/37_all_gcc48_config_ia64.patch @@ -1,6 +1,6 @@ -2013-04-01 Magnus Granberg <zorry@gentoo.org> +2013-06-03 Magnus Granberg <zorry@gentoo.org> - * gcc/config/ia64/linux.h Define DRIVER_SELF_SPECS ESP_DRIVER_SELF_SPECS. + * gcc/config/ia64/linux.h Define DRIVER_SELF_SPECS ESP_DRIVER_SELF_SPEC. * gcc/config/ia64/ia64.h (SUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS. --- a/gcc/config/ia64/linux.h 2013-01-10 21:38:27.000000000 +0100 @@ -11,7 +11,7 @@ #define STACK_CHECK_STATIC_BUILTIN 1 + +#ifdef ENABLE_ESP -+#define DRIVER_SELF_SPECS ESP_DRIVER_SELF_SPECS ++#define DRIVER_SELF_SPECS ESP_DRIVER_SELF_SPEC +#endif --- a/gcc/config/ia64/ia64.h 2013-01-10 21:38:27.000000000 +0100 +++ b/gcc/config/ia64/ia64.h 2013-03-26 02:03:21.052061828 +0100 diff --git a/gcc-4.8.0/piepatch/40_all_gcc48_config_esp.patch b/gcc-4.8.0/piepatch/40_all_gcc48_config_esp.patch index 83630f2..805cc2c 100644 --- a/gcc-4.8.0/piepatch/40_all_gcc48_config_esp.patch +++ b/gcc-4.8.0/piepatch/40_all_gcc48_config_esp.patch @@ -1,23 +1,23 @@ -2013-02-14 Magnus Granberg <zorry@gentoo.org> +2013-08-10 Magnus Granberg <zorry@gentoo.org> * gcc/esp.h New file to support --enable-esp - Version 20130214.1 + Version 20130810.1 --- gcc/config/esp.h 2010-04-09 16:14:00.000000000 +0200 +++ gcc/config/esp.h 2012-06-23 01:00:31.248348491 +0200 -@@ -0,0 +1,127 @@ +@@ -0,0 +1,128 @@ +/* License terms see GNU GENERAL PUBLIC LICENSE Version 3. -+ * Version 20130214.1 ++ * Version 20130810.1 + * 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 ++/* This file will add -fstack-protector-all, -fstack-check, -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. ++ -D__KERNEL__ is added so we don't have -fPIE, -pie and -fstack-protector-all and -fstack-check 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. @@ -28,7 +28,7 @@ + /* 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: }}" ++ #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: %{!fno-stack-check: }}}" + #else + #define ESP_CC1_SSP_SPEC "" + #endif @@ -54,7 +54,8 @@ + #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP ) + #define ESP_OPTIONS_SSP_SPEC \ + "%{nostdlib|nodefaultlibs|fno-stack-protector| \ -+ fstack-protector|fstack-protector-all:;:-fstack-protector-all}" ++ fstack-protector|fstack-protector-all:;:-fstack-protector-all} \ ++ %{fstack-check|fstack-check=*:;: -fstack-check}" + #else + #define ESP_OPTIONS_SSP_SPEC "" + #endif diff --git a/gcc-4.8.0/piepatch/README.Changelog b/gcc-4.8.0/piepatch/README.Changelog index b73e521..e3ec163 100644 --- a/gcc-4.8.0/piepatch/README.Changelog +++ b/gcc-4.8.0/piepatch/README.Changelog @@ -1,3 +1,12 @@ +0.5.7 Magnus Granberg <zorry@gentoo.org> + + * gcc/config/esp.h Add -fstack-check as default. + +0.5.6 Magnus Granberg <zorry@gentoo.org> + + * gcc/config/ia64/linux.h Change ESP_DRIVER_SELF_SPECS To ESP_DRIVER_SELF_SPEC + * gcc/config/arm/elf.h (SUBSUBTARGET_EXTRA_SPECS): Add ESP_EXTRA_SPECS. + 0.5.5 Magnus Granberg <zorry@gentoo.org> * configure.ac Add mips @@ -8,19 +17,19 @@ * gcc/Makefile.in Bumped for 4.8.0 release * gcc/gcc.c Remove ESP_EXTRA_SPECS and ESP_COMMAND_OPTIONS_SPEC - * gcc/config/rs6000/sysv4.h Add ESP_DRIVER_SELF_SPECS + * gcc/config/rs6000/sysv4.h Add ESP_DRIVER_SELF_SPEC and ESP_EXTRA_SPECS - * gcc/config/i386/gnu-user-common.h Add ESP_DRIVER_SELF_SPECS - * gcc/config/i386/gnu-user.h Add ESP_DRIVER_SELF_SPECS - * gcc/config/i386/i386.h Add ESP_DRIVER_SELF_SPECS - * gcc/config/arm/arm.h Add ESP_DRIVER_SELF_SPECS and + * gcc/config/i386/gnu-user-common.h Add ESP_DRIVER_SELF_SPEC + * gcc/config/i386/gnu-user.h Add ESP_DRIVER_SELF_SPEC + * gcc/config/i386/i386.h Add ESP_DRIVER_SELF_SPEC + * gcc/config/arm/arm.h Add ESP_DRIVER_SELF_SPEC and ESP_EXTRA_SPECS - * gcc/config/mips/gnu-user.h Add ESP_DRIVER_SELF_SPECS - * gcc/config/mips/gnu-user64.h Add ESP_DRIVER_SELF_SPECS + * gcc/config/mips/gnu-user.h Add ESP_DRIVER_SELF_SPEC + * gcc/config/mips/gnu-user64.h Add ESP_DRIVER_SELF_SPEC * gcc/config/mips/mips.h Add ESP_EXTRA_SPECS * gcc/config/ia64/linux.h Add ESP_DRIVER_SELF_SPECS * gcc/config/ia64/ia64.h Add ESP_EXTRA_SPECS - * gcc/config/esp.h Bump for ESP_DRIVER_SELF_SPECS support + * gcc/config/esp.h Bump for ESP_DRIVER_SELF_SPEC support 0.5.4 Magnus Granberg <zorry@gentoo.org> diff --git a/gcc-4.8.0/piepatch/README.history b/gcc-4.8.0/piepatch/README.history index 5a2a379..18bdd75 100644 --- a/gcc-4.8.0/piepatch/README.history +++ b/gcc-4.8.0/piepatch/README.history @@ -1,3 +1,9 @@ +0.5.7 10 Jul 2013 + U 35_all_gcc48_config_esp.h.patches + - 15_all_gcc44_decl-tls-model.patch +0.5.6 03 Jun 2013 + U 35_all_gcc48_config_arm.patches + U 37_all_gcc48_config_ia64.patch 0.5.5 31 Mar 2013 - 01_all_gcc47_configure.patch + 01_all_gcc48_configure.patch |