]> gcc.gnu.org Git - gcc.git/commitdiff
arm.h (TARGET_CPU_CPP_BUILTINS): Define.
authorNeil Booth <neil@daikokuya.demon.co.uk>
Tue, 14 May 2002 17:35:50 +0000 (17:35 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Tue, 14 May 2002 17:35:50 +0000 (17:35 +0000)
config:
* arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define.
(CPP_SPEC): Update.
(CPP_APCS_PC_SPEC, CPP_APCS_PC_DEFAULT_SPEC,
CPP_FLOAT_SPEC, CPP_FLOAT_DEFAULT_SPEC, CPP_ENDIAN_SPEC,
CPP_ENDIAN_DEFAULT_SPEC, CPP_INTERWORK_DEFAULT_SPEC,
CPP_INTERWORK_SPEC, CPP_PREDEFINES): Remove.
(EXTRA_SPECS): Update.
* arm/conix-elf.h, arm/linux-elf.h, arm/netbsd.h, arm/riscix.h,
arm/riscix1-1.h, arm/rtems-elf.h, arm/semiaof.h, arm/unknown-elf.h,
arm/unknown-elf-oabi.h, arm/vxarm.h: Remove CPP_PREDEFINES and
define TARGET_OS_CPP_BUILTINS if necessary.

From-SVN: r53463

12 files changed:
gcc/ChangeLog
gcc/config/arm/arm.h
gcc/config/arm/conix-elf.h
gcc/config/arm/linux-elf.h
gcc/config/arm/netbsd.h
gcc/config/arm/riscix.h
gcc/config/arm/riscix1-1.h
gcc/config/arm/rtems-elf.h
gcc/config/arm/semiaof.h
gcc/config/arm/unknown-elf-oabi.h
gcc/config/arm/unknown-elf.h
gcc/config/arm/vxarm.h

index 7aaa4d2d1baefd0e3e581643583971855ee68152..66186b54efdd6efd2d69426d18982fec2a40bed2 100644 (file)
@@ -1,3 +1,18 @@
+2002-05-14  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+config:
+       * arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define.
+       (CPP_SPEC): Update.
+       (CPP_APCS_PC_SPEC, CPP_APCS_PC_DEFAULT_SPEC,
+       CPP_FLOAT_SPEC, CPP_FLOAT_DEFAULT_SPEC, CPP_ENDIAN_SPEC,
+       CPP_ENDIAN_DEFAULT_SPEC, CPP_INTERWORK_DEFAULT_SPEC,
+       CPP_INTERWORK_SPEC, CPP_PREDEFINES): Remove.
+       (EXTRA_SPECS): Update.
+       * arm/conix-elf.h, arm/linux-elf.h, arm/netbsd.h, arm/riscix.h,
+       arm/riscix1-1.h, arm/rtems-elf.h, arm/semiaof.h, arm/unknown-elf.h,
+       arm/unknown-elf-oabi.h, arm/vxarm.h: Remove CPP_PREDEFINES and
+       define TARGET_OS_CPP_BUILTINS if necessary.
+
 2002-05-14  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * gcc.c (cpp_options): Must pass -m* and -f* options
@@ -44,6 +59,10 @@ Tue May 14 12:38:30 CEST 2002  Jan Hubicka  <jh@suse.cz>
        * config/i386/i386.md: Use define_constants for unspec numbers.
        * config/i386/i386.c: Likewise.
 
+2002-05-13  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * doc/contrib.texi: Update my entry.
+
 2002-05-13  Mark Mitchell  <mark@codesourcery.com>
 
        * fixinc/inclhack.def (winidss_valist): Limit applicability.
index 240595e58f51d2aa42d97f492459c3b0d82b6efb..b5a848aae131244110fba241b90be27491a256cf 100644 (file)
@@ -26,6 +26,47 @@ Boston, MA 02111-1307, USA.  */
 #ifndef GCC_ARM_H
 #define GCC_ARM_H
 
+/* Target CPU builtins.  */
+#define TARGET_CPU_CPP_BUILTINS()                      \
+  do                                                   \
+    {                                                  \
+       if (TARGET_THUMB)                               \
+         builtin_define ("__arm__");                   \
+       else                                            \
+         builtin_define ("__thumb__");                 \
+                                                       \
+       if (TARGET_BIG_END)                             \
+         {                                             \
+           builtin_define ("__ARMEB__");               \
+           if (TARGET_THUMB)                           \
+             builtin_define ("__THUMBEB__");           \
+           if (TARGET_LITTLE_WORDS)                    \
+             builtin_define ("__ARMWEL__");            \
+         }                                             \
+        else                                           \
+         {                                             \
+           builtin_define ("__ARMEL__");               \
+           if (TARGET_THUMB)                           \
+             builtin_define ("__THUMBEL__");           \
+         }                                             \
+                                                       \
+       if (TARGET_APCS_32)                             \
+         builtin_define ("__APCS_32__");               \
+       else                                            \
+         builtin_define ("__APCS_26__");               \
+                                                       \
+       if (TARGET_SOFT_FLOAT)                          \
+         builtin_define ("__SOFTFP__");                \
+                                                       \
+       /* Add a define for interworking.               \
+          Needed when building libgcc.a.  */           \
+       if (TARGET_INTERWORK)                           \
+         builtin_define ("__THUMB_INTERWORK__");       \
+                                                       \
+       builtin_assert ("cpu=arm");                     \
+       builtin_assert ("machine=arm");                 \
+    } while (0)
+
 #define TARGET_CPU_arm2                0x0000
 #define TARGET_CPU_arm250      0x0000
 #define TARGET_CPU_arm3                0x0000
@@ -126,16 +167,17 @@ Unrecognized value in TARGET_CPU_DEFAULT.
 #endif
 
 #undef  CPP_SPEC
-#define CPP_SPEC "\
-%(cpp_cpu_arch) %(cpp_apcs_pc) %(cpp_float) \
-%(cpp_endian) %(subtarget_cpp_spec) %(cpp_isa) %(cpp_interwork)"
-
-#define CPP_ISA_SPEC "%{mthumb:-D__thumb__} %{!mthumb:-D__arm__}"
+#define CPP_SPEC "%(cpp_cpu_arch) %(subtarget_cpp_spec)                        \
+%{mapcs-32:%{mapcs-26:                                                 \
+       %e-mapcs-26 and -mapcs-32 may not be used together}}            \
+%{msoft-float:%{mhard-float:                                           \
+       %e-msoft-float and -mhard_float may not be used together}}      \
+%{mbig-endian:%{mlittle-endian:                                                \
+       %e-mbig-endian and -mlittle-endian may not be used together}}"
 
 /* Set the architecture define -- if -march= is set, then it overrides
    the -mcpu= setting.  */
 #define CPP_CPU_ARCH_SPEC "\
--Acpu=arm -Amachine=arm \
 %{march=arm2:-D__ARM_ARCH_2__} \
 %{march=arm250:-D__ARM_ARCH_2__} \
 %{march=arm3:-D__ARM_ARCH_2__} \
@@ -206,58 +248,6 @@ Unrecognized value in TARGET_CPU_DEFAULT.
  %{!mcpu*:%(cpp_cpu_arch_default)}} \
 "
 
-/* Define __APCS_26__ if the PC also contains the PSR */
-#define CPP_APCS_PC_SPEC "\
-%{mapcs-32:%{mapcs-26:%e-mapcs-26 and -mapcs-32 may not be used together} \
- -D__APCS_32__} \
-%{mapcs-26:-D__APCS_26__} \
-%{!mapcs-32: %{!mapcs-26:%(cpp_apcs_pc_default)}} \
-"
-
-#ifndef CPP_APCS_PC_DEFAULT_SPEC
-#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_26__"
-#endif
-
-#define CPP_FLOAT_SPEC "\
-%{msoft-float:\
-  %{mhard-float:%e-msoft-float and -mhard_float may not be used together} \
-  -D__SOFTFP__} \
-%{!mhard-float:%{!msoft-float:%(cpp_float_default)}} \
-"
-
-/* Default is hard float, which doesn't define anything */
-#define CPP_FLOAT_DEFAULT_SPEC ""
-
-#define CPP_ENDIAN_SPEC "\
-%{mbig-endian:                                                         \
-  %{mlittle-endian:                                                    \
-    %e-mbig-endian and -mlittle-endian may not be used together}       \
-  -D__ARMEB__ %{mwords-little-endian:-D__ARMWEL__} %{mthumb:-D__THUMBEB__}}\
-%{mlittle-endian:-D__ARMEL__ %{mthumb:-D__THUMBEL__}}                  \
-%{!mlittle-endian:%{!mbig-endian:%(cpp_endian_default)}}               \
-"
-
-/* Default is little endian.  */
-#define CPP_ENDIAN_DEFAULT_SPEC "-D__ARMEL__ %{mthumb:-D__THUMBEL__}"
-
-/* Add a define for interworking.  Needed when building libgcc.a.  
-   This must define __THUMB_INTERWORK__ to the pre-processor if
-   interworking is enabled by default.  */
-#ifndef CPP_INTERWORK_DEFAULT_SPEC
-#define CPP_INTERWORK_DEFAULT_SPEC ""
-#endif
-
-#define CPP_INTERWORK_SPEC "                                           \
-%{mthumb-interwork:                                                    \
-  %{mno-thumb-interwork: %eincompatible interworking options}          \
-  -D__THUMB_INTERWORK__}                                               \
-%{!mthumb-interwork:%{!mno-thumb-interwork:%(cpp_interwork_default)}}  \
-"
-
-#ifndef CPP_PREDEFINES
-#define CPP_PREDEFINES ""
-#endif
-
 #ifndef CC1_SPEC
 #define CC1_SPEC ""
 #endif
@@ -274,15 +264,6 @@ Unrecognized value in TARGET_CPU_DEFAULT.
 #define EXTRA_SPECS                                            \
   { "cpp_cpu_arch",            CPP_CPU_ARCH_SPEC },            \
   { "cpp_cpu_arch_default",    CPP_ARCH_DEFAULT_SPEC },        \
-  { "cpp_apcs_pc",             CPP_APCS_PC_SPEC },             \
-  { "cpp_apcs_pc_default",     CPP_APCS_PC_DEFAULT_SPEC },     \
-  { "cpp_float",               CPP_FLOAT_SPEC },               \
-  { "cpp_float_default",       CPP_FLOAT_DEFAULT_SPEC },       \
-  { "cpp_endian",              CPP_ENDIAN_SPEC },              \
-  { "cpp_endian_default",      CPP_ENDIAN_DEFAULT_SPEC },      \
-  { "cpp_isa",                 CPP_ISA_SPEC },                 \
-  { "cpp_interwork",           CPP_INTERWORK_SPEC },           \
-  { "cpp_interwork_default",   CPP_INTERWORK_DEFAULT_SPEC },   \
   { "subtarget_cpp_spec",      SUBTARGET_CPP_SPEC },           \
   SUBTARGET_EXTRA_SPECS
 
index b74afdfc006dda6681b42eeeacddbbf4196b0275..4a137d61b958d72d1e2ecd7d9ee2c3151026abe9 100644 (file)
@@ -39,6 +39,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
 #define SUBTARGET_CPU_DEFAULT          TARGET_CPU_arm7tdmi
 #endif
      
-#undef  CPP_PREDEFINES
-#define CPP_PREDEFINES \
-  "-D__arm__ -D__CONIX__ -D__ELF__"
+#define TARGET_OS_CPP_BUILTINS()               \
+    do {                                       \
+       builtin_define ("__CONIX__");           \
+       builtin_define ("__ELF__");             \
+    } while (0)
index f1c86d28110b4198e4ca4b087eb9008bc5608f92..6733564044d981d044510dbf3f15b4aa99be56e7 100644 (file)
@@ -89,10 +89,15 @@ Boston, MA 02111-1307, USA.  */
    %{mbig-endian:-EB}" \
    SUBTARGET_EXTRA_LINK_SPEC
 
-#undef  CPP_PREDEFINES
-#define CPP_PREDEFINES \
-"-Dunix -D__gnu_linux__ -Dlinux -D__ELF__ \
--Asystem=unix -Asystem=posix"
+#define TARGET_OS_CPP_BUILTINS()               \
+    do {                                       \
+       builtin_define_std ("unix");            \
+       builtin_define_std ("linux");           \
+       builtin_define ("__gnu_linux__");       \
+       builtin_define ("__ELF__");             \
+       builtin_assert ("system=unix");         \
+       builtin_assert ("system=posix");        \
+    } while (0)
 
 /* Allow #sccs in preprocessor.  */
 #define SCCS_DIRECTIVE
index 2be49d8f071717030865da1318fa8005b62b1e68..17d3d2c93cec732fea66ca981d9b05bc0d6a0068 100644 (file)
@@ -44,10 +44,15 @@ Boston, MA 02111-1307, USA.  */
 
 /* Some defines for CPP.
    arm32 is the NetBSD port name, so we always define arm32 and __arm32__.  */
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "\
--Dunix -Driscbsd -Darm32 -D__arm32__ -D__arm__ -D__NetBSD__ \
--Asystem=unix -Asystem=NetBSD"
+#define TARGET_OS_CPP_BUILTINS()               \
+    do {                                       \
+       builtin_define_std ("arm32");           \
+       builtin_define_std ("unix");            \
+       builtin_define_std ("riscbsd");         \
+       builtin_define ("__NetBSD__");          \
+       builtin_assert ("system=unix");         \
+       builtin_assert ("system=NetBSD");       \
+    } while (0)
 
 /* Define _POSIX_SOURCE if necessary.  */
 #undef CPP_SPEC
index 35fc23258d2e33be270ba2aadf9c8d8b8d9a2c93..46f52e19cdc7e9d81afbf25dac72e4a4e6c405fd 100644 (file)
@@ -47,11 +47,13 @@ Boston, MA 02111-1307, USA.  */
 #define LINK_SPEC "-X"
 #endif
 
-#ifndef CPP_PREDEFINES
-#define CPP_PREDEFINES  \
-    "-Darm -Driscix -Dunix -Asystem=unix"
-#endif
-
+#define TARGET_OS_CPP_BUILTINS()               \
+    do {                                       \
+       builtin_define_std ("arm");             \
+       builtin_define_std ("unix");            \
+       builtin_define_std ("riscix");          \
+       builtin_assert ("system=unix");         \
+    } while (0)
 
 /* RISCiX has some weird symbol name munging, that is done to the object module
    after assembly, which enables multiple libraries to be supported within
index fd93d40f05ea82a4ec74b57e6cbeacee94c58ade..aadbc6c3b1b6d2d856e683c34767cf3c8502875c 100644 (file)
@@ -29,9 +29,13 @@ Boston, MA 02111-1307, USA.  */
 #define STARTFILE_SPEC  \
   "%{pg:/usr/lib/gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}"
 
-#ifndef CPP_PREDEFINES
-#define CPP_PREDEFINES  "-Darm -Driscix -Dunix -Asystem=unix"
-#endif
+#define TARGET_OS_CPP_BUILTINS()               \
+    do {                                       \
+       builtin_define_std ("arm");             \
+       builtin_define_std ("unix");            \
+       builtin_define_std ("riscix");          \
+       builtin_assert ("system=unix");         \
+    } while (0)
 
 /* Riscix 1.1 doesn't have X/OPEN support, so only accept -mbsd (but ignore
    it).  
index 312c96fc3e31a442821c1b518991cb8cfb8d4d51..27928db54896ddd1a4b94287e0bd14721db7700c 100644 (file)
@@ -24,5 +24,9 @@ Boston, MA 02111-1307, USA.  */
 
 #define HAS_INIT_SECTION
 
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__rtems__ -D__ELF__ -Asystem=rtems"
+#define TARGET_OS_CPP_BUILTINS()               \
+    do {                                       \
+       builtin_define ("__rtems__");           \
+       builtin_define ("__ELF__");             \
+       builtin_assert ("system=rtems");        \
+    } while (0)
index 7ca68bc95c25bceb3a6110db915577a6c294ad2a..6ee17ef01ce6317a8005df292e1d6f3748c82fa6 100644 (file)
@@ -20,8 +20,11 @@ along with GNU CC; see the file COPYING.  If not, write to
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-#define CPP_PREDEFINES \
-    "-Darm -Dsemi"
+#define TARGET_OS_CPP_BUILTINS()               \
+    do {                                       \
+       builtin_define_std ("arm");             \
+       builtin_define_std ("semi");            \
+    } while (0)
 
 #define ASM_SPEC "%{g -g} -arch 4 \
 -apcs 3%{mapcs-32:/32bit}%{mapcs-26:/26bit}%{!mapcs-26:%{!macps-32:/32bit}}"
index cc58f3ae2bed8e6ce4ef27eca5c5ee9a5fdecd2c..8322508a232b1cd08d0922930b51017cab8b634b 100644 (file)
@@ -23,9 +23,6 @@ Boston, MA 02111-1307, USA.  */
 #undef  TARGET_VERSION
 #define TARGET_VERSION fputs (" (ARM/ELF non-Linux old abi)", stderr);
 
-#undef  CPP_PREDEFINES
-#define CPP_PREDEFINES "-Darm_oabi -Darm -Darm_elf -Acpu=arm -Amachine=arm -D__ELF__"
-
 #undef  ASM_SPEC
 #define ASM_SPEC "-moabi %{mbig-endian:-EB} %{mcpu=*:-m%*} %{march=*:-m%*} \
  %{mapcs-*:-mapcs-%*} %{mthumb-interwork:-mthumb-interwork}"
index 0741884ee120cc80edea6f600058aa7b4ee561b4..df3977c1c5673fcc7cfcfa705a18c2eea228b27d 100644 (file)
@@ -86,10 +86,6 @@ Boston, MA 02111-1307, USA.  */
     }                                                                  \
   while (0)
 
-#ifndef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__ELF__"
-#endif
-
 #ifndef CPP_APCS_PC_DEFAULT_SPEC
 #define CPP_APCS_PC_DEFAULT_SPEC       "-D__APCS_32__"
 #endif
index 755936450c889cfc2365ae3714cfad410ca779fd..473362e4332d8fb18339a9fda6c506b603a0a4d5 100644 (file)
@@ -37,8 +37,10 @@ Boston, MA 02111-1307, USA.  */
   %{!mcpu*:%{!march=*:-DCPU=ARM710A}}  \
 "
 
-#undef  CPP_PREDEFINES
-#define CPP_PREDEFINES  "-D__vxworks -Acpu=arm -Amachine=arm"
+#define TARGET_OS_CPP_BUILTINS()               \
+    do {                                       \
+       builtin_define ("__vxworks");           \
+    } while (0)
 
 /* VxWorks does all the library stuff itself.  */
 #undef  LIB_SPEC
This page took 0.092867 seconds and 5 git commands to generate.