aout.h (CRIS_CPP_SUBTARGET_SPEC): Move -D__AOUT__ to...
authorHans-Peter Nilsson <hp@bitrange.com>
Sun, 9 Mar 2003 01:20:03 +0000 (01:20 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Sun, 9 Mar 2003 01:20:03 +0000 (01:20 +0000)
* config/cris/aout.h (CRIS_CPP_SUBTARGET_SPEC): Move -D__AOUT__ to...
(TARGET_OS_CPP_BUILTINS): New macro.
* config/cris/cris.h (CRIS_CPP_SUBTARGET_SPEC): Move -D__ELF__ to...
(TARGET_OS_CPP_BUILTINS): New macro.
(CPP_PREDEFINES): Don't define.  Move old definitions and...
(CPP_SPEC): ...move -D__CRIS_ABI_version=2 to...
(TARGET_CPU_CPP_BUILTINS): New macro.
* config/cris/linux.h (CRIS_CPP_SUBTARGET_SPEC): Move constant
definitions and the optional __PIC__, __pic__ and
__NO_UNDERSCORES__ definitions to...
(TARGET_OS_CPP_BUILTINS): New macro.

From-SVN: r64014

gcc/ChangeLog
gcc/config/cris/aout.h
gcc/config/cris/cris.h
gcc/config/cris/linux.h

index c95dc4e2678d53dc1b1b014ba4e51fc646388df0..a64ec2376fd12f327db023758e8f0ef0442f2730 100644 (file)
@@ -1,5 +1,17 @@
 2003-03-09  Hans-Peter Nilsson  <hp@bitrange.com>
 
+       * config/cris/aout.h (CRIS_CPP_SUBTARGET_SPEC): Move -D__AOUT__ to...
+       (TARGET_OS_CPP_BUILTINS): New macro.
+       * config/cris/cris.h (CRIS_CPP_SUBTARGET_SPEC): Move -D__ELF__ to...
+       (TARGET_OS_CPP_BUILTINS): New macro.
+       (CPP_PREDEFINES): Don't define.  Move old definitions and...
+       (CPP_SPEC): ...move -D__CRIS_ABI_version=2 to...
+       (TARGET_CPU_CPP_BUILTINS): New macro.
+       * config/cris/linux.h (CRIS_CPP_SUBTARGET_SPEC): Move constant
+       definitions and the optional __PIC__, __pic__ and
+       __NO_UNDERSCORES__ definitions to...
+       (TARGET_OS_CPP_BUILTINS): New macro.
+
        * flags.h (flag_leading_underscore): Declare.
 
        * c-opts.c (c_common_post_options): On fopen failure, return
index 8c4e7b7f6dc066bea4a428f81137d98de755afa6..db98c3fe9571af484775f73e7726175f6969df3d 100644 (file)
@@ -64,8 +64,7 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CRIS_CPP_SUBTARGET_SPEC
 #define CRIS_CPP_SUBTARGET_SPEC \
- "-D__AOUT__\
-  %{melinux:-D__gnu_linux__ -D__linux__ -D__unix__ -D__elinux__ -D__uclinux__\
+ "%{melinux:-D__gnu_linux__ -D__linux__ -D__unix__ -D__elinux__ -D__uclinux__\
     %{!nostdinc:\
       %{!mbest-lib-options:%{isystem*}}\
       -isystem elinux/include%s\
@@ -118,6 +117,19 @@ Boston, MA 02111-1307, USA.  */
 #undef CRIS_SUBTARGET_DEFAULT
 #define CRIS_SUBTARGET_DEFAULT 0
 
+
+/* Node: Run-time Target */
+
+/* For the cris-*-aout subtarget.  */
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+      builtin_define ("__AOUT__");             \
+    }                                          \
+  while (0)
+
+
 /* Node: Storage Layout */
 
 /* We can align to 16 bits (only) with CRIS a.out.  */
index d3d44e8252f239fcbec192690e5131a1801c7ead..13bff9cee3bbe768c20036806b565b25c900a0ac 100644 (file)
@@ -116,8 +116,7 @@ extern const char *cris_elinux_stacksize_str;
    Note that -melf overrides -maout.  */
 
 #define CPP_SPEC \
- "-D__CRIS_ABI_version=2\
-  %{mtune=*:-D__tune_%* %{mtune=v*:-D__CRIS_arch_tune=%*}}\
+ "%{mtune=*:-D__tune_%* %{mtune=v*:-D__CRIS_arch_tune=%*}}\
    %{mtune=etrax4:-D__tune_v3 -D__CRIS_arch_tune=3}\
    %{mtune=etrax100:-D__tune_v8 -D__CRIS_arch_tune=8}\
    %{mtune=svinto:-D__tune_v8 -D__CRIS_arch_tune=8}\
@@ -141,8 +140,7 @@ extern const char *cris_elinux_stacksize_str;
 
 /* For the cris-*-elf subtarget.  */
 #define CRIS_CPP_SUBTARGET_SPEC \
- "-D__ELF__\
-  %{mbest-lib-options:\
+ "%{mbest-lib-options:\
    %{!moverride-best-lib-options:\
     %{!march=*:%{!metrax*:%{!mcpu=*:-D__tune_v10 -D__CRIS_arch_tune=10}}}}}"
 
@@ -246,8 +244,23 @@ extern const char *cris_elinux_stacksize_str;
 
 /* Node: Run-time Target */
 
-/* Only keep the non-varying ones here.  */
-#define CPP_PREDEFINES "-Dcris -DCRIS -DGNU_CRIS"
+#define TARGET_CPU_CPP_BUILTINS()              \
+  do                                           \
+    {                                          \
+      builtin_define_std ("cris");             \
+      builtin_define_std ("CRIS");             \
+      builtin_define_std ("GNU_CRIS");         \
+      builtin_define ("__CRIS_ABI_version=2"); \
+    }                                          \
+  while (0)
+
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+      builtin_define ("__ELF__");              \
+    }                                          \
+  while (0)
+
 
 /* This needs to be at least 32 bits.  */
 extern int target_flags;
index 546f38101b9bf4895da64cb3f6a4ae3e850e1914..f85743f7a9af2443dcca03113bdc6b4a161eec1a 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for GCC.  Part of the machine description for CRIS.
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
    Contributed by Axis Communications.  Written by Hans-Peter Nilsson.
 
 This file is part of GCC.
@@ -47,10 +47,7 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CRIS_CPP_SUBTARGET_SPEC
 #define CRIS_CPP_SUBTARGET_SPEC \
-  "-D__gnu_linux__ -D__linux__ -D__unix__  -D__ELF__\
-   %{pthread:-D_REENTRANT}\
-   %{fPIC|fpic: -D__PIC__ -D__pic__}\
-   %{!fleading-underscore:-fno-leading-underscore -D__NO_UNDERSCORES__}\
+  "%{pthread:-D_REENTRANT}\
    %{!march=*:%{!cpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}\
    %{!ansi:%{!std=*:%{!undef:-Dlinux -Dunix}\
      -Asystem(unix) -Asystem(posix) -Acpu(cris) -Amachine(cris)}}"
@@ -99,6 +96,28 @@ Boston, MA 02111-1307, USA.  */
   %{!r:%{O2|O3: --gc-sections}}"
 
 
+/* Node: Run-time Target */
+
+/* For the cris-*-linux* subtarget.  */
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+      builtin_define ("__gnu_linux__");                \
+      builtin_define ("__linux__");            \
+      builtin_define ("__unix__");             \
+      builtin_define ("__ELF__");              \
+      if (flag_pic)                            \
+       {                                       \
+         builtin_define ("__PIC__");           \
+         builtin_define ("__pic__");           \
+       }                                       \
+      if (flag_leading_underscore <= 0)                \
+       builtin_define ("__NO_UNDERSCORES__");  \
+    }                                          \
+  while (0)
+     
+
 /* Node: Sections */
 
 /* GNU/Linux has crti and crtn and does not need the