xref: /openbsd-src/gnu/gcc/gcc/config/pa/pa-hpux.h (revision 404b540a9034ac75a6199ad1a32d1bbc7a0d4210)
1*404b540aSrobert /* Definitions of target machine for GNU compiler, for HP-UX.
2*404b540aSrobert    Copyright (C) 1991, 1995, 1996, 2002, 2003, 2004
3*404b540aSrobert    Free Software Foundation, Inc.
4*404b540aSrobert 
5*404b540aSrobert This file is part of GCC.
6*404b540aSrobert 
7*404b540aSrobert GCC is free software; you can redistribute it and/or modify
8*404b540aSrobert it under the terms of the GNU General Public License as published by
9*404b540aSrobert the Free Software Foundation; either version 2, or (at your option)
10*404b540aSrobert any later version.
11*404b540aSrobert 
12*404b540aSrobert GCC is distributed in the hope that it will be useful,
13*404b540aSrobert but WITHOUT ANY WARRANTY; without even the implied warranty of
14*404b540aSrobert MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*404b540aSrobert GNU General Public License for more details.
16*404b540aSrobert 
17*404b540aSrobert You should have received a copy of the GNU General Public License
18*404b540aSrobert along with GCC; see the file COPYING.  If not, write to
19*404b540aSrobert the Free Software Foundation, 51 Franklin Street, Fifth Floor,
20*404b540aSrobert Boston, MA 02110-1301, USA.  */
21*404b540aSrobert 
22*404b540aSrobert /* HP-UX UNIX features.  */
23*404b540aSrobert #undef TARGET_HPUX
24*404b540aSrobert #define TARGET_HPUX 1
25*404b540aSrobert 
26*404b540aSrobert #undef TARGET_DEFAULT
27*404b540aSrobert #define TARGET_DEFAULT MASK_BIG_SWITCH
28*404b540aSrobert 
29*404b540aSrobert /* Make GCC agree with types.h.  */
30*404b540aSrobert #undef SIZE_TYPE
31*404b540aSrobert #undef PTRDIFF_TYPE
32*404b540aSrobert 
33*404b540aSrobert #define SIZE_TYPE "unsigned int"
34*404b540aSrobert #define PTRDIFF_TYPE "int"
35*404b540aSrobert 
36*404b540aSrobert #define LONG_DOUBLE_TYPE_SIZE 128
37*404b540aSrobert #define HPUX_LONG_DOUBLE_LIBRARY
38*404b540aSrobert #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode)
39*404b540aSrobert 
40*404b540aSrobert /* GCC always defines __STDC__.  HP C++ compilers don't define it.  This
41*404b540aSrobert    causes trouble when sys/stdsyms.h is included.  As a work around,
42*404b540aSrobert    we define __STDC_EXT__.  A similar situation exists with respect to
43*404b540aSrobert    the definition of __cplusplus.  We define _INCLUDE_LONGLONG
44*404b540aSrobert    to prevent nlist.h from defining __STDC_32_MODE__ (no longlong
45*404b540aSrobert    support).  */
46*404b540aSrobert #undef TARGET_OS_CPP_BUILTINS
47*404b540aSrobert #define TARGET_OS_CPP_BUILTINS()				\
48*404b540aSrobert   do								\
49*404b540aSrobert     {								\
50*404b540aSrobert 	builtin_assert ("system=hpux");				\
51*404b540aSrobert 	builtin_assert ("system=unix");				\
52*404b540aSrobert 	builtin_define ("__hp9000s800");			\
53*404b540aSrobert 	builtin_define ("__hp9000s800__");			\
54*404b540aSrobert 	builtin_define ("__hp9k8");				\
55*404b540aSrobert 	builtin_define ("__hp9k8__");				\
56*404b540aSrobert 	builtin_define ("__hpux");				\
57*404b540aSrobert 	builtin_define ("__hpux__");				\
58*404b540aSrobert 	builtin_define ("__unix");				\
59*404b540aSrobert 	builtin_define ("__unix__");				\
60*404b540aSrobert 	if (c_dialect_cxx ())					\
61*404b540aSrobert 	  {							\
62*404b540aSrobert 	    builtin_define ("_HPUX_SOURCE");			\
63*404b540aSrobert 	    builtin_define ("_INCLUDE_LONGLONG");		\
64*404b540aSrobert 	    builtin_define ("__STDC_EXT__");			\
65*404b540aSrobert 	  }							\
66*404b540aSrobert 	else if (!flag_iso)					\
67*404b540aSrobert 	  {							\
68*404b540aSrobert 	    builtin_define ("_HPUX_SOURCE");			\
69*404b540aSrobert 	    if (preprocessing_trad_p ())			\
70*404b540aSrobert 	      {							\
71*404b540aSrobert 		builtin_define ("hp9000s800");			\
72*404b540aSrobert 		builtin_define ("hp9k8");			\
73*404b540aSrobert 		builtin_define ("hppa");			\
74*404b540aSrobert 		builtin_define ("hpux");			\
75*404b540aSrobert 		builtin_define ("unix");			\
76*404b540aSrobert 		builtin_define ("__CLASSIC_C__");		\
77*404b540aSrobert 		builtin_define ("_PWB");			\
78*404b540aSrobert 		builtin_define ("PWB");				\
79*404b540aSrobert 	      }							\
80*404b540aSrobert 	    else						\
81*404b540aSrobert 	      builtin_define ("__STDC_EXT__");			\
82*404b540aSrobert 	  }							\
83*404b540aSrobert 	if (TARGET_SIO)						\
84*404b540aSrobert 	  builtin_define ("_SIO");				\
85*404b540aSrobert 	else							\
86*404b540aSrobert 	  {							\
87*404b540aSrobert 	    builtin_define ("__hp9000s700");			\
88*404b540aSrobert 	    builtin_define ("__hp9000s700__");			\
89*404b540aSrobert 	    builtin_define ("_WSIO");				\
90*404b540aSrobert 	  }							\
91*404b540aSrobert     }								\
92*404b540aSrobert   while (0)
93*404b540aSrobert 
94*404b540aSrobert /* Like the default, except no -lg.  */
95*404b540aSrobert #undef LIB_SPEC
96*404b540aSrobert #define LIB_SPEC "%{!shared:%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}}"
97*404b540aSrobert 
98*404b540aSrobert #undef LINK_SPEC
99*404b540aSrobert #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
100*404b540aSrobert #define LINK_SPEC \
101*404b540aSrobert   "%{!mpa-risc-1-0:%{!march=1.0:%{!shared:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}%{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{g*:-a archive} %{shared:-b}"
102*404b540aSrobert #else
103*404b540aSrobert #define LINK_SPEC \
104*404b540aSrobert   "%{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{g*:-a archive} %{shared:-b}"
105*404b540aSrobert #endif
106*404b540aSrobert 
107*404b540aSrobert /* hpux8 and later have C++ compatible include files, so do not
108*404b540aSrobert    pretend they are `extern "C"'.  */
109*404b540aSrobert #define NO_IMPLICIT_EXTERN_C
110*404b540aSrobert 
111*404b540aSrobert /* hpux11 and earlier don't have fputc_unlocked, so we must inhibit the
112*404b540aSrobert    transformation of fputs_unlocked and fprintf_unlocked to fputc_unlocked.  */
113*404b540aSrobert #define DONT_HAVE_FPUTC_UNLOCKED
114*404b540aSrobert 
115*404b540aSrobert /* We want the entry value of SP saved in the frame marker for
116*404b540aSrobert    compatibility with the HP-UX unwind library.  */
117*404b540aSrobert #undef TARGET_HPUX_UNWIND_LIBRARY
118*404b540aSrobert #define TARGET_HPUX_UNWIND_LIBRARY 1
119*404b540aSrobert 
120*404b540aSrobert /* Handle #pragma weak and #pragma pack.  */
121*404b540aSrobert #undef HANDLE_SYSV_PRAGMA
122*404b540aSrobert #define HANDLE_SYSV_PRAGMA
123*404b540aSrobert 
124*404b540aSrobert /* Define this so we can compile MS code for use with WINE.  */
125*404b540aSrobert #undef HANDLE_PRAGMA_PACK_PUSH_POP
126*404b540aSrobert #define HANDLE_PRAGMA_PACK_PUSH_POP
127*404b540aSrobert 
128*404b540aSrobert #define MD_UNWIND_SUPPORT "config/pa/hpux-unwind.h"
129