xref: /openbsd-src/gnu/usr.bin/gcc/gcc/config/pa/pa-hpux10.h (revision c87b03e512fc05ed6e0222f6fb0ae86264b1d05b)
1 /* Definitions of target machine for GNU compiler, for HP PA-RISC
2    Copyright (C) 1995, 1996, 1997, 2000, 2001, 2002
3    Free Software Foundation, Inc.
4    Contributed by Tim Moore (moore@defmacro.cs.utah.edu)
5 
6 This file is part of GNU CC.
7 
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12 
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.  */
22 
23 /* GCC always defines __STDC__.  HP C++ compilers don't define it.  This
24    causes trouble when sys/stdsyms.h is included.  As a work around,
25    we define __STDC_EXT__.  A similar situation exists with respect to
26    the definition of __cplusplus.  We define _INCLUDE_LONGLONG
27    to prevent nlist.h from defining __STDC_32_MODE__ (no longlong
28    support).  */
29 #undef TARGET_OS_CPP_BUILTINS
30 #define TARGET_OS_CPP_BUILTINS()				\
31   do								\
32     {								\
33 	builtin_assert ("system=hpux");				\
34 	builtin_assert ("system=unix");				\
35 	builtin_define ("__hp9000s800");			\
36 	builtin_define ("__hp9000s800__");			\
37 	builtin_define ("__hpux");				\
38 	builtin_define ("__hpux__");				\
39 	builtin_define ("__unix");				\
40 	builtin_define ("__unix__");				\
41 	if (c_language == clk_cplusplus)			\
42 	  {							\
43 	    builtin_define ("_HPUX_SOURCE");			\
44 	    builtin_define ("_INCLUDE_LONGLONG");		\
45 	    builtin_define ("__STDC_EXT__");			\
46 	  }							\
47 	else if (!flag_iso)					\
48 	  {							\
49 	    builtin_define ("_HPUX_SOURCE");			\
50 	    if (preprocessing_trad_p ())			\
51 	      {							\
52 		builtin_define ("hp9000s800");			\
53 		builtin_define ("hppa");			\
54 		builtin_define ("hpux");			\
55 		builtin_define ("unix");			\
56 		builtin_define ("__CLASSIC_C__");		\
57 		builtin_define ("_PWB");			\
58 		builtin_define ("PWB");				\
59 	      }							\
60 	    else						\
61 	      builtin_define ("__STDC_EXT__");			\
62 	  }							\
63 	if (TARGET_SIO)						\
64 	  builtin_define ("_SIO");				\
65 	else							\
66 	  {							\
67 	    builtin_define ("__hp9000s700");			\
68 	    builtin_define ("__hp9000s700__");			\
69 	    builtin_define ("_WSIO");				\
70 	  }							\
71     }								\
72   while (0)
73 
74 #define CPP_SPEC "%{threads: -D_REENTRANT -D_DCE_THREADS}"
75 
76 /* We can debug dynamically linked executables on hpux9; we also want
77    dereferencing of a NULL pointer to cause a SEGV.  */
78 #undef LINK_SPEC
79 #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) &  MASK_PA_11)
80 #define LINK_SPEC \
81   "%{!mpa-risc-1-0:%{!shared:-L/lib/pa1.1 -L/usr/lib/pa1.1 }} -z %{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{shared:-b}"
82 #else
83 #define LINK_SPEC \
84   "-z %{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{shared:-b}"
85 #endif
86 
87 /* Like the default, except no -lg.  */
88 #undef LIB_SPEC
89 #define LIB_SPEC \
90   "%{!shared:\
91      %{!p:%{!pg:\
92        %{!threads:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}\
93        %{threads:-lcma -lc_r}}}\
94      %{p: -L/lib/libp/ -lc\
95        %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}\
96      %{pg: -L/lib/libp/ -lc\
97        %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}"
98 
99 #undef THREAD_MODEL_SPEC
100 #define THREAD_MODEL_SPEC "%{!threads:single}%{threads:dce}"
101 
102 /* Under hpux10, the normal location of the `ld' and `as' programs is the
103    /usr/ccs/bin directory.  */
104 
105 #ifndef CROSS_COMPILE
106 #undef MD_EXEC_PREFIX
107 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
108 #endif
109 
110 /* Under hpux10, the normal location of the various *crt*.o files is
111    the /usr/ccs/lib directory.  However, the profiling files are in
112    /opt/langtools/lib.  */
113 
114 #ifndef CROSS_COMPILE
115 #undef MD_STARTFILE_PREFIX
116 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
117 #define MD_STARTFILE_PREFIX_1 "/opt/langtools/lib/"
118 #endif
119 
120 /* hpux10 has the new HP assembler.  It's still lousy, but it's a whole lot
121    better than the assembler shipped with older versions of hpux.  */
122 #undef NEW_HP_ASSEMBLER
123 #define NEW_HP_ASSEMBLER 1
124