Commit c219e1da by John David Anglin Committed by John David Anglin

c-common.c (preprocessing_trad_p): Define.

	* 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().

From-SVN: r57416
parent 490ed846
2002-09-22 John David Anglin <dave@hiauly1.hia.nrc.ca>
* 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().
2002-09-22 Jason Thorpe <thorpej@wasabisystems.com> 2002-09-22 Jason Thorpe <thorpej@wasabisystems.com>
* doc/install.texi: Document behavior of --with-headers and * doc/install.texi: Document behavior of --with-headers and
...@@ -5007,6 +5007,7 @@ cb_register_builtins (pfile) ...@@ -5007,6 +5007,7 @@ cb_register_builtins (pfile)
/* A straightforward target hook doesn't work, because of problems /* A straightforward target hook doesn't work, because of problems
linking that hook's body when part of non-C front ends. */ linking that hook's body when part of non-C front ends. */
# define preprocessing_asm_p() (cpp_get_options (pfile)->lang == CLK_ASM) # define preprocessing_asm_p() (cpp_get_options (pfile)->lang == CLK_ASM)
# define preprocessing_trad_p() (cpp_get_options (pfile)->traditional)
# define builtin_define(TXT) cpp_define (pfile, TXT) # define builtin_define(TXT) cpp_define (pfile, TXT)
# define builtin_assert(TXT) cpp_assert (pfile, TXT) # define builtin_assert(TXT) cpp_assert (pfile, TXT)
TARGET_CPU_CPP_BUILTINS (); TARGET_CPU_CPP_BUILTINS ();
......
/* Definitions of target machine for GNU compiler, for HI-UX. /* 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. This file is part of GNU CC.
...@@ -21,6 +21,56 @@ Boston, MA 02111-1307, USA. */ ...@@ -21,6 +21,56 @@ Boston, MA 02111-1307, USA. */
/* HIUX is just a HPUX variant. We can simply use the HPUX configuration /* HIUX is just a HPUX variant. We can simply use the HPUX configuration
for just about everything. */ for just about everything. */
/* Predefines are the one noteworthy difference between HPUX and HIUX. */ /* OS cpp builtins are the one noteworthy difference between HPUX and HIUX.
#undef CPP_PREDEFINES The following defines are similar to those for hpux10 with the addition
#define CPP_PREDEFINES "-Dhppa -DPWB -Dunix -D__H3050R -D__H3050RX -Asystem=unix -Asystem=hiux -Acpu=hppa -Amachine=hppa" 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") },
/* Definitions of target machine for GNU compiler, for HP-UX. /* 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. This file is part of GNU CC.
...@@ -28,13 +28,62 @@ Boston, MA 02111-1307, USA. */ ...@@ -28,13 +28,62 @@ Boston, MA 02111-1307, USA. */
#define SIZE_TYPE "unsigned int" #define SIZE_TYPE "unsigned int"
#define PTRDIFF_TYPE "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. */ /* Like the default, except no -lg. */
#undef LIB_SPEC #undef LIB_SPEC
#define LIB_SPEC "%{!shared:%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}}" #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 #undef LINK_SPEC
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11) #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
#define LINK_SPEC \ #define LINK_SPEC \
......
/* Definitions of target machine for GNU compiler, for HP PA-RISC 1.1 /* Definitions of target machine for GNU compiler, for HP PA-RISC
Copyright (C) 1995, 1996, 1997, 2000, 2001 Free Software Foundation, Inc. Copyright (C) 1995, 1996, 1997, 2000, 2001, 2002
Free Software Foundation, Inc.
Contributed by Tim Moore (moore@defmacro.cs.utah.edu) Contributed by Tim Moore (moore@defmacro.cs.utah.edu)
This file is part of GNU CC. This file is part of GNU CC.
...@@ -19,6 +20,52 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -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, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ 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 /* We can debug dynamically linked executables on hpux9; we also want
dereferencing of a NULL pointer to cause a SEGV. */ dereferencing of a NULL pointer to cause a SEGV. */
#undef LINK_SPEC #undef LINK_SPEC
......
/* Definitions of target machine for GNU compiler, for HP PA-RISC 1.1 /* Definitions of target machine for GNU compiler, for HP PA-RISC
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -18,6 +18,55 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -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, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ 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 /* We can debug dynamically linked executables on hpux11; we also
want dereferencing of a NULL pointer to cause a SEGV. */ want dereferencing of a NULL pointer to cause a SEGV. */
#undef LINK_SPEC #undef LINK_SPEC
......
/* Definitions of target machine for GNU compiler, for HP-UX. /* 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. This file is part of GNU CC.
...@@ -29,9 +29,58 @@ Boston, MA 02111-1307, USA. */ ...@@ -29,9 +29,58 @@ Boston, MA 02111-1307, USA. */
#define SIZE_TYPE "unsigned int" #define SIZE_TYPE "unsigned int"
#define PTRDIFF_TYPE "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. */ /* Like the default, except no -lg. */
#undef LIB_SPEC #undef LIB_SPEC
#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}" #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"
...@@ -56,8 +56,22 @@ Boston, MA 02111-1307, USA. */ ...@@ -56,8 +56,22 @@ Boston, MA 02111-1307, USA. */
} \ } \
} while (0) } while (0)
#undef CPP_PREDEFINES #undef TARGET_OS_CPP_BUILTINS
#define CPP_PREDEFINES "-D__ELF__ -Dunix -D__hppa__ -D__gnu_linux__ -Dlinux -Asystem=unix -Asystem=posix -Acpu=hppa -Amachine=hppa -Amachine=bigendian" #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 #undef LIB_SPEC
#define LIB_SPEC \ #define LIB_SPEC \
......
/* Definitions of target machine for GNU compiler, for HP PA-RISC 1.1 /* 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) Contributed by Tim Moore (moore@defmacro.cs.utah.edu)
This file is part of GNU CC. This file is part of GNU CC.
...@@ -19,12 +19,34 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -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, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#undef CPP_PREDEFINES #undef TARGET_OS_CPP_BUILTINS
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11) #define TARGET_OS_CPP_BUILTINS() \
#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" do \
#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" if (TARGET_PA_11) \
#endif { \
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 /* Don't default to pcc-struct-return, because gcc is the only compiler, and
we want to retain compatibility with older gcc versions. */ we want to retain compatibility with older gcc versions. */
......
/* Definitions of target machine for GNU compiler, for PRO. /* 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. This file is part of GNU CC.
...@@ -25,13 +25,25 @@ Boston, MA 02111-1307, USA. */ ...@@ -25,13 +25,25 @@ Boston, MA 02111-1307, USA. */
#define SIZE_TYPE "unsigned int" #define SIZE_TYPE "unsigned int"
#define PTRDIFF_TYPE "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. */ /* Like the default, except no -lg. */
#undef LIB_SPEC #undef LIB_SPEC
#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}" #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 /* hpux8 and later have C++ compatible include files, so do not
pretend they are `extern "C"'. */ pretend they are `extern "C"'. */
#define NO_IMPLICIT_EXTERN_C #define NO_IMPLICIT_EXTERN_C
......
...@@ -74,14 +74,10 @@ extern enum architecture_type pa_arch; ...@@ -74,14 +74,10 @@ extern enum architecture_type pa_arch;
extern int target_flags; 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 #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 /* Disable all FP registers (they all become fixed). This may be necessary
for compiling kernels which perform lazy context switching of FP regs. for compiling kernels which perform lazy context switching of FP regs.
Note if you use this option and try to perform floating point operations Note if you use this option and try to perform floating point operations
...@@ -142,10 +138,22 @@ extern int target_flags; ...@@ -142,10 +138,22 @@ extern int target_flags;
#define MASK_BIG_SWITCH 2048 #define MASK_BIG_SWITCH 2048
#define TARGET_BIG_SWITCH (target_flags & MASK_BIG_SWITCH) #define TARGET_BIG_SWITCH (target_flags & MASK_BIG_SWITCH)
/* Generate code for the HPPA 2.0 architecture. TARGET_PA_11 should also be /* Generate code for the HPPA 2.0 architecture. TARGET_PA_11 should also be
true when this is true. */ true when this is true. */
#define MASK_PA_20 4096 #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 #ifndef TARGET_PA_20
#define TARGET_PA_20 (target_flags & MASK_PA_20) #define TARGET_PA_20 (target_flags & MASK_PA_20)
#endif #endif
...@@ -165,40 +173,69 @@ extern int target_flags; ...@@ -165,40 +173,69 @@ extern int target_flags;
#define TARGET_SOM 0 #define TARGET_SOM 0
#endif #endif
/* Macro to define tables used to set the flags. /* Macro to define tables used to set the flags. This is a
This is a list in braces of pairs in braces, list in braces of target switches with each switch being
each pair being { "NAME", VALUE } { "NAME", VALUE, "HELP_STRING" }. VALUE is the bits to set,
where VALUE is the bits to set or minus the bits to clear. or minus the bits to clear. An empty string NAME is used to
An empty string NAME is used to identify the default VALUE. */ identify the default VALUE. Do not mark empty strings for
translation. */
#define TARGET_SWITCHES \ #define TARGET_SWITCHES \
{{"snake", MASK_PA_11, "Generate PA1.1 code"}, \ {{ "snake", MASK_PA_11, \
{"nosnake", -(MASK_PA_11 | MASK_PA_20), "Generate PA1.0 code"}, \ N_("Generate PA1.1 code") }, \
{"pa-risc-1-0", -(MASK_PA_11 | MASK_PA_20), "Generate PA1.0 code"}, \ { "nosnake", -(MASK_PA_11 | MASK_PA_20), \
{"pa-risc-1-1", MASK_PA_11, "Generate PA1.1 code"}, \ N_("Generate PA1.0 code") }, \
{"pa-risc-2-0", MASK_PA_20, "Generate PA2.0 code. This option requires binutils 2.10 or later"}, \ { "pa-risc-1-0", -(MASK_PA_11 | MASK_PA_20), \
{"disable-fpregs", MASK_DISABLE_FPREGS, "Disable FP regs"}, \ N_("Generate PA1.0 code") }, \
{"no-disable-fpregs", -MASK_DISABLE_FPREGS, "Do not disable FP regs"},\ { "pa-risc-1-1", MASK_PA_11, \
{"no-space-regs", MASK_NO_SPACE_REGS, "Disable space regs"}, \ N_("Generate PA1.1 code") }, \
{"space-regs", -MASK_NO_SPACE_REGS, "Do not disable space regs"}, \ { "pa-risc-2-0", MASK_PA_20, \
{"jump-in-delay", MASK_JUMP_IN_DELAY, "Put jumps in call delay slots"},\ N_("Generate PA2.0 code (requires binutils 2.10 or later)") }, \
{"no-jump-in-delay", -MASK_JUMP_IN_DELAY, "Do not put jumps in call delay slots"}, \ { "disable-fpregs", MASK_DISABLE_FPREGS, \
{"disable-indexing", MASK_DISABLE_INDEXING, "Disable indexed addressing"},\ N_("Disable FP regs") }, \
{"no-disable-indexing", -MASK_DISABLE_INDEXING, "Do not disable indexed addressing"},\ { "no-disable-fpregs", -MASK_DISABLE_FPREGS, \
{"portable-runtime", MASK_PORTABLE_RUNTIME, "Use portable calling conventions"}, \ N_("Do not disable FP regs") }, \
{"no-portable-runtime", -MASK_PORTABLE_RUNTIME, "Do not use portable calling conventions"},\ { "no-space-regs", MASK_NO_SPACE_REGS, \
{"gas", MASK_GAS, "Assume code will be assembled by GAS"}, \ N_("Disable space regs") }, \
{"no-gas", -MASK_GAS, "Do not assume code will be assembled by GAS"}, \ { "space-regs", -MASK_NO_SPACE_REGS, \
{"soft-float", MASK_SOFT_FLOAT, "Use software floating point"}, \ N_("Do not disable space regs") }, \
{"no-soft-float", -MASK_SOFT_FLOAT, "Do not use software floating point"}, \ { "jump-in-delay", MASK_JUMP_IN_DELAY, \
{"long-load-store", MASK_LONG_LOAD_STORE, "Emit long load/store sequences"}, \ N_("Put jumps in call delay slots") }, \
{"no-long-load-store", -MASK_LONG_LOAD_STORE, "Do not emit long load/store sequences"},\ { "no-jump-in-delay", -MASK_JUMP_IN_DELAY, \
{"fast-indirect-calls", MASK_FAST_INDIRECT_CALLS, "Generate fast indirect calls"},\ N_("Do not put jumps in call delay slots") }, \
{"no-fast-indirect-calls", -MASK_FAST_INDIRECT_CALLS, "Do not generate fast indirect calls"},\ { "disable-indexing", MASK_DISABLE_INDEXING, \
{"big-switch", MASK_BIG_SWITCH, "Generate code for huge switch statements"}, \ N_("Disable indexed addressing") }, \
{"no-big-switch", -MASK_BIG_SWITCH, "Do not generate code for huge switch statements"}, \ { "no-disable-indexing", -MASK_DISABLE_INDEXING, \
{"linker-opt", 0, "Enable linker optimizations"}, \ N_("Do not disable indexed addressing") }, \
{ "", TARGET_DEFAULT | TARGET_CPU_DEFAULT, NULL}} { "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 #ifndef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_GAS | MASK_JUMP_IN_DELAY) #define TARGET_DEFAULT (MASK_GAS | MASK_JUMP_IN_DELAY)
...@@ -208,14 +245,20 @@ extern int target_flags; ...@@ -208,14 +245,20 @@ extern int target_flags;
#define TARGET_CPU_DEFAULT 0 #define TARGET_CPU_DEFAULT 0
#endif #endif
#ifndef SUBTARGET_SWITCHES
#define SUBTARGET_SWITCHES
#endif
#ifndef TARGET_SCHED_DEFAULT #ifndef TARGET_SCHED_DEFAULT
#define TARGET_SCHED_DEFAULT "8000" #define TARGET_SCHED_DEFAULT "8000"
#endif #endif
#define TARGET_OPTIONS \ #define TARGET_OPTIONS \
{ \ { \
{ "schedule=", &pa_cpu_string, "Specify CPU for scheduling purposes" },\ { "schedule=", &pa_cpu_string, \
{ "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." }\ 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 /* Specify the dialect of assembler to use. New mnemonics is dialect one
...@@ -265,75 +308,42 @@ extern int target_flags; ...@@ -265,75 +308,42 @@ extern int target_flags;
((GET_CODE (X) == PLUS ? OFFSET : 0) \ ((GET_CODE (X) == PLUS ? OFFSET : 0) \
+ (frame_pointer_needed ? 0 : compute_frame_size (get_frame_size (), 0))) + (frame_pointer_needed ? 0 : compute_frame_size (get_frame_size (), 0)))
#define CPP_PA10_SPEC "" #define TARGET_CPU_CPP_BUILTINS() \
#define CPP_PA11_SPEC "-D_PA_RISC1_1 -D__hp9000s700" do { \
#define CPP_PA20_SPEC "-D_PA_RISC2_0 -D__hp9000s800" builtin_assert("cpu=hppa"); \
#define CPP_64BIT_SPEC "-D__LP64__" builtin_assert("machine=hppa"); \
builtin_define("__hppa"); \
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11) == 0 builtin_define("__hppa__"); \
#define CPP_CPU_DEFAULT_SPEC "%(cpp_pa10)" if (TARGET_64BIT) \
#endif { \
builtin_define("_LP64"); \
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11) != 0 builtin_define("__LP64__"); \
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_20) != 0 } \
#define CPP_CPU_DEFAULT_SPEC "%(cpp_pa11) %(cpp_pa20)" if (TARGET_PA_20) \
#else builtin_define("_PA_RISC2_0"); \
#define CPP_CPU_DEFAULT_SPEC "%(cpp_pa11)" else if (TARGET_PA_11) \
#endif builtin_define("_PA_RISC1_1"); \
#endif else \
builtin_define("_PA_RISC1_0"); \
#if TARGET_64BIT } while (0)
#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 EXTRA_SPECS \ /* An old set of OS defines for various BSD-like systems. */
{ "cpp_pa10", CPP_PA10_SPEC}, \ #define TARGET_OS_CPP_BUILTINS() \
{ "cpp_pa11", CPP_PA11_SPEC}, \ do \
{ "cpp_pa20", CPP_PA20_SPEC}, \ { \
{ "cpp_64bit", CPP_64BIT_SPEC}, \ builtin_define_std ("REVARGV"); \
{ "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \ builtin_define_std ("hp800"); \
{ "cpp_64bit_default", CPP_64BIT_DEFAULT_SPEC }, \ builtin_define_std ("hp9000"); \
SUBTARGET_EXTRA_SPECS builtin_define_std ("hp9k8"); \
if (c_language != clk_cplusplus \
#define CPP_SPEC "\ && !flag_iso) \
%{mpa-risc-1-0:%(cpp_pa10)} \ builtin_define ("hppa"); \
%{mpa-risc-1-1:%(cpp_pa11)} \ builtin_define_std ("spectrum"); \
%{msnake:%(cpp_pa11)} \ builtin_define_std ("unix"); \
%{mpa-risc-2-0:%(cpp_pa20)} \ builtin_assert ("system=bsd"); \
%{!mpa-risc-1-0:%{!mpa-risc-1-1:%{!mpa-risc-2-0:%{!msnake:%(cpp_cpu_default)}}}} \ builtin_assert ("system=unix"); \
%{m64bit:%(cpp_64bit)} \ } \
%{!m64bit:%(cpp_64bit_default)} \ while (0)
%{!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 */
#define CC1_SPEC "%{pg:} %{p:}" #define CC1_SPEC "%{pg:} %{p:}"
...@@ -366,9 +376,6 @@ extern int target_flags; ...@@ -366,9 +376,6 @@ extern int target_flags;
/* Machine dependent reorg pass. */ /* Machine dependent reorg pass. */
#define MACHINE_DEPENDENT_REORG(X) pa_reorg(X) #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 */ /* target machine storage layout */
......
...@@ -21,6 +21,3 @@ Boston, MA 02111-1307, USA. */ ...@@ -21,6 +21,3 @@ Boston, MA 02111-1307, USA. */
/* Turn off various SOM crap we don't want. */ /* Turn off various SOM crap we don't want. */
#undef TARGET_ELF32 #undef TARGET_ELF32
#define TARGET_ELF32 1 #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"
/* Definitions for PA_RISC with ELF format on 64-bit Linux /* 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. This file is part of GNU CC.
...@@ -18,9 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -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, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ 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 0 /* needs some work :-( */
/* If defined, this macro specifies a table of register pairs used to /* If defined, this macro specifies a table of register pairs used to
eliminate unneeded registers that point into the stack frame. */ eliminate unneeded registers that point into the stack frame. */
......
...@@ -21,6 +21,17 @@ Boston, MA 02111-1307, USA. */ ...@@ -21,6 +21,17 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */ /* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES #undef TARGET_OS_CPP_BUILTINS
#define CPP_PREDEFINES "-Dhppa -DPWB -Acpu=hppa -Amachine=hppa \ #define TARGET_OS_CPP_BUILTINS() \
-D__rtems__ -Asystem=rtems" do \
{ \
if (c_language != clk_cplusplus \
&& !flag_iso) \
{ \
builtin_define ("hppa"); \
builtin_define_std ("PWB"); \
} \
builtin_define ("__rtems__"); \
builtin_assert ("system=rtems"); \
} \
while (0)
...@@ -508,7 +508,7 @@ in the following sections. ...@@ -508,7 +508,7 @@ in the following sections.
-mno-portable-runtime -mno-soft-float @gol -mno-portable-runtime -mno-soft-float @gol
-mno-space-regs -msoft-float -mpa-risc-1-0 @gol -mno-space-regs -msoft-float -mpa-risc-1-0 @gol
-mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime @gol -mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime @gol
-mschedule=@var{cpu-type} -mspace-regs} -mschedule=@var{cpu-type} -mspace-regs -msio -mwsio}
@emph{Intel 960 Options} @emph{Intel 960 Options}
@gccoptlist{ @gccoptlist{
...@@ -7901,9 +7901,9 @@ proper scheduling option for your machine. The default scheduling is ...@@ -7901,9 +7901,9 @@ proper scheduling option for your machine. The default scheduling is
@item -mlinker-opt @item -mlinker-opt
@opindex mlinker-opt @opindex mlinker-opt
Enable the optimization pass in the HPUX linker. Note this makes symbolic Enable the optimization pass in the HP-UX linker. Note this makes symbolic
debugging impossible. It also triggers a bug in the HPUX 8 and HPUX 9 linkers debugging impossible. It also triggers a bug in the HP-UX 8 and HP-UX 9
in which they give bogus error messages when linking some programs. linkers in which they give bogus error messages when linking some programs.
@item -msoft-float @item -msoft-float
@opindex msoft-float @opindex msoft-float
...@@ -7920,6 +7920,13 @@ therefore, it is only useful if you compile @emph{all} of a program with ...@@ -7920,6 +7920,13 @@ therefore, it is only useful if you compile @emph{all} of a program with
this option. In particular, you need to compile @file{libgcc.a}, the this option. In particular, you need to compile @file{libgcc.a}, the
library that comes with GCC, with @option{-msoft-float} in order for library that comes with GCC, with @option{-msoft-float} in order for
this to work. this to work.
@item -msio
@opindex msio
Generate the predefine, @code{_SIO}, for server IO. The default is
@option{-mwsio}. This generates the predefines, @code{__hp9000s700},
@code{__hp9000s700__} and @code{_WSIO}, for workstation IO. These
options are available under HP-UX and HI-UX.
@end table @end table
@node Intel 960 Options @node Intel 960 Options
...@@ -9125,7 +9132,7 @@ These are the @samp{-m} options defined for the Intel IA-64 architecture. ...@@ -9125,7 +9132,7 @@ These are the @samp{-m} options defined for the Intel IA-64 architecture.
@table @gcctabopt @table @gcctabopt
@item -mbig-endian @item -mbig-endian
@opindex mbig-endian @opindex mbig-endian
Generate code for a big endian target. This is the default for HPUX@. Generate code for a big endian target. This is the default for HP-UX@.
@item -mlittle-endian @item -mlittle-endian
@opindex mlittle-endian @opindex mlittle-endian
......
...@@ -615,7 +615,9 @@ or @code{clk_objective_c}. Note that if we are preprocessing ...@@ -615,7 +615,9 @@ or @code{clk_objective_c}. Note that if we are preprocessing
assembler, this variable will be @code{clk_c} but the function-like assembler, this variable will be @code{clk_c} but the function-like
macro @code{preprocessing_asm_p()} will return true, so you might want macro @code{preprocessing_asm_p()} will return true, so you might want
to check for that first. If you need to check for strict ANSI, the to check for that first. If you need to check for strict ANSI, the
variable @code{flag_iso} can be used. variable @code{flag_iso} can be used. The function-like macro
@code{preprocessing_trad_p()} can be used to check for traditional
preprocessing.
With @code{TARGET_OS_CPP_BUILTINS} this macro obsoletes the With @code{TARGET_OS_CPP_BUILTINS} this macro obsoletes the
@code{CPP_PREDEFINES} target macro. @code{CPP_PREDEFINES} target macro.
......
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