]> gcc.gnu.org Git - gcc.git/commitdiff
netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define.
authorJason Thorpe <thorpej@wasabisystems.com>
Wed, 29 May 2002 23:50:56 +0000 (23:50 +0000)
committerJason Thorpe <thorpej@gcc.gnu.org>
Wed, 29 May 2002 23:50:56 +0000 (23:50 +0000)
* config/sparc/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define.
(CPP_PREDEFINES): Make sure this is undefined.
(CPP_SUBTARGET_SPEC64, CPP_SUBTARGET_SPEC32): Remove.
(CPP_SUBTARGET_SPEC): Don't provide different versions for
default-32 and default-64.  Just always use %(netbsd_cpp_spec).
(SUBTARGET_EXTRA_SPECS): Remove cpp_subtarget_spec32 and
cpp_subtarget_spec64.  Add netbsd_cpp_spec.
* config/sparc/netbsd.h (TARGET_OS_CPP_BUILTINS): Define.
(CPP_PREDEFINES): Make sure this is undefined.
(SUBTARGET_EXTRA_SPECS): Define.
(CPP_SPEC): Use %(netbsd_cpp_spec).

From-SVN: r54030

gcc/ChangeLog
gcc/config/sparc/netbsd-elf.h
gcc/config/sparc/netbsd.h

index 5d7779fe8bd7b3295c8753ac022cc078f5f69d51..77cc267deb0d81b739b83778b502e2dce1761a40 100644 (file)
@@ -1,3 +1,17 @@
+2002-05-29  Jason Thorpe  <thorpej@wasabisystems.com>
+
+       * config/sparc/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define.
+       (CPP_PREDEFINES): Make sure this is undefined.
+       (CPP_SUBTARGET_SPEC64, CPP_SUBTARGET_SPEC32): Remove.
+       (CPP_SUBTARGET_SPEC): Don't provide different versions for
+       default-32 and default-64.  Just always use %(netbsd_cpp_spec).
+       (SUBTARGET_EXTRA_SPECS): Remove cpp_subtarget_spec32 and
+       cpp_subtarget_spec64.  Add netbsd_cpp_spec.
+       * config/sparc/netbsd.h (TARGET_OS_CPP_BUILTINS): Define.
+       (CPP_PREDEFINES): Make sure this is undefined.
+       (SUBTARGET_EXTRA_SPECS): Define.
+       (CPP_SPEC): Use %(netbsd_cpp_spec).
+
 2002-05-29  Jeff Law <law@redhat.com>
 
        * flow.c (propagate_one_insn): Do not remove a dead insn if it
index f4ffb68c49efac98ba797e9b7786bd2a803fda3d..40d881d1d08ad7fc8bc3f703d56d0d8d1d60f6c4 100644 (file)
@@ -20,22 +20,32 @@ 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 TARGET_OS_CPP_BUILTINS()                       \
+  do                                                   \
+    {                                                  \
+      NETBSD_OS_CPP_BUILTINS_ELF();                    \
+      if (TARGET_ARCH64)                               \
+       {                                               \
+         NETBSD_OS_CPP_BUILTINS_LP64();                \
+         builtin_define ("__sparc64__");               \
+         builtin_define ("__sparc_v9__");              \
+       }                                               \
+      else                                             \
+       builtin_define ("__sparc");                     \
+      builtin_define ("__sparc__");                    \
+    }                                                  \
+  while (0)
+
 /* Make sure these are undefined.  */
 #undef MD_EXEC_PREFIX
 #undef MD_STARTFILE_PREFIX
 
+/* Make sure this is undefined.  */
 #undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__sparc__ -D__NetBSD__ -D__ELF__ \
--Asystem=unix -Asystem=NetBSD"
-
-/* CPP defines used for 64 bit code.  */
-#undef CPP_SUBTARGET_SPEC64
-#define CPP_SUBTARGET_SPEC64 \
-  "-D__sparc64__ -D__sparc_v9__ -D_LP64 %{posix:-D_POSIX_SOURCE}"
 
-/* CPP defines used for 32 bit code.  */
-#undef CPP_SUBTARGET_SPEC32
-#define CPP_SUBTARGET_SPEC32 "-D__sparc %{posix:-D_POSIX_SOURCE}"
+/* CPP defines used by all NetBSD targets.  */
+#undef CPP_SUBTARGET_SPEC
+#define CPP_SUBTARGET_SPEC "%(netbsd_cpp_spec)"
 
 /* SIZE_TYPE and PTRDIFF_TYPE are wrong from sparc/sparc.h.  */
 #undef SIZE_TYPE
@@ -230,8 +240,7 @@ Boston, MA 02111-1307, USA.  */
   { "link_arch64",             LINK_ARCH64_SPEC }, \
   { "link_arch_default",       LINK_ARCH_DEFAULT_SPEC }, \
   { "link_arch",               LINK_ARCH_SPEC }, \
-  { "cpp_subtarget_spec32",    CPP_SUBTARGET_SPEC32 }, \
-  { "cpp_subtarget_spec64",    CPP_SUBTARGET_SPEC64 },
+  { "netbsd_cpp_spec",         NETBSD_CPP_SPEC },
 
 
 /* What extra switches do we need?  */
@@ -270,15 +279,6 @@ Boston, MA 02111-1307, USA.  */
 #define MULTILIB_DEFAULTS { "m64" }
 #endif
 
-#undef CPP_SUBTARGET_SPEC
-#if DEFAULT_ARCH32_P
-#define CPP_SUBTARGET_SPEC \
-  "%{m64:%(cpp_subtarget_spec64)}%{!m64:%(cpp_subtarget_spec32)}"
-#else
-#define CPP_SUBTARGET_SPEC \
-  "%{!m32:%(cpp_subtarget_spec64)}%{m32:%(cpp_subtarget_spec32)}"
-#endif
-
 /* Name the port. */
 #undef TARGET_NAME
 #define TARGET_NAME     (DEFAULT_ARCH32_P ? TARGET_NAME32 : TARGET_NAME64)
@@ -300,9 +300,6 @@ Boston, MA 02111-1307, USA.  */
 #undef  CC1_SPEC
 #define CC1_SPEC CC1_SPEC64
 
-#undef CPP_SUBTARGET_SPEC
-#define CPP_SUBTARGET_SPEC CPP_SUBTARGET_SPEC64
-
 #undef TARGET_NAME
 #define TARGET_NAME     TARGET_NAME64
 
@@ -321,9 +318,6 @@ Boston, MA 02111-1307, USA.  */
 #undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
 #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
 
-#undef CPP_SUBTARGET_SPEC
-#define CPP_SUBTARGET_SPEC CPP_SUBTARGET_SPEC32
-
 #undef  CC1_SPEC
 #define CC1_SPEC CC1_SPEC32
 
index 13d5a630338608975d10318f4760526174f10a43..8ae4c5663492c3244e7298c2fcae45b6d680347b 100644 (file)
@@ -1,10 +1,23 @@
-/* Names to predefine in the preprocessor for this target machine.  */
-
+#define TARGET_OS_CPP_BUILTINS()                       \
+  do                                                   \
+    {                                                  \
+      NETBSD_OS_CPP_BUILTINS_AOUT();                   \
+      builtin_define_std ("sparc");                    \
+      builtin_assert ("cpu=sparc");                    \
+      builtin_assert ("machine=sparc");                        \
+    }                                                  \
+  while (0)
+
+/* Make sure this is undefined.  */
 #undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dunix -Dsparc -D__NetBSD__ -Asystem=unix -Asystem=NetBSD -Acpu=sparc -Amachine=sparc"
+
+/* What extra spec entries do we need?  */
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+  { "netbsd_cpp_spec",          NETBSD_CPP_SPEC },
 
 #undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE}"
+#define CPP_SPEC "%(cpp_cpu) %(netbsd_cpp_spec)"
 
 /* Make gcc agree with <machine/ansi.h> */
 
This page took 0.085446 seconds and 5 git commands to generate.