]>
Commit | Line | Data |
---|---|---|
c219e1da | 1 | /* Definitions of target machine for GNU compiler, for HP PA-RISC |
a5544970 | 2 | Copyright (C) 1995-2019 Free Software Foundation, Inc. |
7fc5b331 JL |
3 | Contributed by Tim Moore (moore@defmacro.cs.utah.edu) |
4 | ||
b7849684 | 5 | This file is part of GCC. |
7fc5b331 | 6 | |
b7849684 | 7 | GCC is free software; you can redistribute it and/or modify |
7fc5b331 | 8 | it under the terms of the GNU General Public License as published by |
2f83c7d6 | 9 | the Free Software Foundation; either version 3, or (at your option) |
7fc5b331 JL |
10 | any later version. |
11 | ||
b7849684 | 12 | GCC is distributed in the hope that it will be useful, |
7fc5b331 JL |
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 | |
2f83c7d6 NC |
18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ | |
7fc5b331 | 20 | |
cb99b61a JDA |
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 | |
7dd7fb88 | 26 | support). We define __STDCPP__ to get certain system headers |
08b5b29e JDA |
27 | (notably assert.h) to assume standard preprocessor behavior in C++. |
28 | We define _XOPEN_SOURCE_EXTENDED when we define _HPUX_SOURCE to avoid | |
29 | non standard hpux variants in _INCLUDE_XOPEN_SOURCE_EXTENDED. */ | |
c219e1da | 30 | #undef TARGET_OS_CPP_BUILTINS |
d711cf67 JDA |
31 | #define TARGET_OS_CPP_BUILTINS() \ |
32 | do \ | |
33 | { \ | |
34 | builtin_assert ("system=hpux"); \ | |
35 | builtin_assert ("system=unix"); \ | |
36 | builtin_define ("__hp9000s800"); \ | |
37 | builtin_define ("__hp9000s800__"); \ | |
38 | builtin_define ("__hpux"); \ | |
39 | builtin_define ("__hpux__"); \ | |
40 | builtin_define ("__unix"); \ | |
41 | builtin_define ("__unix__"); \ | |
9a17c91d | 42 | builtin_define ("__STDC_EXT__"); \ |
d711cf67 JDA |
43 | if (c_dialect_cxx ()) \ |
44 | { \ | |
45 | builtin_define ("_HPUX_SOURCE"); \ | |
5de27cca | 46 | builtin_define ("_REENTRANT"); \ |
d711cf67 | 47 | builtin_define ("_INCLUDE_LONGLONG"); \ |
d711cf67 | 48 | builtin_define ("__STDCPP__"); \ |
08b5b29e JDA |
49 | builtin_define ("_LARGEFILE_SOURCE"); \ |
50 | builtin_define ("_LARGEFILE64_SOURCE"); \ | |
51 | if (flag_pa_unix >= 1995) \ | |
52 | { \ | |
53 | builtin_define ("_XOPEN_UNIX"); \ | |
54 | builtin_define ("_XOPEN_SOURCE_EXTENDED"); \ | |
55 | } \ | |
d711cf67 | 56 | } \ |
08b5b29e JDA |
57 | else if (flag_iso) \ |
58 | { \ | |
59 | if (flag_isoc94) \ | |
60 | builtin_define ("_INCLUDE__STDC_A1_SOURCE"); \ | |
61 | } \ | |
62 | else \ | |
d711cf67 JDA |
63 | { \ |
64 | builtin_define ("_HPUX_SOURCE"); \ | |
5de27cca | 65 | builtin_define ("_REENTRANT"); \ |
d711cf67 JDA |
66 | if (preprocessing_trad_p ()) \ |
67 | { \ | |
68 | builtin_define ("hp9000s800"); \ | |
69 | builtin_define ("hppa"); \ | |
70 | builtin_define ("hpux"); \ | |
71 | builtin_define ("unix"); \ | |
72 | builtin_define ("__CLASSIC_C__"); \ | |
73 | builtin_define ("_PWB"); \ | |
74 | builtin_define ("PWB"); \ | |
75 | } \ | |
08b5b29e JDA |
76 | if (flag_pa_unix >= 1995) \ |
77 | { \ | |
78 | builtin_define ("_XOPEN_UNIX"); \ | |
79 | builtin_define ("_XOPEN_SOURCE_EXTENDED"); \ | |
80 | } \ | |
d711cf67 JDA |
81 | } \ |
82 | if (TARGET_SIO) \ | |
83 | builtin_define ("_SIO"); \ | |
84 | else \ | |
85 | { \ | |
86 | builtin_define ("__hp9000s700"); \ | |
87 | builtin_define ("__hp9000s700__"); \ | |
88 | builtin_define ("_WSIO"); \ | |
89 | } \ | |
90 | } \ | |
c219e1da JDA |
91 | while (0) |
92 | ||
93 | #define CPP_SPEC "%{threads: -D_REENTRANT -D_DCE_THREADS}" | |
94 | ||
7fc5b331 | 95 | /* We can debug dynamically linked executables on hpux9; we also want |
956d6950 | 96 | dereferencing of a NULL pointer to cause a SEGV. */ |
7fc5b331 | 97 | #undef LINK_SPEC |
f48758e4 | 98 | #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11) |
7fc5b331 | 99 | #define LINK_SPEC \ |
8633c315 | 100 | "%{!mpa-risc-1-0:%{!march=1.0:%{static:-L/lib/pa1.1 -L/usr/lib/pa1.1 }}}\ |
f48758e4 | 101 | %{!shared:%{p:-L/lib/libp %{!static:\ |
d8a07487 | 102 | %nwarning: consider linking with '-static' as system libraries with\n\ |
f48758e4 JDA |
103 | %n profiling support are only provided in archive format}}}\ |
104 | %{!shared:%{pg:-L/lib/libp %{!static:\ | |
d8a07487 | 105 | %nwarning: consider linking with '-static' as system libraries with\n\ |
f48758e4 | 106 | %n profiling support are only provided in archive format}}}\ |
70d60e88 | 107 | %{!shared:%{!static:%{rdynamic:-E}}}\ |
f48758e4 JDA |
108 | -z %{mlinker-opt:-O} %{!shared:-u main}\ |
109 | %{static:-a archive} %{shared:-b}" | |
7fc5b331 JL |
110 | #else |
111 | #define LINK_SPEC \ | |
8633c315 | 112 | "%{!shared:%{p:-L/lib/libp %{!static:\ |
d8a07487 | 113 | %nwarning: consider linking with '-static' as system libraries with\n\ |
f48758e4 JDA |
114 | %n profiling support are only provided in archive format}}}\ |
115 | %{!shared:%{pg:-L/lib/libp %{!static:\ | |
d8a07487 | 116 | %nwarning: consider linking with '-static' as system libraries with\n\ |
f48758e4 | 117 | %n profiling support are only provided in archive format}}}\ |
70d60e88 | 118 | %{!shared:%{!static:%{rdynamic:-E}}}\ |
f48758e4 JDA |
119 | -z %{mlinker-opt:-O} %{!shared:-u main}\ |
120 | %{static:-a archive} %{shared:-b}" | |
7fc5b331 JL |
121 | #endif |
122 | ||
154bba13 TT |
123 | /* Like the default, except no -lg. */ |
124 | #undef LIB_SPEC | |
125 | #define LIB_SPEC \ | |
126 | "%{!shared:\ | |
7238ae53 | 127 | %{!p:%{!pg:\ |
f401d0f5 | 128 | %{!threads:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}\ |
5de27cca | 129 | %{threads:-lcma -lc}}}\ |
f48758e4 JDA |
130 | %{p:%{!pg:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\ |
131 | %{pg:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}" | |
154bba13 | 132 | |
5467baef JDA |
133 | #undef THREAD_MODEL_SPEC |
134 | #define THREAD_MODEL_SPEC "%{!threads:single}%{threads:dce}" | |
135 | ||
c28eb6c2 JL |
136 | /* Under hpux10, the normal location of the `ld' and `as' programs is the |
137 | /usr/ccs/bin directory. */ | |
138 | ||
2989d30c | 139 | #ifndef CROSS_DIRECTORY_STRUCTURE |
c28eb6c2 JL |
140 | #undef MD_EXEC_PREFIX |
141 | #define MD_EXEC_PREFIX "/usr/ccs/bin/" | |
142 | #endif | |
143 | ||
7238ae53 JL |
144 | /* Under hpux10, the normal location of the various *crt*.o files is |
145 | the /usr/ccs/lib directory. However, the profiling files are in | |
146 | /opt/langtools/lib. */ | |
c28eb6c2 | 147 | |
2989d30c | 148 | #ifndef CROSS_DIRECTORY_STRUCTURE |
c28eb6c2 JL |
149 | #undef MD_STARTFILE_PREFIX |
150 | #define MD_STARTFILE_PREFIX "/usr/ccs/lib/" | |
7238ae53 | 151 | #define MD_STARTFILE_PREFIX_1 "/opt/langtools/lib/" |
c28eb6c2 JL |
152 | #endif |
153 | ||
f45ebe47 JL |
154 | /* hpux10 has the new HP assembler. It's still lousy, but it's a whole lot |
155 | better than the assembler shipped with older versions of hpux. */ | |
8d913d99 AM |
156 | #undef NEW_HP_ASSEMBLER |
157 | #define NEW_HP_ASSEMBLER 1 |