aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog19
-rw-r--r--gcc/config/arm/arm.h115
-rw-r--r--gcc/config/arm/conix-elf.h8
-rw-r--r--gcc/config/arm/linux-elf.h13
-rw-r--r--gcc/config/arm/netbsd.h13
-rw-r--r--gcc/config/arm/riscix.h12
-rw-r--r--gcc/config/arm/riscix1-1.h10
-rw-r--r--gcc/config/arm/rtems-elf.h8
-rw-r--r--gcc/config/arm/semiaof.h7
-rw-r--r--gcc/config/arm/unknown-elf-oabi.h3
-rw-r--r--gcc/config/arm/unknown-elf.h4
-rw-r--r--gcc/config/arm/vxarm.h6
12 files changed, 119 insertions, 99 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7aaa4d2..66186b5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,20 @@
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
to the front end even when only preprocessing.
(cc1_options): Remove redundant -lang-c.
@@ -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.
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 240595e..b5a848a 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -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
diff --git a/gcc/config/arm/conix-elf.h b/gcc/config/arm/conix-elf.h
index b74afdf..4a137d6 100644
--- a/gcc/config/arm/conix-elf.h
+++ b/gcc/config/arm/conix-elf.h
@@ -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)
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index f1c86d2..6733564 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -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
diff --git a/gcc/config/arm/netbsd.h b/gcc/config/arm/netbsd.h
index 2be49d8..17d3d2c 100644
--- a/gcc/config/arm/netbsd.h
+++ b/gcc/config/arm/netbsd.h
@@ -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
diff --git a/gcc/config/arm/riscix.h b/gcc/config/arm/riscix.h
index 35fc232..46f52e1 100644
--- a/gcc/config/arm/riscix.h
+++ b/gcc/config/arm/riscix.h
@@ -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
diff --git a/gcc/config/arm/riscix1-1.h b/gcc/config/arm/riscix1-1.h
index fd93d40..aadbc6c 100644
--- a/gcc/config/arm/riscix1-1.h
+++ b/gcc/config/arm/riscix1-1.h
@@ -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).
diff --git a/gcc/config/arm/rtems-elf.h b/gcc/config/arm/rtems-elf.h
index 312c96f..27928db 100644
--- a/gcc/config/arm/rtems-elf.h
+++ b/gcc/config/arm/rtems-elf.h
@@ -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)
diff --git a/gcc/config/arm/semiaof.h b/gcc/config/arm/semiaof.h
index 7ca68bc..6ee17ef 100644
--- a/gcc/config/arm/semiaof.h
+++ b/gcc/config/arm/semiaof.h
@@ -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}}"
diff --git a/gcc/config/arm/unknown-elf-oabi.h b/gcc/config/arm/unknown-elf-oabi.h
index cc58f3a..8322508 100644
--- a/gcc/config/arm/unknown-elf-oabi.h
+++ b/gcc/config/arm/unknown-elf-oabi.h
@@ -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}"
diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h
index 0741884..df3977c 100644
--- a/gcc/config/arm/unknown-elf.h
+++ b/gcc/config/arm/unknown-elf.h
@@ -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
diff --git a/gcc/config/arm/vxarm.h b/gcc/config/arm/vxarm.h
index 7559364..473362e 100644
--- a/gcc/config/arm/vxarm.h
+++ b/gcc/config/arm/vxarm.h
@@ -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