Commit e6471be6 by Neil Booth Committed by Neil Booth

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
parent 5bf5c5cb
2002-05-14 Neil Booth <neil@daikokuya.demon.co.uk> 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 * gcc.c (cpp_options): Must pass -m* and -f* options
to the front end even when only preprocessing. to the front end even when only preprocessing.
(cc1_options): Remove redundant -lang-c. (cc1_options): Remove redundant -lang-c.
...@@ -44,6 +59,10 @@ Tue May 14 12:38:30 CEST 2002 Jan Hubicka <jh@suse.cz> ...@@ -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.md: Use define_constants for unspec numbers.
* config/i386/i386.c: Likewise. * 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> 2002-05-13 Mark Mitchell <mark@codesourcery.com>
* fixinc/inclhack.def (winidss_valist): Limit applicability. * fixinc/inclhack.def (winidss_valist): Limit applicability.
......
...@@ -26,6 +26,47 @@ Boston, MA 02111-1307, USA. */ ...@@ -26,6 +26,47 @@ Boston, MA 02111-1307, USA. */
#ifndef GCC_ARM_H #ifndef GCC_ARM_H
#define 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_arm2 0x0000
#define TARGET_CPU_arm250 0x0000 #define TARGET_CPU_arm250 0x0000
#define TARGET_CPU_arm3 0x0000 #define TARGET_CPU_arm3 0x0000
...@@ -126,16 +167,17 @@ Unrecognized value in TARGET_CPU_DEFAULT. ...@@ -126,16 +167,17 @@ Unrecognized value in TARGET_CPU_DEFAULT.
#endif #endif
#undef CPP_SPEC #undef CPP_SPEC
#define CPP_SPEC "\ #define CPP_SPEC "%(cpp_cpu_arch) %(subtarget_cpp_spec) \
%(cpp_cpu_arch) %(cpp_apcs_pc) %(cpp_float) \ %{mapcs-32:%{mapcs-26: \
%(cpp_endian) %(subtarget_cpp_spec) %(cpp_isa) %(cpp_interwork)" %e-mapcs-26 and -mapcs-32 may not be used together}} \
%{msoft-float:%{mhard-float: \
#define CPP_ISA_SPEC "%{mthumb:-D__thumb__} %{!mthumb:-D__arm__}" %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 /* Set the architecture define -- if -march= is set, then it overrides
the -mcpu= setting. */ the -mcpu= setting. */
#define CPP_CPU_ARCH_SPEC "\ #define CPP_CPU_ARCH_SPEC "\
-Acpu=arm -Amachine=arm \
%{march=arm2:-D__ARM_ARCH_2__} \ %{march=arm2:-D__ARM_ARCH_2__} \
%{march=arm250:-D__ARM_ARCH_2__} \ %{march=arm250:-D__ARM_ARCH_2__} \
%{march=arm3:-D__ARM_ARCH_2__} \ %{march=arm3:-D__ARM_ARCH_2__} \
...@@ -206,58 +248,6 @@ Unrecognized value in TARGET_CPU_DEFAULT. ...@@ -206,58 +248,6 @@ Unrecognized value in TARGET_CPU_DEFAULT.
%{!mcpu*:%(cpp_cpu_arch_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 #ifndef CC1_SPEC
#define CC1_SPEC "" #define CC1_SPEC ""
#endif #endif
...@@ -274,15 +264,6 @@ Unrecognized value in TARGET_CPU_DEFAULT. ...@@ -274,15 +264,6 @@ Unrecognized value in TARGET_CPU_DEFAULT.
#define EXTRA_SPECS \ #define EXTRA_SPECS \
{ "cpp_cpu_arch", CPP_CPU_ARCH_SPEC }, \ { "cpp_cpu_arch", CPP_CPU_ARCH_SPEC }, \
{ "cpp_cpu_arch_default", CPP_ARCH_DEFAULT_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_cpp_spec", SUBTARGET_CPP_SPEC }, \
SUBTARGET_EXTRA_SPECS SUBTARGET_EXTRA_SPECS
......
...@@ -39,6 +39,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330, ...@@ -39,6 +39,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm7tdmi #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm7tdmi
#endif #endif
#undef CPP_PREDEFINES #define TARGET_OS_CPP_BUILTINS() \
#define CPP_PREDEFINES \ do { \
"-D__arm__ -D__CONIX__ -D__ELF__" builtin_define ("__CONIX__"); \
builtin_define ("__ELF__"); \
} while (0)
...@@ -89,10 +89,15 @@ Boston, MA 02111-1307, USA. */ ...@@ -89,10 +89,15 @@ Boston, MA 02111-1307, USA. */
%{mbig-endian:-EB}" \ %{mbig-endian:-EB}" \
SUBTARGET_EXTRA_LINK_SPEC SUBTARGET_EXTRA_LINK_SPEC
#undef CPP_PREDEFINES #define TARGET_OS_CPP_BUILTINS() \
#define CPP_PREDEFINES \ do { \
"-Dunix -D__gnu_linux__ -Dlinux -D__ELF__ \ builtin_define_std ("unix"); \
-Asystem=unix -Asystem=posix" 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. */ /* Allow #sccs in preprocessor. */
#define SCCS_DIRECTIVE #define SCCS_DIRECTIVE
......
...@@ -44,10 +44,15 @@ Boston, MA 02111-1307, USA. */ ...@@ -44,10 +44,15 @@ Boston, MA 02111-1307, USA. */
/* Some defines for CPP. /* Some defines for CPP.
arm32 is the NetBSD port name, so we always define arm32 and __arm32__. */ arm32 is the NetBSD port name, so we always define arm32 and __arm32__. */
#undef CPP_PREDEFINES #define TARGET_OS_CPP_BUILTINS() \
#define CPP_PREDEFINES "\ do { \
-Dunix -Driscbsd -Darm32 -D__arm32__ -D__arm__ -D__NetBSD__ \ builtin_define_std ("arm32"); \
-Asystem=unix -Asystem=NetBSD" 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. */ /* Define _POSIX_SOURCE if necessary. */
#undef CPP_SPEC #undef CPP_SPEC
......
...@@ -47,11 +47,13 @@ Boston, MA 02111-1307, USA. */ ...@@ -47,11 +47,13 @@ Boston, MA 02111-1307, USA. */
#define LINK_SPEC "-X" #define LINK_SPEC "-X"
#endif #endif
#ifndef CPP_PREDEFINES #define TARGET_OS_CPP_BUILTINS() \
#define CPP_PREDEFINES \ do { \
"-Darm -Driscix -Dunix -Asystem=unix" builtin_define_std ("arm"); \
#endif 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 /* RISCiX has some weird symbol name munging, that is done to the object module
after assembly, which enables multiple libraries to be supported within after assembly, which enables multiple libraries to be supported within
......
...@@ -29,9 +29,13 @@ Boston, MA 02111-1307, USA. */ ...@@ -29,9 +29,13 @@ Boston, MA 02111-1307, USA. */
#define STARTFILE_SPEC \ #define STARTFILE_SPEC \
"%{pg:/usr/lib/gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}" "%{pg:/usr/lib/gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}"
#ifndef CPP_PREDEFINES #define TARGET_OS_CPP_BUILTINS() \
#define CPP_PREDEFINES "-Darm -Driscix -Dunix -Asystem=unix" do { \
#endif 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 /* Riscix 1.1 doesn't have X/OPEN support, so only accept -mbsd (but ignore
it). it).
......
...@@ -24,5 +24,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -24,5 +24,9 @@ Boston, MA 02111-1307, USA. */
#define HAS_INIT_SECTION #define HAS_INIT_SECTION
#undef CPP_PREDEFINES #define TARGET_OS_CPP_BUILTINS() \
#define CPP_PREDEFINES "-D__rtems__ -D__ELF__ -Asystem=rtems" do { \
builtin_define ("__rtems__"); \
builtin_define ("__ELF__"); \
builtin_assert ("system=rtems"); \
} while (0)
...@@ -20,8 +20,11 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -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, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES \ #define TARGET_OS_CPP_BUILTINS() \
"-Darm -Dsemi" do { \
builtin_define_std ("arm"); \
builtin_define_std ("semi"); \
} while (0)
#define ASM_SPEC "%{g -g} -arch 4 \ #define ASM_SPEC "%{g -g} -arch 4 \
-apcs 3%{mapcs-32:/32bit}%{mapcs-26:/26bit}%{!mapcs-26:%{!macps-32:/32bit}}" -apcs 3%{mapcs-32:/32bit}%{mapcs-26:/26bit}%{!mapcs-26:%{!macps-32:/32bit}}"
......
...@@ -23,9 +23,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -23,9 +23,6 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_VERSION #undef TARGET_VERSION
#define TARGET_VERSION fputs (" (ARM/ELF non-Linux old abi)", stderr); #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 #undef ASM_SPEC
#define ASM_SPEC "-moabi %{mbig-endian:-EB} %{mcpu=*:-m%*} %{march=*:-m%*} \ #define ASM_SPEC "-moabi %{mbig-endian:-EB} %{mcpu=*:-m%*} %{march=*:-m%*} \
%{mapcs-*:-mapcs-%*} %{mthumb-interwork:-mthumb-interwork}" %{mapcs-*:-mapcs-%*} %{mthumb-interwork:-mthumb-interwork}"
......
...@@ -86,10 +86,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -86,10 +86,6 @@ Boston, MA 02111-1307, USA. */
} \ } \
while (0) while (0)
#ifndef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__ELF__"
#endif
#ifndef CPP_APCS_PC_DEFAULT_SPEC #ifndef CPP_APCS_PC_DEFAULT_SPEC
#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__" #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
#endif #endif
......
...@@ -37,8 +37,10 @@ Boston, MA 02111-1307, USA. */ ...@@ -37,8 +37,10 @@ Boston, MA 02111-1307, USA. */
%{!mcpu*:%{!march=*:-DCPU=ARM710A}} \ %{!mcpu*:%{!march=*:-DCPU=ARM710A}} \
" "
#undef CPP_PREDEFINES #define TARGET_OS_CPP_BUILTINS() \
#define CPP_PREDEFINES "-D__vxworks -Acpu=arm -Amachine=arm" do { \
builtin_define ("__vxworks"); \
} while (0)
/* VxWorks does all the library stuff itself. */ /* VxWorks does all the library stuff itself. */
#undef LIB_SPEC #undef LIB_SPEC
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment