diff options
author | Bob Wilson <bob.wilson@acm.org> | 2002-07-29 18:07:09 +0000 |
---|---|---|
committer | Bob Wilson <bwilson@gcc.gnu.org> | 2002-07-29 18:07:09 +0000 |
commit | 624f0d6033f211962065a7a7d5561603326d0d3e (patch) | |
tree | 19ebe6304de4da8414d68207ddf04f3000f245fa | |
parent | 2199e5fade2d41cbdb19bb730e494613b9b7e262 (diff) | |
download | gcc-624f0d6033f211962065a7a7d5561603326d0d3e.zip gcc-624f0d6033f211962065a7a7d5561603326d0d3e.tar.gz gcc-624f0d6033f211962065a7a7d5561603326d0d3e.tar.bz2 |
* config/xtensa/elf.h, config/xtensa/linux.h
(TARGET_OS_CPP_BUILTINS): Define.
(CPP_PREDEFINES): Remove.
* config/xtensa/xtensa.h (TARGET_CPU_CPP_BUILTINS): Define.
(CPP_SPEC): Remove.
From-SVN: r55840
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/xtensa/elf.h | 8 | ||||
-rw-r--r-- | gcc/config/xtensa/linux.h | 17 | ||||
-rw-r--r-- | gcc/config/xtensa/xtensa.h | 35 |
4 files changed, 41 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e1e8fcae..5788ddd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2002-07-29 Bob Wilson <bob.wilson@acm.org> + + * config/xtensa/elf.h, config/xtensa/linux.h + (TARGET_OS_CPP_BUILTINS): Define. + (CPP_PREDEFINES): Remove. + * config/xtensa/xtensa.h (TARGET_CPU_CPP_BUILTINS): Define. + (CPP_SPEC): Remove. + 2002-07-29 Zack Weinberg <zack@codesourcery.com> * gensupport.c: Include hashtab.h. diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h index 963bbe6..7d1ba00 100644 --- a/gcc/config/xtensa/elf.h +++ b/gcc/config/xtensa/elf.h @@ -19,6 +19,11 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define TARGET_OS_CPP_BUILTINS() \ + do { \ + builtin_define ("__ELF__"); \ + } while (0) + /* Don't assume anything about the header files. */ #define NO_IMPLICIT_EXTERN_C @@ -74,9 +79,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA %{rdynamic:-export-dynamic} \ %{static:-static}}}" -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D__XTENSA__ -D__ELF__ -Acpu=xtensa -Amachine=xtensa" - /* Local compiler-generated symbols must have a prefix that the assembler understands. By default, this is $, although some targets (e.g., NetBSD-ELF) need to override this. */ diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h index c49bd13..8f10577 100644 --- a/gcc/config/xtensa/linux.h +++ b/gcc/config/xtensa/linux.h @@ -19,6 +19,18 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define TARGET_OS_CPP_BUILTINS() \ + do { \ + builtin_define_std ("linux"); \ + builtin_define_std ("unix"); \ + builtin_define ("__ELF__"); \ + builtin_define ("__gnu_linux__"); \ + builtin_assert ("system=posix"); \ + /* The GNU C++ standard library requires this. */ \ + if (c_language == clk_cplusplus) \ + builtin_define ("_GNU_SOURCE"); \ + } while (0) + #undef TARGET_VERSION #define TARGET_VERSION fputs (" (Xtensa GNU/Linux with ELF)", stderr); @@ -49,11 +61,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ %{static:-static}}}" -#undef CPP_PREDEFINES -#define CPP_PREDEFINES \ - "-D__XTENSA__ -D__ELF__ -Acpu=xtensa -Amachine=xtensa \ - -Dunix -D__gnu_linux__ -Dlinux -Asystem=posix" - #undef LOCAL_LABEL_PREFIX #define LOCAL_LABEL_PREFIX "." diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index f2e4702..a6f468f 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -191,25 +191,22 @@ extern unsigned xtensa_current_frame_size; #define OVERRIDE_OPTIONS override_options () - -#if XCHAL_HAVE_BE -#define CPP_ENDIAN_SPEC "\ - %{mlittle-endian:-D__XTENSA_EL__} \ - %{!mlittle-endian:-D__XTENSA_EB__} " -#else /* !XCHAL_HAVE_BE */ -#define CPP_ENDIAN_SPEC "\ - %{mbig-endian:-D__XTENSA_EB__} \ - %{!mbig-endian:-D__XTENSA_EL__} " -#endif /* !XCHAL_HAVE_BE */ - -#if XCHAL_HAVE_FP -#define CPP_FLOAT_SPEC "%{msoft-float:-D__XTENSA_SOFT_FLOAT__}" -#else -#define CPP_FLOAT_SPEC "%{!mhard-float:-D__XTENSA_SOFT_FLOAT__}" -#endif - -#undef CPP_SPEC -#define CPP_SPEC CPP_ENDIAN_SPEC CPP_FLOAT_SPEC + +/* Target CPU builtins. */ +#define TARGET_CPU_CPP_BUILTINS() \ + do { \ + builtin_assert ("cpu=xtensa"); \ + builtin_assert ("machine=xtensa"); \ + builtin_define ("__XTENSA__"); \ + builtin_define (TARGET_BIG_ENDIAN ? "__XTENSA_EB__" : "__XTENSA_EL__"); \ + if (!TARGET_HARD_FLOAT) \ + builtin_define ("__XTENSA_SOFT_FLOAT__"); \ + if (flag_pic) \ + { \ + builtin_define ("__PIC__"); \ + builtin_define ("__pic__"); \ + } \ + } while (0) /* Define this to set the endianness to use in libgcc2.c, which can not depend on target_flags. */ |