aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@bitrange.com>2003-03-09 01:20:03 +0000
committerHans-Peter Nilsson <hp@gcc.gnu.org>2003-03-09 01:20:03 +0000
commita6e464ae019d39af515fe0e2be9a949ed75bce92 (patch)
tree913ded9b8b4eca49a4b84321520a46f133e80a43
parent00a221f0ac842627bbbd9f40213eef9cb5b32007 (diff)
downloadgcc-a6e464ae019d39af515fe0e2be9a949ed75bce92.zip
gcc-a6e464ae019d39af515fe0e2be9a949ed75bce92.tar.gz
gcc-a6e464ae019d39af515fe0e2be9a949ed75bce92.tar.bz2
aout.h (CRIS_CPP_SUBTARGET_SPEC): Move -D__AOUT__ to...
* 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
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/config/cris/aout.h16
-rw-r--r--gcc/config/cris/cris.h25
-rw-r--r--gcc/config/cris/linux.h29
4 files changed, 69 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c95dc4e..a64ec23 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/cris/aout.h b/gcc/config/cris/aout.h
index 8c4e7b7..db98c3f 100644
--- a/gcc/config/cris/aout.h
+++ b/gcc/config/cris/aout.h
@@ -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. */
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index d3d44e8..13bff9c 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -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;
diff --git a/gcc/config/cris/linux.h b/gcc/config/cris/linux.h
index 546f381..f85743f 100644
--- a/gcc/config/cris/linux.h
+++ b/gcc/config/cris/linux.h
@@ -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