diff options
author | hp <hp@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-15 21:37:37 +0000 |
---|---|---|
committer | hp <hp@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-15 21:37:37 +0000 |
commit | 9ac1d4852b9064071419759ba5118705835ee932 (patch) | |
tree | 51ab2c3ccf533c165af95d70ccf68877dc842904 /gcc/config/cris/linux.h | |
parent | 7c736129ddaf1b8ee6b002816b310ed4f4020d06 (diff) | |
download | gcc-9ac1d4852b9064071419759ba5118705835ee932.tar.gz |
* config/cris/linux.h: Sanity-check TARGET_CPU_DEFAULT for
presence and contents.
(CRIS_SUBTARGET_DEFAULT_ARCH): New macro, MASK_AVOID_GOTPLT for
v32, 0 otherwise.
(CRIS_CPP_SUBTARGET_SPEC, CRIS_CC1_SUBTARGET_SPEC,
CRIS_ASM_SUBTARGET_SPEC): Adjust for different
TARGET_CPU_DEFAULT.
(CRIS_SUBTARGET_DEFAULT): Add CRIS_SUBTARGET_DEFAULT_ARCH.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130969 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/cris/linux.h')
-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 |