1 |
38 |
julius |
/* Definitions of target machine for GNU compiler, for HP PA-RISC
|
2 |
|
|
Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2007
|
3 |
|
|
Free Software Foundation, Inc.
|
4 |
|
|
|
5 |
|
|
This file is part of GCC.
|
6 |
|
|
|
7 |
|
|
GCC is free software; you can redistribute it and/or modify
|
8 |
|
|
it under the terms of the GNU General Public License as published by
|
9 |
|
|
the Free Software Foundation; either version 3, or (at your option)
|
10 |
|
|
any later version.
|
11 |
|
|
|
12 |
|
|
GCC is distributed in the hope that it will be useful,
|
13 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
|
|
GNU General Public License for more details.
|
16 |
|
|
|
17 |
|
|
You should have received a copy of the GNU General Public License
|
18 |
|
|
along with GCC; see the file COPYING3. If not see
|
19 |
|
|
<http://www.gnu.org/licenses/>. */
|
20 |
|
|
|
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). We define __STDCPP__ to get certain system headers
|
27 |
|
|
(notably assert.h) to assume standard preprocessor behavior in C++. */
|
28 |
|
|
#undef TARGET_OS_CPP_BUILTINS
|
29 |
|
|
#define TARGET_OS_CPP_BUILTINS() \
|
30 |
|
|
do \
|
31 |
|
|
{ \
|
32 |
|
|
builtin_assert ("system=hpux"); \
|
33 |
|
|
builtin_assert ("system=unix"); \
|
34 |
|
|
builtin_define ("__hp9000s800"); \
|
35 |
|
|
builtin_define ("__hp9000s800__"); \
|
36 |
|
|
builtin_define ("__hpux"); \
|
37 |
|
|
builtin_define ("__hpux__"); \
|
38 |
|
|
builtin_define ("__unix"); \
|
39 |
|
|
builtin_define ("__unix__"); \
|
40 |
|
|
if (c_dialect_cxx ()) \
|
41 |
|
|
{ \
|
42 |
|
|
builtin_define ("_HPUX_SOURCE"); \
|
43 |
|
|
builtin_define ("_INCLUDE_LONGLONG"); \
|
44 |
|
|
builtin_define ("__STDC_EXT__"); \
|
45 |
|
|
builtin_define ("__STDCPP__"); \
|
46 |
|
|
} \
|
47 |
|
|
else \
|
48 |
|
|
{ \
|
49 |
|
|
if (!flag_iso) \
|
50 |
|
|
{ \
|
51 |
|
|
builtin_define ("_HPUX_SOURCE"); \
|
52 |
|
|
if (preprocessing_trad_p ()) \
|
53 |
|
|
{ \
|
54 |
|
|
builtin_define ("hp9000s800"); \
|
55 |
|
|
builtin_define ("hppa"); \
|
56 |
|
|
builtin_define ("hpux"); \
|
57 |
|
|
builtin_define ("unix"); \
|
58 |
|
|
builtin_define ("__CLASSIC_C__"); \
|
59 |
|
|
builtin_define ("_PWB"); \
|
60 |
|
|
builtin_define ("PWB"); \
|
61 |
|
|
} \
|
62 |
|
|
else \
|
63 |
|
|
builtin_define ("__STDC_EXT__"); \
|
64 |
|
|
} \
|
65 |
|
|
} \
|
66 |
|
|
if (!TARGET_64BIT) \
|
67 |
|
|
builtin_define ("_ILP32"); \
|
68 |
|
|
if (flag_pa_unix >= 1995 && !flag_iso) \
|
69 |
|
|
{ \
|
70 |
|
|
builtin_define ("_XOPEN_UNIX"); \
|
71 |
|
|
builtin_define ("_XOPEN_SOURCE_EXTENDED"); \
|
72 |
|
|
} \
|
73 |
|
|
if (TARGET_HPUX_11_11) \
|
74 |
|
|
{ \
|
75 |
|
|
if (flag_pa_unix >= 1998) \
|
76 |
|
|
{ \
|
77 |
|
|
if (flag_isoc94 || flag_isoc99 || c_dialect_cxx() \
|
78 |
|
|
|| !flag_iso) \
|
79 |
|
|
builtin_define ("_INCLUDE__STDC_A1_SOURCE"); \
|
80 |
|
|
if (!flag_iso) \
|
81 |
|
|
builtin_define ("_INCLUDE_XOPEN_SOURCE_500"); \
|
82 |
|
|
} \
|
83 |
|
|
else if (flag_isoc94 || flag_isoc99 || c_dialect_cxx ()) \
|
84 |
|
|
warning (0, "-munix=98 option required for C89 " \
|
85 |
|
|
"Amendment 1 features.\n"); \
|
86 |
|
|
} \
|
87 |
|
|
if (TARGET_SIO) \
|
88 |
|
|
builtin_define ("_SIO"); \
|
89 |
|
|
else \
|
90 |
|
|
{ \
|
91 |
|
|
builtin_define ("__hp9000s700"); \
|
92 |
|
|
builtin_define ("__hp9000s700__"); \
|
93 |
|
|
builtin_define ("_WSIO"); \
|
94 |
|
|
} \
|
95 |
|
|
} \
|
96 |
|
|
while (0)
|
97 |
|
|
|
98 |
|
|
#undef CPP_SPEC
|
99 |
|
|
#define CPP_SPEC \
|
100 |
|
|
"%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}"
|
101 |
|
|
/* aCC defines also -DRWSTD_MULTI_THREAD, -DRW_MULTI_THREAD. These
|
102 |
|
|
affect only aCC's C++ library (Rogue Wave-derived) which we do not
|
103 |
|
|
use, and they violate the user's name space. */
|
104 |
|
|
|
105 |
|
|
/* We can debug dynamically linked executables on hpux11; we also
|
106 |
|
|
want dereferencing of a NULL pointer to cause a SEGV. */
|
107 |
|
|
#undef LINK_SPEC
|
108 |
|
|
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11)
|
109 |
|
|
#define LINK_SPEC \
|
110 |
|
|
"%{!mpa-risc-1-0:%{!march=1.0:%{!shared:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}\
|
111 |
|
|
%{!shared:%{p:-L/lib/libp -L/usr/lib/libp %{!static:\
|
112 |
|
|
%nWarning: consider linking with `-static' as system libraries with\n\
|
113 |
|
|
%n profiling support are only provided in archive format}}}\
|
114 |
|
|
%{!shared:%{pg:-L/lib/libp -L/usr/lib/libp %{!static:\
|
115 |
|
|
%nWarning: consider linking with `-static' as system libraries with\n\
|
116 |
|
|
%n profiling support are only provided in archive format}}}\
|
117 |
|
|
-z %{mlinker-opt:-O} %{!shared:-u main -u __gcc_plt_call}\
|
118 |
|
|
%{static:-a archive} %{shared:-b}"
|
119 |
|
|
#else
|
120 |
|
|
#define LINK_SPEC \
|
121 |
|
|
"%{!shared:%{p:-L/lib/libp -L/usr/lib/libp %{!static:\
|
122 |
|
|
%nWarning: consider linking with `-static' as system libraries with\n\
|
123 |
|
|
%n profiling support are only provided in archive format}}}\
|
124 |
|
|
%{!shared:%{pg:-L/lib/libp -L/usr/lib/libp %{!static:\
|
125 |
|
|
%nWarning: consider linking with `-static' as system libraries with\n\
|
126 |
|
|
%n profiling support are only provided in archive format}}}\
|
127 |
|
|
-z %{mlinker-opt:-O} %{!shared:-u main -u __gcc_plt_call}\
|
128 |
|
|
%{static:-a archive} %{shared:-b}"
|
129 |
|
|
#endif
|
130 |
|
|
|
131 |
|
|
/* HP-UX 11 has posix threads. HP libc contains pthread stubs so that
|
132 |
|
|
non-threaded applications can be linked with a thread-safe libc
|
133 |
|
|
without a subsequent loss of performance. For more details, see
|
134 |
|
|
<http://docs.hp.com/en/1896/pthreads.html>. */
|
135 |
|
|
#undef LIB_SPEC
|
136 |
|
|
#define LIB_SPEC \
|
137 |
|
|
"%{!shared:\
|
138 |
|
|
%{mt|pthread:-lpthread} -lc \
|
139 |
|
|
%{static:%{!nolibdld:-a shared -ldld -a archive -lpthread -lc}}}"
|
140 |
|
|
|
141 |
|
|
#undef STARTFILE_SPEC
|
142 |
|
|
#define STARTFILE_SPEC \
|
143 |
|
|
"%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}} \
|
144 |
|
|
%{!munix=93:unix95%O%s}}"
|
145 |
|
|
|
146 |
|
|
/* Under hpux11, the normal location of the `ld' and `as' programs is the
|
147 |
|
|
/usr/ccs/bin directory. */
|
148 |
|
|
|
149 |
|
|
#ifndef CROSS_COMPILE
|
150 |
|
|
#undef MD_EXEC_PREFIX
|
151 |
|
|
#define MD_EXEC_PREFIX "/usr/ccs/bin/"
|
152 |
|
|
#endif
|
153 |
|
|
|
154 |
|
|
/* Under hpux11 the normal location of the various *crt*.o files is
|
155 |
|
|
the /usr/ccs/lib directory. However, the profiling files are in
|
156 |
|
|
/opt/langtools/lib. */
|
157 |
|
|
|
158 |
|
|
#ifndef CROSS_COMPILE
|
159 |
|
|
#undef MD_STARTFILE_PREFIX
|
160 |
|
|
#define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
|
161 |
|
|
#define MD_STARTFILE_PREFIX_1 "/opt/langtools/lib/"
|
162 |
|
|
#endif
|
163 |
|
|
|
164 |
|
|
/* hpux11 has the new HP assembler. It's still lousy, but it's a whole lot
|
165 |
|
|
better than the assembler shipped with older versions of hpux. */
|
166 |
|
|
#undef NEW_HP_ASSEMBLER
|
167 |
|
|
#define NEW_HP_ASSEMBLER 1
|
168 |
|
|
|
169 |
|
|
/* Make GCC agree with types.h. */
|
170 |
|
|
#undef SIZE_TYPE
|
171 |
|
|
#undef PTRDIFF_TYPE
|
172 |
|
|
|
173 |
|
|
#define SIZE_TYPE "long unsigned int"
|
174 |
|
|
#define PTRDIFF_TYPE "long int"
|
175 |
|
|
|
176 |
|
|
/* HP-UX 11.0 and above provides initialization and finalization function
|
177 |
|
|
support from linker command line. We don't need to invoke __main to run
|
178 |
|
|
constructors. We also don't need chatr to determine the dependencies of
|
179 |
|
|
dynamically linked executables and shared libraries. */
|
180 |
|
|
#undef LDD_SUFFIX
|
181 |
|
|
#undef PARSE_LDD_OUTPUT
|
182 |
|
|
#undef HAS_INIT_SECTION
|
183 |
|
|
#define HAS_INIT_SECTION 1
|
184 |
|
|
#undef LD_INIT_SWITCH
|
185 |
|
|
#define LD_INIT_SWITCH "+init"
|
186 |
|
|
#undef LD_FINI_SWITCH
|
187 |
|
|
#define LD_FINI_SWITCH "+fini"
|
188 |
|
|
|
189 |
|
|
/* The HP-UX 11.X SOM linker (ld32) can successfully link shared libraries
|
190 |
|
|
with secondary definition (weak) symbols. */
|
191 |
|
|
#undef TARGET_SOM_SDEF
|
192 |
|
|
#define TARGET_SOM_SDEF 1
|