]>
Commit | Line | Data |
---|---|---|
7e5b9908 | 1 | /* Definitions of target machine GNU compiler. IA-64 version. |
8d9254fc | 2 | Copyright (C) 1999-2020 Free Software Foundation, Inc. |
7e5b9908 SE |
3 | Contributed by Steve Ellcey <sje@cup.hp.com> and |
4 | Reva Cuthbertson <reva@cup.hp.com> | |
5 | ||
3bed2930 | 6 | This file is part of GCC. |
7e5b9908 | 7 | |
3bed2930 | 8 | GCC is free software; you can redistribute it and/or modify |
7e5b9908 | 9 | it under the terms of the GNU General Public License as published by |
2f83c7d6 | 10 | the Free Software Foundation; either version 3, or (at your option) |
7e5b9908 SE |
11 | any later version. |
12 | ||
3bed2930 | 13 | GCC is distributed in the hope that it will be useful, |
7e5b9908 SE |
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 | |
2f83c7d6 NC |
19 | along with GCC; see the file COPYING3. If not see |
20 | <http://www.gnu.org/licenses/>. */ | |
7e5b9908 | 21 | |
02befdf4 ZW |
22 | /* Enable HPUX ABI quirks. */ |
23 | #undef TARGET_HPUX | |
24 | #define TARGET_HPUX 1 | |
25 | ||
70406574 JM |
26 | #undef WCHAR_TYPE |
27 | #define WCHAR_TYPE "unsigned int" | |
28 | ||
29 | #undef WCHAR_TYPE_SIZE | |
30 | #define WCHAR_TYPE_SIZE 32 | |
31 | ||
57016b47 | 32 | /* Target OS builtins. */ |
57016b47 SE |
33 | #define TARGET_OS_CPP_BUILTINS() \ |
34 | do { \ | |
35 | builtin_assert("system=hpux"); \ | |
36 | builtin_assert("system=posix"); \ | |
37 | builtin_assert("system=unix"); \ | |
38 | builtin_define_std("hpux"); \ | |
39 | builtin_define_std("unix"); \ | |
40 | builtin_define("__IA64__"); \ | |
41 | builtin_define("_LONGLONG"); \ | |
a5a8386f | 42 | builtin_define("_INCLUDE_LONGLONG"); \ |
9a17c91d | 43 | builtin_define("__STDC_EXT__"); \ |
57016b47 | 44 | builtin_define("_UINT128_T"); \ |
04df6730 | 45 | if (c_dialect_cxx () || !flag_iso) \ |
57016b47 SE |
46 | { \ |
47 | builtin_define("_HPUX_SOURCE"); \ | |
7dd7fb88 | 48 | builtin_define("__STDCPP__"); \ |
6db63df9 | 49 | builtin_define("_INCLUDE__STDC_A1_SOURCE"); \ |
57016b47 | 50 | } \ |
24b7a8c9 RS |
51 | if (TARGET_ILP32) \ |
52 | builtin_define("_ILP32"); \ | |
57016b47 | 53 | } while (0) |
7e5b9908 | 54 | |
7e2055ec ZW |
55 | #undef CPP_SPEC |
56 | #define CPP_SPEC \ | |
57 | "%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}" | |
58 | /* aCC defines also -DRWSTD_MULTI_THREAD, -DRW_MULTI_THREAD. These | |
59 | affect only aCC's C++ library (Rogue Wave-derived) which we do not | |
60 | use, and they violate the user's name space. */ | |
61 | ||
5b8fcab6 DB |
62 | #undef ASM_EXTRA_SPEC |
63 | #define ASM_EXTRA_SPEC "%{milp32:-milp32} %{mlp64:-mlp64}" | |
7e5b9908 | 64 | |
b8f9bca0 JM |
65 | #ifndef USE_GAS |
66 | #define AS_NEEDS_DASH_FOR_PIPED_INPUT | |
67 | #endif | |
68 | ||
72b7f7ea JM |
69 | #ifndef CROSS_DIRECTORY_STRUCTURE |
70 | #undef MD_EXEC_PREFIX | |
71 | #define MD_EXEC_PREFIX "/usr/ccs/bin/" | |
72 | ||
73 | #undef MD_STARTFILE_PREFIX | |
74 | #define MD_STARTFILE_PREFIX "/usr/ccs/lib/" | |
75 | #endif | |
76 | ||
7e5b9908 SE |
77 | #undef ENDFILE_SPEC |
78 | ||
79 | #undef STARTFILE_SPEC | |
6db63df9 SE |
80 | #define STARTFILE_SPEC "%{!shared:%{static:crt0%O%s} \ |
81 | %{mlp64:/usr/lib/hpux64/unix98%O%s} \ | |
82 | %{!mlp64:/usr/lib/hpux32/unix98%O%s}}" | |
40ad65d0 | 83 | |
7e5b9908 | 84 | #undef LINK_SPEC |
40ad65d0 | 85 | #define LINK_SPEC \ |
543144ed | 86 | "-z +Accept TypeMismatch \ |
40ad65d0 SE |
87 | %{shared:-b} \ |
88 | %{!shared: \ | |
89 | -u main \ | |
90 | %{static:-noshared}}" | |
7e5b9908 SE |
91 | |
92 | #undef LIB_SPEC | |
40ad65d0 SE |
93 | #define LIB_SPEC \ |
94 | "%{!shared: \ | |
9dbe3d77 | 95 | %{mt|pthread:%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):-lrt} -lpthread} \ |
40ad65d0 SE |
96 | %{p:%{!mlp64:-L/usr/lib/hpux32/libp} \ |
97 | %{mlp64:-L/usr/lib/hpux64/libp} -lprof} \ | |
98 | %{pg:%{!mlp64:-L/usr/lib/hpux32/libp} \ | |
99 | %{mlp64:-L/usr/lib/hpux64/libp} -lgprof} \ | |
100 | %{!symbolic:-lc}}" | |
101 | ||
e373cdb4 ZW |
102 | #define MULTILIB_DEFAULTS { "milp32" } |
103 | ||
6dd12198 SE |
104 | /* A C expression whose value is zero if pointers that need to be extended |
105 | from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and | |
106 | greater then zero if they are zero-extended and less then zero if the | |
107 | ptr_extend instruction should be used. */ | |
108 | ||
109 | #define POINTERS_EXTEND_UNSIGNED -1 | |
110 | ||
7e5b9908 SE |
111 | #define JMP_BUF_SIZE (8 * 76) |
112 | ||
7e5b9908 | 113 | #undef TARGET_DEFAULT |
b6b979d4 | 114 | #define TARGET_DEFAULT \ |
f19f1e5e | 115 | (MASK_DWARF2_ASM | MASK_BIG_ENDIAN | MASK_ILP32) |
0d7839da | 116 | |
68bb91b1 SE |
117 | /* ASM_OUTPUT_EXTERNAL_LIBCALL defaults to just a globalize_label call, |
118 | but that doesn't put out the @function type information which causes | |
119 | shared library problems. */ | |
120 | ||
121 | #undef ASM_OUTPUT_EXTERNAL_LIBCALL | |
122 | #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ | |
123 | do { \ | |
124 | (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \ | |
125 | ASM_OUTPUT_TYPE_DIRECTIVE (FILE, XSTR (FUN, 0), "function"); \ | |
126 | } while (0) | |
127 | ||
0d7839da SE |
128 | #undef PAD_VARARGS_DOWN |
129 | #define PAD_VARARGS_DOWN (!AGGREGATE_TYPE_P (type)) | |
34c1864f | 130 | |
c58b209a NB |
131 | #define REGISTER_TARGET_PRAGMAS() \ |
132 | c_register_pragma (0, "builtin", ia64_hpux_handle_builtin_pragma) | |
686f3bf0 SE |
133 | |
134 | /* Tell ia64.c that we are using the HP linker and we should delay output of | |
135 | function extern declarations so that we don't output them for functions | |
136 | which are never used (and may not be defined). */ | |
137 | ||
138 | #undef TARGET_HPUX_LD | |
139 | #define TARGET_HPUX_LD 1 | |
140 | ||
7e2055ec ZW |
141 | /* The HPUX dynamic linker objects to weak symbols with no |
142 | definitions, so do not use them in gthr-posix.h. */ | |
143 | #define GTHREAD_USE_WEAK 0 | |
144 | ||
b64ddb88 SE |
145 | #undef CTORS_SECTION_ASM_OP |
146 | #define CTORS_SECTION_ASM_OP "\t.section\t.init_array,\t\"aw\",\"init_array\"" | |
147 | ||
148 | #undef DTORS_SECTION_ASM_OP | |
149 | #define DTORS_SECTION_ASM_OP "\t.section\t.fini_array,\t\"aw\",\"fini_array\"" | |
150 | ||
74487c57 MM |
151 | /* The init_array/fini_array technique does not permit the use of |
152 | initialization priorities. */ | |
153 | #define SUPPORTS_INIT_PRIORITY 0 | |
154 | ||
b64ddb88 SE |
155 | #undef READONLY_DATA_SECTION_ASM_OP |
156 | #define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata,\t\"a\",\t\"progbits\"" | |
157 | ||
158 | #undef DATA_SECTION_ASM_OP | |
159 | #define DATA_SECTION_ASM_OP "\t.section\t.data,\t\"aw\",\t\"progbits\"" | |
160 | ||
161 | #undef SDATA_SECTION_ASM_OP | |
162 | #define SDATA_SECTION_ASM_OP "\t.section\t.sdata,\t\"asw\",\t\"progbits\"" | |
163 | ||
164 | #undef BSS_SECTION_ASM_OP | |
165 | #define BSS_SECTION_ASM_OP "\t.section\t.bss,\t\"aw\",\t\"nobits\"" | |
166 | ||
167 | #undef SBSS_SECTION_ASM_OP | |
168 | #define SBSS_SECTION_ASM_OP "\t.section\t.sbss,\t\"asw\",\t\"nobits\"" | |
169 | ||
170 | #undef TEXT_SECTION_ASM_OP | |
171 | #define TEXT_SECTION_ASM_OP "\t.section\t.text,\t\"ax\",\t\"progbits\"" | |
6ca86a1a RH |
172 | |
173 | /* It is illegal to have relocations in shared segments on HPUX. | |
174 | Pretend flag_pic is always set. */ | |
9b580a0b RH |
175 | #undef TARGET_ASM_RELOC_RW_MASK |
176 | #define TARGET_ASM_RELOC_RW_MASK ia64_hpux_reloc_rw_mask | |
9959901c | 177 | |
d33d9e47 AI |
178 | /* ia64 HPUX has the float and long double forms of math functions. |
179 | We redefine this hook so the version from elfos.h header won't be used. */ | |
180 | #undef TARGET_LIBC_HAS_FUNCTION | |
199299e8 | 181 | #define TARGET_LIBC_HAS_FUNCTION default_libc_has_function |
9959901c | 182 | |
1f7aa7cd | 183 | #undef TARGET_INIT_LIBFUNCS |
c15c90bb ZW |
184 | #define TARGET_INIT_LIBFUNCS ia64_hpux_init_libfuncs |
185 | ||
186 | #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode) | |
4e9db8b2 | 187 | |
d26afa4f SE |
188 | /* HP-UX uses PROFILE_HOOK instead of FUNCTION_PROFILER but we need a |
189 | FUNCTION_PROFILER defined because its use is not ifdefed. When using | |
190 | PROFILE_HOOK, the profile call comes after the prologue. */ | |
191 | ||
192 | #undef FUNCTION_PROFILER | |
193 | #define FUNCTION_PROFILER(FILE, LABELNO) do { } while (0) | |
194 | ||
195 | #undef PROFILE_HOOK | |
196 | #define PROFILE_HOOK(LABEL) ia64_profile_hook (LABEL) | |
197 | ||
198 | #undef PROFILE_BEFORE_PROLOGUE | |
199 | ||
200 | #undef NO_PROFILE_COUNTERS | |
201 | #define NO_PROFILE_COUNTERS 0 | |
7ee51a34 | 202 | |
1cc2d70b SE |
203 | /* The HP-UX linker has a bug that causes calls from functions in |
204 | .text.unlikely to functions in .text to cause a segfault. Until | |
205 | it is fixed, prevent code from being put into .text.unlikely or | |
206 | .text.hot. */ | |
207 | ||
f16d3f39 | 208 | #define TARGET_ASM_FUNCTION_SECTION ia64_hpux_function_section |
9c0c4ec7 JM |
209 | |
210 | #define TARGET_POSIX_IO | |
7b84aac0 EB |
211 | |
212 | /* Define this to be nonzero if static stack checking is supported. */ | |
213 | #define STACK_CHECK_STATIC_BUILTIN 1 | |
214 | ||
215 | /* Minimum amount of stack required to recover from an anticipated stack | |
216 | overflow detection. */ | |
217 | #define STACK_CHECK_PROTECT (24 * 1024) |