2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / config / pa / pa-hpux11.h
blobe8865dfff7f0e69ea6514d64b206b69ad563ec5e
1 /* Definitions of target machine for GNU compiler, for HP PA-RISC
2 Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GCC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* GCC always defines __STDC__. HP C++ compilers don't define it. This
22 causes trouble when sys/stdsyms.h is included. As a work around,
23 we define __STDC_EXT__. A similar situation exists with respect to
24 the definition of __cplusplus. We define _INCLUDE_LONGLONG
25 to prevent nlist.h from defining __STDC_32_MODE__ (no longlong
26 support). */
27 #undef TARGET_OS_CPP_BUILTINS
28 #define TARGET_OS_CPP_BUILTINS() \
29 do \
30 { \
31 builtin_assert ("system=hpux"); \
32 builtin_assert ("system=unix"); \
33 builtin_define ("__hp9000s800"); \
34 builtin_define ("__hp9000s800__"); \
35 builtin_define ("__hpux"); \
36 builtin_define ("__hpux__"); \
37 builtin_define ("__unix"); \
38 builtin_define ("__unix__"); \
39 if (c_dialect_cxx ()) \
40 { \
41 builtin_define ("_HPUX_SOURCE"); \
42 builtin_define ("_INCLUDE_LONGLONG"); \
43 builtin_define ("__STDC_EXT__"); \
44 } \
45 else \
46 { \
47 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_64BIT) \
64 builtin_define ("_ILP32"); \
65 } \
66 if (TARGET_SIO) \
67 builtin_define ("_SIO"); \
68 else \
69 { \
70 builtin_define ("__hp9000s700"); \
71 builtin_define ("__hp9000s700__"); \
72 builtin_define ("_WSIO"); \
73 } \
74 } \
75 while (0)
77 #undef CPP_SPEC
78 #define CPP_SPEC \
79 "%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}"
80 /* aCC defines also -DRWSTD_MULTI_THREAD, -DRW_MULTI_THREAD. These
81 affect only aCC's C++ library (Rogue Wave-derived) which we do not
82 use, and they violate the user's name space. */
84 /* We can debug dynamically linked executables on hpux11; we also
85 want dereferencing of a NULL pointer to cause a SEGV. */
86 #undef LINK_SPEC
87 #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
88 #define LINK_SPEC \
89 "%{!mpa-risc-1-0:%{!shared:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}\
90 %{!shared:%{p:-L/lib/libp -L/usr/lib/libp %{!static:\
91 %nWarning: consider linking with `-static' as system libraries with\n\
92 %n profiling support are only provided in archive format}}}\
93 %{!shared:%{pg:-L/lib/libp -L/usr/lib/libp %{!static:\
94 %nWarning: consider linking with `-static' as system libraries with\n\
95 %n profiling support are only provided in archive format}}}\
96 -z %{mlinker-opt:-O} %{!shared:-u main -u __gcc_plt_call}\
97 %{static:-a archive} %{shared:-b}"
98 #else
99 #define LINK_SPEC \
100 "%{!shared:%{p:-L/lib/libp -L/usr/lib/libp %{!static:\
101 %nWarning: consider linking with `-static' as system libraries with\n\
102 %n profiling support are only provided in archive format}}}\
103 %{!shared:%{pg:-L/lib/libp -L/usr/lib/libp %{!static:\
104 %nWarning: consider linking with `-static' as system libraries with\n\
105 %n profiling support are only provided in archive format}}}\
106 -z %{mlinker-opt:-O} %{!shared:-u main -u __gcc_plt_call}\
107 %{static:-a archive} %{shared:-b}"
108 #endif
110 /* hpux 11 has posix threads. */
111 #undef LIB_SPEC
112 #define LIB_SPEC \
113 "%{!shared:\
114 %{mt|pthread:-lpthread} -lc \
115 %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}"
117 /* Under hpux11, the normal location of the `ld' and `as' programs is the
118 /usr/ccs/bin directory. */
120 #ifndef CROSS_COMPILE
121 #undef MD_EXEC_PREFIX
122 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
123 #endif
125 /* Under hpux11 the normal location of the various *crt*.o files is
126 the /usr/ccs/lib directory. However, the profiling files are in
127 /opt/langtools/lib. */
129 #ifndef CROSS_COMPILE
130 #undef MD_STARTFILE_PREFIX
131 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
132 #define MD_STARTFILE_PREFIX_1 "/opt/langtools/lib/"
133 #endif
135 /* hpux11 has the new HP assembler. It's still lousy, but it's a whole lot
136 better than the assembler shipped with older versions of hpux. */
137 #undef NEW_HP_ASSEMBLER
138 #define NEW_HP_ASSEMBLER 1
140 /* Make GCC agree with types.h. */
141 #undef SIZE_TYPE
142 #undef PTRDIFF_TYPE
144 #define SIZE_TYPE "long unsigned int"
145 #define PTRDIFF_TYPE "long int"
147 /* HP-UX 11.0 and above provides initialization and finalization function
148 support from linker command line. We don't need to invoke __main to run
149 constructors. We also don't need chatr to determine the dependencies of
150 dynamically linked executables and shared libraries. */
151 #undef LDD_SUFFIX
152 #undef PARSE_LDD_OUTPUT
153 #undef HAS_INIT_SECTION
154 #define HAS_INIT_SECTION 1
155 #undef LD_INIT_SWITCH
156 #define LD_INIT_SWITCH "+init"
157 #undef LD_FINI_SWITCH
158 #define LD_FINI_SWITCH "+fini"
160 /* The HP-UX 11.X SOM linker (ld32) can successfully link shared libraries
161 with secondary definition (weak) symbols. */
162 #undef TARGET_SOM_SDEF
163 #define TARGET_SOM_SDEF 1