summaryrefslogtreecommitdiff
path: root/gcc/config/pa
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2002-09-22 19:23:20 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2002-09-22 19:23:20 +0000
commit5b6d07c4c4862c60dca5affaeaa4def15139b295 (patch)
treede93cfb0e906c2e489661d1488858c505399696c /gcc/config/pa
parent319e9548e93fc8de3bbbfc07cea1dba3a7525e46 (diff)
downloadgcc-5b6d07c4c4862c60dca5affaeaa4def15139b295.tar.gz
* c-common.c (preprocessing_trad_p): Define.
* pa-hiux.h, pa-hpux.h, pa-hpux7.h (CPP_PREDEFINES): Delete. (TARGET_OS_CPP_BUILTINS, SUBTARGET_SWITCHES): Define. * pa-hpux10.h (TARGET_OS_CPP_BUILTINS, CPP_SPEC): Define. * pa-hpux11.h (TARGET_OS_CPP_BUILTINS): Define. * pa-linux.h (CPP_PREDEFINES): Delete. (TARGET_OS_CPP_BUILTINS, CPP_SPEC): Define. * pa32-linux.h, pa64-linux.h (CPP_SPEC): Delete. * pa-osf.h, pa-pro-end.h, rtems.h (CPP_PREDEFINES): Delete. (TARGET_OS_CPP_BUILTINS): Define. * pa.h (MASK_SIO, TARGET_SIO, TARGET_PA_10): Define. (TARGET_SWITCHES): Reformat. Use N_() macro. Add SUBTARGET_SWITCHES. (SUBTARGET_SWITCHES): Provide default definition. (TARGET_OPTIONS): Reformat. Use N_() macro. (CPP_PA10_SPEC, CPP_PA11_SPEC, CPP_PA20_SPEC, CPP_64BIT_SPEC, CPP_CPU_DEFAULT_SPEC, CPP_64BIT_DEFAULT_SPEC, SUBTARGET_EXTRA_SPECS, EXTRA_SPECS, CPP_SPEC, CPLUSPLUS_CPP_SPEC, CPP_PREDEFINES): Delete. (TARGET_CPU_CPP_BUILTINS): Define. (TARGET_OS_CPP_BUILTINS): Define for BSD-like systems. * doc/invoke.texi (msio, mwsio): Document new hppa options. * doc/tm.texi (TARGET_CPU_CPP_BUILTINS): Document macro preprocessing_trad_p(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57416 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/pa')
-rw-r--r--gcc/config/pa/pa-hiux.h58
-rw-r--r--gcc/config/pa/pa-hpux.h57
-rw-r--r--gcc/config/pa/pa-hpux10.h51
-rw-r--r--gcc/config/pa/pa-hpux11.h53
-rw-r--r--gcc/config/pa/pa-hpux7.h57
-rw-r--r--gcc/config/pa/pa-linux.h18
-rw-r--r--gcc/config/pa/pa-osf.h36
-rw-r--r--gcc/config/pa/pa-pro-end.h20
-rw-r--r--gcc/config/pa/pa.h233
-rw-r--r--gcc/config/pa/pa32-linux.h3
-rw-r--r--gcc/config/pa/pa64-linux.h5
-rw-r--r--gcc/config/pa/rtems.h17
12 files changed, 456 insertions, 152 deletions
diff --git a/gcc/config/pa/pa-hiux.h b/gcc/config/pa/pa-hiux.h
index aed3ca3214c..c1d945c6daa 100644
--- a/gcc/config/pa/pa-hiux.h
+++ b/gcc/config/pa/pa-hiux.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for HI-UX.
- Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 1996, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -21,6 +21,56 @@ Boston, MA 02111-1307, USA. */
/* HIUX is just a HPUX variant. We can simply use the HPUX configuration
for just about everything. */
-/* Predefines are the one noteworthy difference between HPUX and HIUX. */
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dhppa -DPWB -Dunix -D__H3050R -D__H3050RX -Asystem=unix -Asystem=hiux -Acpu=hppa -Amachine=hppa"
+/* OS cpp builtins are the one noteworthy difference between HPUX and HIUX.
+ The following defines are similar to those for hpux10 with the addition
+ of __H3050R and __H3050RX. */
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_assert ("system=hiux"); \
+ builtin_assert ("system=unix"); \
+ builtin_define ("__hp9000s800"); \
+ builtin_define ("__hp9000s800__"); \
+ builtin_define ("__hiux"); \
+ builtin_define ("__hiux__"); \
+ builtin_define ("__unix"); \
+ builtin_define ("__unix__"); \
+ builtin_define ("__H3050R"); \
+ builtin_define ("__H3050RX"); \
+ if (c_language == clk_cplusplus) \
+ { \
+ builtin_define ("_HIUX_SOURCE"); \
+ builtin_define ("_INCLUDE_LONGLONG"); \
+ } \
+ else if (!flag_iso) \
+ { \
+ builtin_define ("_HIUX_SOURCE"); \
+ if (preprocessing_trad_p ()) \
+ { \
+ builtin_define ("hp9000s800"); \
+ builtin_define ("hppa"); \
+ builtin_define ("hiux"); \
+ builtin_define ("unix"); \
+ builtin_define ("__CLASSIC_C__"); \
+ builtin_define ("_PWB"); \
+ builtin_define ("PWB"); \
+ } \
+ else \
+ builtin_define ("__STDC_EXT__"); \
+ } \
+ if (TARGET_SIO) \
+ builtin_define ("_SIO"); \
+ else \
+ { \
+ builtin_define ("__hp9000s700"); \
+ builtin_define ("__hp9000s700__"); \
+ builtin_define ("_WSIO"); \
+ } \
+ } \
+ while (0)
+
+#undef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES \
+ { "sio", MASK_SIO, N_("Generate cpp defines for server IO") }, \
+ { "wsio", -MASK_SIO, N_("Generate cpp defines for workstation IO") },
diff --git a/gcc/config/pa/pa-hpux.h b/gcc/config/pa/pa-hpux.h
index e541a97da6d..b9d563e09be 100644
--- a/gcc/config/pa/pa-hpux.h
+++ b/gcc/config/pa/pa-hpux.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for HP-UX.
- Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1995, 1996, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -28,13 +28,62 @@ Boston, MA 02111-1307, USA. */
#define SIZE_TYPE "unsigned int"
#define PTRDIFF_TYPE "int"
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_assert ("system=hpux"); \
+ builtin_assert ("system=unix"); \
+ builtin_define ("__hp9000s800"); \
+ builtin_define ("__hp9000s800__"); \
+ builtin_define ("__hp9k8"); \
+ builtin_define ("__hp9k8__"); \
+ builtin_define ("__hpux"); \
+ builtin_define ("__hpux__"); \
+ builtin_define ("__unix"); \
+ builtin_define ("__unix__"); \
+ if (c_language == clk_cplusplus) \
+ { \
+ builtin_define ("_HPUX_SOURCE"); \
+ builtin_define ("_INCLUDE_LONGLONG"); \
+ } \
+ else if (!flag_iso) \
+ { \
+ builtin_define ("_HPUX_SOURCE"); \
+ if (preprocessing_trad_p ()) \
+ { \
+ builtin_define ("hp9000s800"); \
+ builtin_define ("hp9k8"); \
+ builtin_define ("hppa"); \
+ builtin_define ("hpux"); \
+ builtin_define ("unix"); \
+ builtin_define ("__CLASSIC_C__"); \
+ builtin_define ("_PWB"); \
+ builtin_define ("PWB"); \
+ } \
+ else \
+ builtin_define ("__STDC_EXT__"); \
+ } \
+ if (TARGET_SIO) \
+ builtin_define ("_SIO"); \
+ else \
+ { \
+ builtin_define ("__hp9000s700"); \
+ builtin_define ("__hp9000s700__"); \
+ builtin_define ("_WSIO"); \
+ } \
+ } \
+ while (0)
+
+#undef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES \
+ { "sio", MASK_SIO, N_("Generate cpp defines for server IO") }, \
+ { "wsio", -MASK_SIO, N_("Generate cpp defines for workstation IO") },
+
/* Like the default, except no -lg. */
#undef LIB_SPEC
#define LIB_SPEC "%{!shared:%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}}"
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -Asystem=unix -Asystem=hpux -Acpu=hppa -Amachine=hppa"
-
#undef LINK_SPEC
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
#define LINK_SPEC \
diff --git a/gcc/config/pa/pa-hpux10.h b/gcc/config/pa/pa-hpux10.h
index ce9969d59f7..0354543e3d0 100644
--- a/gcc/config/pa/pa-hpux10.h
+++ b/gcc/config/pa/pa-hpux10.h
@@ -1,5 +1,6 @@
-/* Definitions of target machine for GNU compiler, for HP PA-RISC 1.1
- Copyright (C) 1995, 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
+/* Definitions of target machine for GNU compiler, for HP PA-RISC
+ Copyright (C) 1995, 1996, 1997, 2000, 2001, 2002
+ Free Software Foundation, Inc.
Contributed by Tim Moore (moore@defmacro.cs.utah.edu)
This file is part of GNU CC.
@@ -19,6 +20,52 @@ 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. */
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_assert ("system=hpux"); \
+ builtin_assert ("system=unix"); \
+ builtin_define ("__hp9000s800"); \
+ builtin_define ("__hp9000s800__"); \
+ builtin_define ("__hpux"); \
+ builtin_define ("__hpux__"); \
+ builtin_define ("__unix"); \
+ builtin_define ("__unix__"); \
+ if (c_language == clk_cplusplus) \
+ { \
+ builtin_define ("_HPUX_SOURCE"); \
+ builtin_define ("_INCLUDE_LONGLONG"); \
+ } \
+ else if (!flag_iso) \
+ { \
+ builtin_define ("_HPUX_SOURCE"); \
+ if (preprocessing_trad_p ()) \
+ { \
+ builtin_define ("hp9000s800"); \
+ builtin_define ("hppa"); \
+ builtin_define ("hpux"); \
+ builtin_define ("unix"); \
+ builtin_define ("__CLASSIC_C__"); \
+ builtin_define ("_PWB"); \
+ builtin_define ("PWB"); \
+ } \
+ else \
+ builtin_define ("__STDC_EXT__"); \
+ } \
+ if (TARGET_SIO) \
+ builtin_define ("_SIO"); \
+ else \
+ { \
+ builtin_define ("__hp9000s700"); \
+ builtin_define ("__hp9000s700__"); \
+ builtin_define ("_WSIO"); \
+ } \
+ } \
+ while (0)
+
+#define CPP_SPEC "%{threads: -D_REENTRANT -D_DCE_THREADS}"
+
/* We can debug dynamically linked executables on hpux9; we also want
dereferencing of a NULL pointer to cause a SEGV. */
#undef LINK_SPEC
diff --git a/gcc/config/pa/pa-hpux11.h b/gcc/config/pa/pa-hpux11.h
index 522605453f6..0bc7f1010a5 100644
--- a/gcc/config/pa/pa-hpux11.h
+++ b/gcc/config/pa/pa-hpux11.h
@@ -1,5 +1,5 @@
-/* Definitions of target machine for GNU compiler, for HP PA-RISC 1.1
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Definitions of target machine for GNU compiler, for HP PA-RISC
+ Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -18,6 +18,55 @@ 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. */
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_assert ("system=hpux"); \
+ builtin_assert ("system=unix"); \
+ builtin_define ("__hp9000s800"); \
+ builtin_define ("__hp9000s800__"); \
+ builtin_define ("__hpux"); \
+ builtin_define ("__hpux__"); \
+ builtin_define ("__unix"); \
+ builtin_define ("__unix__"); \
+ if (c_language == clk_cplusplus) \
+ { \
+ builtin_define ("_HPUX_SOURCE"); \
+ builtin_define ("_INCLUDE_LONGLONG"); \
+ } \
+ else \
+ { \
+ if (!flag_iso) \
+ { \
+ builtin_define ("_HPUX_SOURCE"); \
+ if (preprocessing_trad_p ()) \
+ { \
+ builtin_define ("hp9000s800"); \
+ builtin_define ("hppa"); \
+ builtin_define ("hpux"); \
+ builtin_define ("unix"); \
+ builtin_define ("__CLASSIC_C__"); \
+ builtin_define ("_PWB"); \
+ builtin_define ("PWB"); \
+ } \
+ else \
+ builtin_define ("__STDC_EXT__"); \
+ } \
+ if (!TARGET_64BIT) \
+ builtin_define ("_ILP32"); \
+ } \
+ if (TARGET_SIO) \
+ builtin_define ("_SIO"); \
+ else \
+ { \
+ builtin_define ("__hp9000s700"); \
+ builtin_define ("__hp9000s700__"); \
+ builtin_define ("_WSIO"); \
+ } \
+ } \
+ while (0)
+
/* We can debug dynamically linked executables on hpux11; we also
want dereferencing of a NULL pointer to cause a SEGV. */
#undef LINK_SPEC
diff --git a/gcc/config/pa/pa-hpux7.h b/gcc/config/pa/pa-hpux7.h
index 42c335849a8..0239e038cf8 100644
--- a/gcc/config/pa/pa-hpux7.h
+++ b/gcc/config/pa/pa-hpux7.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for HP-UX.
- Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1995, 1996, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -29,9 +29,58 @@ Boston, MA 02111-1307, USA. */
#define SIZE_TYPE "unsigned int"
#define PTRDIFF_TYPE "int"
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_assert ("system=hpux"); \
+ builtin_assert ("system=unix"); \
+ builtin_define ("__hp9000s800"); \
+ builtin_define ("__hp9000s800__"); \
+ builtin_define ("__hp9k8"); \
+ builtin_define ("__hp9k8__"); \
+ builtin_define ("__hpux"); \
+ builtin_define ("__hpux__"); \
+ builtin_define ("__unix"); \
+ builtin_define ("__unix__"); \
+ if (c_language == clk_cplusplus) \
+ { \
+ builtin_define ("_HPUX_SOURCE"); \
+ builtin_define ("_INCLUDE_LONGLONG"); \
+ } \
+ else if (!flag_iso) \
+ { \
+ builtin_define ("_HPUX_SOURCE"); \
+ if (preprocessing_trad_p ()) \
+ { \
+ builtin_define ("hp9000s800"); \
+ builtin_define ("hp9k8"); \
+ builtin_define ("hppa"); \
+ builtin_define ("hpux"); \
+ builtin_define ("unix"); \
+ builtin_define ("__CLASSIC_C__"); \
+ builtin_define ("_PWB"); \
+ builtin_define ("PWB"); \
+ } \
+ else \
+ builtin_define ("__STDC_EXT__"); \
+ } \
+ if (TARGET_SIO) \
+ builtin_define ("_SIO"); \
+ else \
+ { \
+ builtin_define ("__hp9000s700"); \
+ builtin_define ("__hp9000s700__"); \
+ builtin_define ("_WSIO"); \
+ } \
+ } \
+ while (0)
+
+#undef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES \
+ { "sio", MASK_SIO, N_("Generate cpp defines for server IO") }, \
+ { "wsio", -MASK_SIO, N_("Generate cpp defines for workstation IO") },
+
/* Like the default, except no -lg. */
#undef LIB_SPEC
#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}"
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -Asystem=unix -Asystem=hpux -Acpu=hppa -Amachine=hppa"
diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h
index 0fcb1e5095c..86dfabc77b7 100644
--- a/gcc/config/pa/pa-linux.h
+++ b/gcc/config/pa/pa-linux.h
@@ -56,8 +56,22 @@ Boston, MA 02111-1307, USA. */
} \
} while (0)
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__ELF__ -Dunix -D__hppa__ -D__gnu_linux__ -Dlinux -Asystem=unix -Asystem=posix -Acpu=hppa -Amachine=hppa -Amachine=bigendian"
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__ELF__"); \
+ builtin_define ("__gnu_linux__"); \
+ builtin_define_std ("linux"); \
+ builtin_define_std ("unix"); \
+ builtin_assert ("machine=bigendian"); \
+ builtin_assert ("system=posix"); \
+ builtin_assert ("system=unix"); \
+ } \
+ while (0)
+
+#undef CPP_SPEC
+#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
#define LIB_SPEC \
diff --git a/gcc/config/pa/pa-osf.h b/gcc/config/pa/pa-osf.h
index 04086a57b2d..74a6e588505 100644
--- a/gcc/config/pa/pa-osf.h
+++ b/gcc/config/pa/pa-osf.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for HP PA-RISC 1.1
- Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1995, 1996, 2002 Free Software Foundation, Inc.
Contributed by Tim Moore (moore@defmacro.cs.utah.edu)
This file is part of GNU CC.
@@ -19,12 +19,34 @@ 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. */
-#undef CPP_PREDEFINES
-#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
-#define CPP_PREDEFINES "-Dhppa -Dunix -Dhp9000 -Dspectrum -DREVARGV -Dhp700 -DHP700 -Dparisc -D__pa_risc -DPARISC -DBYTE_MSF -DBIT_MSF -Asystem=unix -Asystem=mach -Acpu=hppa -Amachine=hppa"
-#else
-#define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -Dunix -Dhp9000 -Dhp800 -Dspectrum -DREVARGV -Dparisc -D__pa_risc -DPARISC -DBYTE_MSF -DBIT_MSF -Asystem=unix -Asystem=mach -Acpu=hppa -Amachine=hppa"
-#endif
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ if (TARGET_PA_11) \
+ { \
+ builtin_define_std ("hp700"); \
+ builtin_define_std ("HP700"); \
+ } \
+ else \
+ { \
+ builtin_define_std ("hp800"); \
+ builtin_define_std ("hp9k8"); \
+ builtin_define_std ("hp9000s800"); \
+ } \
+ builtin_define_std ("BIT_MSF"); \
+ builtin_define_std ("BYTE_MSF"); \
+ builtin_define_std ("PARISC"); \
+ builtin_define_std ("REVARGV"); \
+ builtin_define_std ("hp9000"); \
+ builtin_define ("__pa_risc"); \
+ builtin_define_std ("parisc"); \
+ builtin_define_std ("spectrum"); \
+ builtin_define_std ("unix"); \
+ builtin_assert ("system=mach"); \
+ builtin_assert ("system=unix"); \
+ } \
+ while (0)
/* Don't default to pcc-struct-return, because gcc is the only compiler, and
we want to retain compatibility with older gcc versions. */
diff --git a/gcc/config/pa/pa-pro-end.h b/gcc/config/pa/pa-pro-end.h
index f9093909828..a1bd30dc65d 100644
--- a/gcc/config/pa/pa-pro-end.h
+++ b/gcc/config/pa/pa-pro-end.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for PRO.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -25,13 +25,25 @@ Boston, MA 02111-1307, USA. */
#define SIZE_TYPE "unsigned int"
#define PTRDIFF_TYPE "int"
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ if (c_language != clk_cplusplus \
+ && !flag_iso) \
+ { \
+ builtin_define ("hppa"); \
+ builtin_define_std ("PWB"); \
+ } \
+ builtin_define ("__pro__"); \
+ builtin_assert ("system=pro"); \
+ } \
+ while (0)
+
/* Like the default, except no -lg. */
#undef LIB_SPEC
#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}"
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dhppa -DPWB -Acpu=hppa -D__pro__ -Amachine=hppa"
-
/* hpux8 and later have C++ compatible include files, so do not
pretend they are `extern "C"'. */
#define NO_IMPLICIT_EXTERN_C
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index aeef60fccf2..7813d7c5e64 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -74,14 +74,10 @@ extern enum architecture_type pa_arch;
extern int target_flags;
-/* compile code for HP-PA 1.1 ("Snake") */
+/* compile code for HP-PA 1.1 ("Snake"). */
#define MASK_PA_11 1
-#ifndef TARGET_PA_11
-#define TARGET_PA_11 (target_flags & MASK_PA_11)
-#endif
-
/* Disable all FP registers (they all become fixed). This may be necessary
for compiling kernels which perform lazy context switching of FP regs.
Note if you use this option and try to perform floating point operations
@@ -142,10 +138,22 @@ extern int target_flags;
#define MASK_BIG_SWITCH 2048
#define TARGET_BIG_SWITCH (target_flags & MASK_BIG_SWITCH)
-
/* Generate code for the HPPA 2.0 architecture. TARGET_PA_11 should also be
true when this is true. */
#define MASK_PA_20 4096
+
+/* Generate cpp defines for server I/O. */
+#define MASK_SIO 8192
+#define TARGET_SIO (target_flags & MASK_SIO)
+
+#ifndef TARGET_PA_10
+#define TARGET_PA_10 (target_flags & (MASK_PA_11 | MASK_PA_20) == 0)
+#endif
+
+#ifndef TARGET_PA_11
+#define TARGET_PA_11 (target_flags & MASK_PA_11)
+#endif
+
#ifndef TARGET_PA_20
#define TARGET_PA_20 (target_flags & MASK_PA_20)
#endif
@@ -165,40 +173,69 @@ extern int target_flags;
#define TARGET_SOM 0
#endif
-/* Macro to define tables used to set the flags.
- This is a list in braces of pairs in braces,
- each pair being { "NAME", VALUE }
- where VALUE is the bits to set or minus the bits to clear.
- An empty string NAME is used to identify the default VALUE. */
+/* Macro to define tables used to set the flags. This is a
+ list in braces of target switches with each switch being
+ { "NAME", VALUE, "HELP_STRING" }. VALUE is the bits to set,
+ or minus the bits to clear. An empty string NAME is used to
+ identify the default VALUE. Do not mark empty strings for
+ translation. */
#define TARGET_SWITCHES \
- {{"snake", MASK_PA_11, "Generate PA1.1 code"}, \
- {"nosnake", -(MASK_PA_11 | MASK_PA_20), "Generate PA1.0 code"}, \
- {"pa-risc-1-0", -(MASK_PA_11 | MASK_PA_20), "Generate PA1.0 code"}, \
- {"pa-risc-1-1", MASK_PA_11, "Generate PA1.1 code"}, \
- {"pa-risc-2-0", MASK_PA_20, "Generate PA2.0 code. This option requires binutils 2.10 or later"}, \
- {"disable-fpregs", MASK_DISABLE_FPREGS, "Disable FP regs"}, \
- {"no-disable-fpregs", -MASK_DISABLE_FPREGS, "Do not disable FP regs"},\
- {"no-space-regs", MASK_NO_SPACE_REGS, "Disable space regs"}, \
- {"space-regs", -MASK_NO_SPACE_REGS, "Do not disable space regs"}, \
- {"jump-in-delay", MASK_JUMP_IN_DELAY, "Put jumps in call delay slots"},\
- {"no-jump-in-delay", -MASK_JUMP_IN_DELAY, "Do not put jumps in call delay slots"}, \
- {"disable-indexing", MASK_DISABLE_INDEXING, "Disable indexed addressing"},\
- {"no-disable-indexing", -MASK_DISABLE_INDEXING, "Do not disable indexed addressing"},\
- {"portable-runtime", MASK_PORTABLE_RUNTIME, "Use portable calling conventions"}, \
- {"no-portable-runtime", -MASK_PORTABLE_RUNTIME, "Do not use portable calling conventions"},\
- {"gas", MASK_GAS, "Assume code will be assembled by GAS"}, \
- {"no-gas", -MASK_GAS, "Do not assume code will be assembled by GAS"}, \
- {"soft-float", MASK_SOFT_FLOAT, "Use software floating point"}, \
- {"no-soft-float", -MASK_SOFT_FLOAT, "Do not use software floating point"}, \
- {"long-load-store", MASK_LONG_LOAD_STORE, "Emit long load/store sequences"}, \
- {"no-long-load-store", -MASK_LONG_LOAD_STORE, "Do not emit long load/store sequences"},\
- {"fast-indirect-calls", MASK_FAST_INDIRECT_CALLS, "Generate fast indirect calls"},\
- {"no-fast-indirect-calls", -MASK_FAST_INDIRECT_CALLS, "Do not generate fast indirect calls"},\
- {"big-switch", MASK_BIG_SWITCH, "Generate code for huge switch statements"}, \
- {"no-big-switch", -MASK_BIG_SWITCH, "Do not generate code for huge switch statements"}, \
- {"linker-opt", 0, "Enable linker optimizations"}, \
- { "", TARGET_DEFAULT | TARGET_CPU_DEFAULT, NULL}}
+ {{ "snake", MASK_PA_11, \
+ N_("Generate PA1.1 code") }, \
+ { "nosnake", -(MASK_PA_11 | MASK_PA_20), \
+ N_("Generate PA1.0 code") }, \
+ { "pa-risc-1-0", -(MASK_PA_11 | MASK_PA_20), \
+ N_("Generate PA1.0 code") }, \
+ { "pa-risc-1-1", MASK_PA_11, \
+ N_("Generate PA1.1 code") }, \
+ { "pa-risc-2-0", MASK_PA_20, \
+ N_("Generate PA2.0 code (requires binutils 2.10 or later)") }, \
+ { "disable-fpregs", MASK_DISABLE_FPREGS, \
+ N_("Disable FP regs") }, \
+ { "no-disable-fpregs", -MASK_DISABLE_FPREGS, \
+ N_("Do not disable FP regs") }, \
+ { "no-space-regs", MASK_NO_SPACE_REGS, \
+ N_("Disable space regs") }, \
+ { "space-regs", -MASK_NO_SPACE_REGS, \
+ N_("Do not disable space regs") }, \
+ { "jump-in-delay", MASK_JUMP_IN_DELAY, \
+ N_("Put jumps in call delay slots") }, \
+ { "no-jump-in-delay", -MASK_JUMP_IN_DELAY, \
+ N_("Do not put jumps in call delay slots") }, \
+ { "disable-indexing", MASK_DISABLE_INDEXING, \
+ N_("Disable indexed addressing") }, \
+ { "no-disable-indexing", -MASK_DISABLE_INDEXING, \
+ N_("Do not disable indexed addressing") }, \
+ { "portable-runtime", MASK_PORTABLE_RUNTIME, \
+ N_("Use portable calling conventions") }, \
+ { "no-portable-runtime", -MASK_PORTABLE_RUNTIME, \
+ N_("Do not use portable calling conventions") }, \
+ { "gas", MASK_GAS, \
+ N_("Assume code will be assembled by GAS") }, \
+ { "no-gas", -MASK_GAS, \
+ N_("Do not assume code will be assembled by GAS") }, \
+ { "soft-float", MASK_SOFT_FLOAT, \
+ N_("Use software floating point") }, \
+ { "no-soft-float", -MASK_SOFT_FLOAT, \
+ N_("Do not use software floating point") }, \
+ { "long-load-store", MASK_LONG_LOAD_STORE, \
+ N_("Emit long load/store sequences") }, \
+ { "no-long-load-store", -MASK_LONG_LOAD_STORE, \
+ N_("Do not emit long load/store sequences") }, \
+ { "fast-indirect-calls", MASK_FAST_INDIRECT_CALLS, \
+ N_("Generate fast indirect calls") }, \
+ { "no-fast-indirect-calls", -MASK_FAST_INDIRECT_CALLS, \
+ N_("Do not generate fast indirect calls") }, \
+ { "big-switch", MASK_BIG_SWITCH, \
+ N_("Generate code for huge switch statements") }, \
+ { "no-big-switch", -MASK_BIG_SWITCH, \
+ N_("Do not generate code for huge switch statements") }, \
+ { "linker-opt", 0, \
+ N_("Enable linker optimizations") }, \
+ SUBTARGET_SWITCHES \
+ { "", TARGET_DEFAULT | TARGET_CPU_DEFAULT, \
+ NULL }}
#ifndef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_GAS | MASK_JUMP_IN_DELAY)
@@ -208,14 +245,20 @@ extern int target_flags;
#define TARGET_CPU_DEFAULT 0
#endif
+#ifndef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES
+#endif
+
#ifndef TARGET_SCHED_DEFAULT
#define TARGET_SCHED_DEFAULT "8000"
#endif
-#define TARGET_OPTIONS \
-{ \
- { "schedule=", &pa_cpu_string, "Specify CPU for scheduling purposes" },\
- { "arch=", &pa_arch_string, "Specify architecture for code generation. Values are 1.0, 1.1, and 2.0. 2.0 requires gas snapshot 19990413 or later." }\
+#define TARGET_OPTIONS \
+{ \
+ { "schedule=", &pa_cpu_string, \
+ N_("Specify CPU for scheduling purposes") }, \
+ { "arch=", &pa_arch_string, \
+ N_("Specify architecture for code generation. Values are 1.0, 1.1, and 2.0. 2.0 requires gas snapshot 19990413 or later.") }\
}
/* Specify the dialect of assembler to use. New mnemonics is dialect one
@@ -265,75 +308,42 @@ extern int target_flags;
((GET_CODE (X) == PLUS ? OFFSET : 0) \
+ (frame_pointer_needed ? 0 : compute_frame_size (get_frame_size (), 0)))
-#define CPP_PA10_SPEC ""
-#define CPP_PA11_SPEC "-D_PA_RISC1_1 -D__hp9000s700"
-#define CPP_PA20_SPEC "-D_PA_RISC2_0 -D__hp9000s800"
-#define CPP_64BIT_SPEC "-D__LP64__"
-
-#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11) == 0
-#define CPP_CPU_DEFAULT_SPEC "%(cpp_pa10)"
-#endif
-
-#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11) != 0
-#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_20) != 0
-#define CPP_CPU_DEFAULT_SPEC "%(cpp_pa11) %(cpp_pa20)"
-#else
-#define CPP_CPU_DEFAULT_SPEC "%(cpp_pa11)"
-#endif
-#endif
-
-#if TARGET_64BIT
-#define CPP_64BIT_DEFAULT_SPEC "%(cpp_64bit)"
-#else
-#define CPP_64BIT_DEFAULT_SPEC ""
-#endif
-
-/* This macro defines names of additional specifications to put in the
- specs that can be used in various specifications like CC1_SPEC. Its
- definition is an initializer with a subgrouping for each command option.
-
- Each subgrouping contains a string constant, that defines the
- specification name, and a string constant that used by the GNU CC driver
- program.
-
- Do not define this macro if it does not need to do anything. */
-
-#ifndef SUBTARGET_EXTRA_SPECS
-#define SUBTARGET_EXTRA_SPECS
-#endif
+#define TARGET_CPU_CPP_BUILTINS() \
+do { \
+ builtin_assert("cpu=hppa"); \
+ builtin_assert("machine=hppa"); \
+ builtin_define("__hppa"); \
+ builtin_define("__hppa__"); \
+ if (TARGET_64BIT) \
+ { \
+ builtin_define("_LP64"); \
+ builtin_define("__LP64__"); \
+ } \
+ if (TARGET_PA_20) \
+ builtin_define("_PA_RISC2_0"); \
+ else if (TARGET_PA_11) \
+ builtin_define("_PA_RISC1_1"); \
+ else \
+ builtin_define("_PA_RISC1_0"); \
+} while (0)
-#define EXTRA_SPECS \
- { "cpp_pa10", CPP_PA10_SPEC}, \
- { "cpp_pa11", CPP_PA11_SPEC}, \
- { "cpp_pa20", CPP_PA20_SPEC}, \
- { "cpp_64bit", CPP_64BIT_SPEC}, \
- { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
- { "cpp_64bit_default", CPP_64BIT_DEFAULT_SPEC }, \
- SUBTARGET_EXTRA_SPECS
-
-#define CPP_SPEC "\
-%{mpa-risc-1-0:%(cpp_pa10)} \
-%{mpa-risc-1-1:%(cpp_pa11)} \
-%{msnake:%(cpp_pa11)} \
-%{mpa-risc-2-0:%(cpp_pa20)} \
-%{!mpa-risc-1-0:%{!mpa-risc-1-1:%{!mpa-risc-2-0:%{!msnake:%(cpp_cpu_default)}}}} \
-%{m64bit:%(cpp_64bit)} \
-%{!m64bit:%(cpp_64bit_default)} \
-%{!ansi: -D_HPUX_SOURCE -D_HIUX_SOURCE -D__STDC_EXT__ -D_INCLUDE_LONGLONG} \
-%{threads: -D_REENTRANT -D_DCE_THREADS}"
-
-#define CPLUSPLUS_CPP_SPEC "\
--D_HPUX_SOURCE -D_HIUX_SOURCE -D__STDC_EXT__ -D_INCLUDE_LONGLONG \
-%{mpa-risc-1-0:%(cpp_pa10)} \
-%{mpa-risc-1-1:%(cpp_pa11)} \
-%{msnake:%(cpp_pa11)} \
-%{mpa-risc-2-0:%(cpp_pa20)} \
-%{!mpa-risc-1-0:%{!mpa-risc-1-1:%{!mpa-risc-2-0:%{!msnake:%(cpp_cpu_default)}}}} \
-%{m64bit:%(cpp_64bit)} \
-%{!m64bit:%(cpp_64bit_default)} \
-%{threads: -D_REENTRANT -D_DCE_THREADS}"
-
-/* Defines for a K&R CC */
+/* An old set of OS defines for various BSD-like systems. */
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define_std ("REVARGV"); \
+ builtin_define_std ("hp800"); \
+ builtin_define_std ("hp9000"); \
+ builtin_define_std ("hp9k8"); \
+ if (c_language != clk_cplusplus \
+ && !flag_iso) \
+ builtin_define ("hppa"); \
+ builtin_define_std ("spectrum"); \
+ builtin_define_std ("unix"); \
+ builtin_assert ("system=bsd"); \
+ builtin_assert ("system=unix"); \
+ } \
+ while (0)
#define CC1_SPEC "%{pg:} %{p:}"
@@ -366,9 +376,6 @@ extern int target_flags;
/* Machine dependent reorg pass. */
#define MACHINE_DEPENDENT_REORG(X) pa_reorg(X)
-/* Names to predefine in the preprocessor for this target machine. */
-
-#define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -Dunix -Dhp9000 -Dhp800 -Dspectrum -DREVARGV -Asystem=unix -Asystem=bsd -Acpu=hppa -Amachine=hppa"
/* target machine storage layout */
diff --git a/gcc/config/pa/pa32-linux.h b/gcc/config/pa/pa32-linux.h
index 81f64529a3a..a5c1da2fa62 100644
--- a/gcc/config/pa/pa32-linux.h
+++ b/gcc/config/pa/pa32-linux.h
@@ -21,6 +21,3 @@ Boston, MA 02111-1307, USA. */
/* Turn off various SOM crap we don't want. */
#undef TARGET_ELF32
#define TARGET_ELF32 1
-
-#undef CPP_SPEC
-#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{mhppa:-D__hppa__} %{posix:-D_POSIX_SOURCE} -D_PA_RISC1_1"
diff --git a/gcc/config/pa/pa64-linux.h b/gcc/config/pa/pa64-linux.h
index 1691633d1cb..82a2b05005b 100644
--- a/gcc/config/pa/pa64-linux.h
+++ b/gcc/config/pa/pa64-linux.h
@@ -1,5 +1,5 @@
/* Definitions for PA_RISC with ELF format on 64-bit Linux
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -18,9 +18,6 @@ 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. */
-#undef CPP_SPEC
-#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{mhppa:-D__hppa__} %{posix:-D_POSIX_SOURCE} -D_PA_RISC2_0 -D__LP64__"
-
#if 0 /* needs some work :-( */
/* If defined, this macro specifies a table of register pairs used to
eliminate unneeded registers that point into the stack frame. */
diff --git a/gcc/config/pa/rtems.h b/gcc/config/pa/rtems.h
index fe83e85f044..b03b5c802c3 100644
--- a/gcc/config/pa/rtems.h
+++ b/gcc/config/pa/rtems.h
@@ -21,6 +21,17 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dhppa -DPWB -Acpu=hppa -Amachine=hppa \
- -D__rtems__ -Asystem=rtems"
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ if (c_language != clk_cplusplus \
+ && !flag_iso) \
+ { \
+ builtin_define ("hppa"); \
+ builtin_define_std ("PWB"); \
+ } \
+ builtin_define ("__rtems__"); \
+ builtin_assert ("system=rtems"); \
+ } \
+ while (0)