diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/cris/linux.h | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/gcc/config/cris/linux.h b/gcc/config/cris/linux.h index becbac8405d..0d0b7f4a7e7 100644 --- a/gcc/config/cris/linux.h +++ b/gcc/config/cris/linux.h @@ -35,6 +35,13 @@ along with GCC; see the file COPYING3. If not see /* This file defines the macros for cris-axis-linux-gnu that are not covered by cris.h, elfos.h and (config/)linux.h. */ +/* Make sure we have a valid TARGET_CPU_DEFAULT, so we can assume it + and take shortcuts below. */ +#ifndef TARGET_CPU_DEFAULT +#error "TARGET_CPU_DEFAULT not defined" +#elif (TARGET_CPU_DEFAULT+0) != 10 && (TARGET_CPU_DEFAULT+0) != 32 +#error "TARGET_CPU_DEFAULT must be 10 or 32, or this file be updated" +#endif /* Node: Instruction Output */ @@ -45,19 +52,41 @@ along with GCC; see the file COPYING3. If not see /* These macros are CRIS-specific, but used in target driver macros. */ #undef CRIS_CPP_SUBTARGET_SPEC -#define CRIS_CPP_SUBTARGET_SPEC \ +#if TARGET_CPU_DEFAULT == 32 +# define CRIS_CPP_SUBTARGET_SPEC \ + "%{pthread:-D_REENTRANT}\ + %{!march=*:%{!cpu=*:-D__arch_v32 -D__CRIS_arch_version=32}}" +#else +# define CRIS_CPP_SUBTARGET_SPEC \ "%{pthread:-D_REENTRANT}\ %{!march=*:%{!cpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}" +#endif #undef CRIS_CC1_SUBTARGET_SPEC -#define CRIS_CC1_SUBTARGET_SPEC \ +#if TARGET_CPU_DEFAULT == 32 +# define CRIS_CC1_SUBTARGET_SPEC \ + "%{!march=*:%{!cpu=*:-march=v32}}" +#define CRIS_SUBTARGET_DEFAULT_ARCH MASK_AVOID_GOTPLT +#else +# define CRIS_CC1_SUBTARGET_SPEC \ "%{!march=*:%{!cpu=*:-march=v10}}" +#define CRIS_SUBTARGET_DEFAULT_ARCH 0 +#endif #undef CRIS_ASM_SUBTARGET_SPEC -#define CRIS_ASM_SUBTARGET_SPEC \ - "--em=criself\ +#if TARGET_CPU_DEFAULT == 32 +# define CRIS_ASM_SUBTARGET_SPEC \ + "--em=criself \ + %{!march=*:%{!cpu=*:--march=v32}} \ + %{!fleading-underscore:--no-underscore}\ + %{fPIC|fpic|fPIE|fpie: --pic}" +#else +# define CRIS_ASM_SUBTARGET_SPEC \ + "--em=criself \ + %{!march=*:%{!cpu=*:--march=v10}} \ %{!fleading-underscore:--no-underscore}\ %{fPIC|fpic|fPIE|fpie: --pic}" +#endif /* Previously controlled by target_flags. */ #undef TARGET_LINUX @@ -67,7 +96,8 @@ along with GCC; see the file COPYING3. If not see #define CRIS_SUBTARGET_DEFAULT \ (MASK_SVINTO \ + MASK_ETRAX4_ADD \ - + MASK_ALIGN_BY_32) + + MASK_ALIGN_BY_32 \ + + CRIS_SUBTARGET_DEFAULT_ARCH) #undef CRIS_DEFAULT_CPU_VERSION #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG |