arm.h (TARGET_CPU_CPP_BUILTINS): Define.

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
This commit is contained in:
Neil Booth 2002-05-14 17:35:50 +00:00 committed by Neil Booth
parent 5bf5c5cb52
commit e6471be669
12 changed files with 119 additions and 99 deletions

View 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.

View 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

View 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)

View 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

View 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

View 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

View 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).

View 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)

View 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}}"

View 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}"

View 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

View 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