diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 08bb2c5..d353106 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -226,8 +226,12 @@ extern void (*arm_lang_output_object_attributes_hook)(void); 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 "" diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h index 70102a0..5e21a08 100644 --- a/gcc/config/arm/elf.h +++ b/gcc/config/arm/elf.h @@ -49,11 +49,7 @@ #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/config/esp.h b/gcc/config/esp.h index 1530200..3ff61ed 100644 --- a/gcc/config/esp.h +++ b/gcc/config/esp.h @@ -1,15 +1,15 @@ /* License terms see GNU GENERAL PUBLIC LICENSE Version 3. - * Version 20130810.1 + * Version 20130214.1 * Magnus Granberg (Zorry) */ #ifndef GCC_ESP_H #define GCC_ESP_H -/* This file will add -fstack-protector-all, -fstack-check, -fPIE, -pie and -z now +/* 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 and -fstack-check when building kernels. + -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. @@ -20,7 +20,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: %{!fno-stack-check: }}}" + #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: }}" #else #define ESP_CC1_SSP_SPEC "" #endif @@ -46,8 +46,7 @@ #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-check|fstack-check=*:;: -fstack-check}" + fstack-protector|fstack-protector-all:;:-fstack-protector-all}" #else #define ESP_OPTIONS_SSP_SPEC "" #endif diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c index c9a2216..49db3be 100644 --- a/gcc/config/i386/driver-i386.c +++ b/gcc/config/i386/driver-i386.c @@ -639,18 +639,13 @@ const char *host_detect_local_cpu (int argc, const char **argv) /* Atom. */ cpu = "atom"; break; - case 0x0f: - /* Merom. */ - case 0x17: - case 0x1d: - /* Penryn. */ - cpu = "core2"; - break; case 0x1a: case 0x1e: case 0x1f: case 0x2e: /* Nehalem. */ + cpu = "corei7"; + break; case 0x25: case 0x2c: case 0x2f: @@ -662,25 +657,20 @@ const char *host_detect_local_cpu (int argc, const char **argv) /* Sandy Bridge. */ cpu = "corei7-avx"; break; - case 0x3a: - case 0x3e: - /* Ivy Bridge. */ - cpu = "core-avx-i"; + case 0x17: + case 0x1d: + /* Penryn. */ + cpu = "core2"; break; - case 0x3c: - case 0x45: - case 0x46: - /* Haswell. */ - cpu = "core-avx2"; + case 0x0f: + /* Merom. */ + cpu = "core2"; break; default: if (arch) { /* This is unknown family 0x6 CPU. */ - if (has_avx2) - /* Assume Haswell. */ - cpu = "core-avx2"; - else if (has_avx) + if (has_avx) /* Assume Sandy Bridge. */ cpu = "corei7-avx"; else if (has_sse4_2) diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index 7973f41..f5657b9 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -835,12 +835,9 @@ return false; /* VSIB addressing doesn't support (%rip). */ - if (parts.disp) - { - disp = parts.disp; - if (GET_CODE (disp) == CONST) + if (parts.disp && GET_CODE (parts.disp) == CONST) { - disp = XEXP (disp, 0); + disp = XEXP (parts.disp, 0); if (GET_CODE (disp) == PLUS) disp = XEXP (disp, 0); if (GET_CODE (disp) == UNSPEC) @@ -852,12 +849,6 @@ return false; } } - if (TARGET_64BIT - && flag_pic - && (GET_CODE (disp) == SYMBOL_REF - || GET_CODE (disp) == LABEL_REF)) - return false; - } return true; }) diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h index 55b475d..417b971 100644 --- a/gcc/config/ia64/linux.h +++ b/gcc/config/ia64/linux.h @@ -92,5 +92,5 @@ do { \ #define STACK_CHECK_STATIC_BUILTIN 1 #ifdef ENABLE_ESP -#define DRIVER_SELF_SPECS ESP_DRIVER_SELF_SPEC +#define DRIVER_SELF_SPECS ESP_DRIVER_SELF_SPECS #endif diff --git a/gcc/gcc.c b/gcc/gcc.c index ae3a5e3..cb9e011 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -6434,48 +6434,6 @@ main (int argc, char **argv) do_option_spec (option_default_specs[i].name, option_default_specs[i].spec); -#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32)) - /* Add specs listed in GCC_SPECS. Note; in the process of separating - * each spec listed, the string is overwritten at token boundaries - * (':') with '\0', an effect of strtok_r(). - */ - specs_file = getenv ("GCC_SPECS"); - if (specs_file && (strlen(specs_file) > 0)) - { - char *spec, *saveptr; - for (spec=strtok_r(specs_file,":",&saveptr); - spec!=NULL; - spec=strtok_r(NULL,":",&saveptr)) - { - struct user_specs *user = (struct user_specs *) - xmalloc (sizeof (struct user_specs)); - user->next = (struct user_specs *) 0; - user->filename = spec; - if (user_specs_tail) - user_specs_tail->next = user; - else - user_specs_head = user; - user_specs_tail = user; - } - } -#endif - /* Process any user specified specs in the order given on the command - * line. */ - for (uptr = user_specs_head; uptr; uptr = uptr->next) - { - char *filename = find_a_file (&startfile_prefixes, uptr->filename, - R_OK, true); - read_specs (filename ? filename : uptr->filename, false, true); - } - /* Process any user self specs. */ - { - struct spec_list *sl; - for (sl = specs; sl; sl = sl->next) - if (sl->name_len == sizeof "self_spec" - 1 - && !strcmp (sl->name, "self_spec")) - do_self_spec (*sl->ptr_spec); - } - /* Process DRIVER_SELF_SPECS, adding any new options to the end of the command line. */ @@ -6584,6 +6542,50 @@ main (int argc, char **argv) PREFIX_PRIORITY_LAST, 0, 1); } + /* Process any user specified specs in the order given on the command + line. */ +#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32)) + /* Add specs listed in GCC_SPECS. Note; in the process of separating + * each spec listed, the string is overwritten at token boundaries + * (':') with '\0', an effect of strtok_r(). + */ + specs_file = getenv ("GCC_SPECS"); + if (specs_file && (strlen(specs_file) > 0)) + { + char *spec, *saveptr; + for (spec=strtok_r(specs_file,":",&saveptr); + spec!=NULL; + spec=strtok_r(NULL,":",&saveptr)) + { + struct user_specs *user = (struct user_specs *) + xmalloc (sizeof (struct user_specs)); + + user->next = (struct user_specs *) 0; + user->filename = spec; + if (user_specs_tail) + user_specs_tail->next = user; + else + user_specs_head = user; + user_specs_tail = user; + } + } +#endif + for (uptr = user_specs_head; uptr; uptr = uptr->next) + { + char *filename = find_a_file (&startfile_prefixes, uptr->filename, + R_OK, true); + read_specs (filename ? filename : uptr->filename, false, true); + } + + /* Process any user self specs. */ + { + struct spec_list *sl; + for (sl = specs; sl; sl = sl->next) + if (sl->name_len == sizeof "self_spec" - 1 + && !strcmp (sl->name, "self_spec")) + do_self_spec (*sl->ptr_spec); + } + if (compare_debug) { enum save_temps save; diff --git a/gcc/varasm.c b/gcc/varasm.c index ea709fd..74de6ca 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -5939,7 +5939,11 @@ decl_default_tls_model (const_tree decl) 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;