]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/ia64/hpux.h
Update Copyright years for files modified in 2011 and/or 2012.
[thirdparty/gcc.git] / gcc / config / ia64 / hpux.h
CommitLineData
d838d791 1/* Definitions of target machine GNU compiler. IA-64 version.
a19f368c 2 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009, 2010,
71e45bc2 3 2011, 2012 Free Software Foundation, Inc.
d838d791 4 Contributed by Steve Ellcey <sje@cup.hp.com> and
5 Reva Cuthbertson <reva@cup.hp.com>
6
73f45a5c 7This file is part of GCC.
d838d791 8
73f45a5c 9GCC is free software; you can redistribute it and/or modify
d838d791 10it under the terms of the GNU General Public License as published by
038d1e19 11the Free Software Foundation; either version 3, or (at your option)
d838d791 12any later version.
13
73f45a5c 14GCC is distributed in the hope that it will be useful,
d838d791 15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
038d1e19 20along with GCC; see the file COPYING3. If not see
21<http://www.gnu.org/licenses/>. */
d838d791 22
b8bc42e9 23/* Enable HPUX ABI quirks. */
24#undef TARGET_HPUX
25#define TARGET_HPUX 1
26
a11d44c6 27#undef WCHAR_TYPE
28#define WCHAR_TYPE "unsigned int"
29
30#undef WCHAR_TYPE_SIZE
31#define WCHAR_TYPE_SIZE 32
32
80e426a6 33/* Target OS builtins. */
80e426a6 34#define TARGET_OS_CPP_BUILTINS() \
35do { \
36 builtin_assert("system=hpux"); \
37 builtin_assert("system=posix"); \
38 builtin_assert("system=unix"); \
39 builtin_define_std("hpux"); \
40 builtin_define_std("unix"); \
41 builtin_define("__IA64__"); \
42 builtin_define("_LONGLONG"); \
21eae472 43 builtin_define("_INCLUDE_LONGLONG"); \
43cb9222 44 builtin_define("__STDC_EXT__"); \
80e426a6 45 builtin_define("_UINT128_T"); \
71c97472 46 if (c_dialect_cxx () || !flag_iso) \
80e426a6 47 { \
48 builtin_define("_HPUX_SOURCE"); \
6942761b 49 builtin_define("__STDCPP__"); \
2fa6c4e5 50 builtin_define("_INCLUDE__STDC_A1_SOURCE"); \
80e426a6 51 } \
5c777a00 52 if (TARGET_ILP32) \
53 builtin_define("_ILP32"); \
80e426a6 54} while (0)
d838d791 55
120a2fed 56#undef CPP_SPEC
57#define CPP_SPEC \
58 "%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}"
59/* aCC defines also -DRWSTD_MULTI_THREAD, -DRW_MULTI_THREAD. These
60 affect only aCC's C++ library (Rogue Wave-derived) which we do not
61 use, and they violate the user's name space. */
62
463e830e 63#undef ASM_EXTRA_SPEC
64#define ASM_EXTRA_SPEC "%{milp32:-milp32} %{mlp64:-mlp64}"
d838d791 65
622e35a9 66#ifndef USE_GAS
67#define AS_NEEDS_DASH_FOR_PIPED_INPUT
68#endif
69
780f79dc 70#ifndef CROSS_DIRECTORY_STRUCTURE
71#undef MD_EXEC_PREFIX
72#define MD_EXEC_PREFIX "/usr/ccs/bin/"
73
74#undef MD_STARTFILE_PREFIX
75#define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
76#endif
77
d838d791 78#undef ENDFILE_SPEC
79
80#undef STARTFILE_SPEC
2fa6c4e5 81#define STARTFILE_SPEC "%{!shared:%{static:crt0%O%s} \
82 %{mlp64:/usr/lib/hpux64/unix98%O%s} \
83 %{!mlp64:/usr/lib/hpux32/unix98%O%s}}"
cfea3820 84
d838d791 85#undef LINK_SPEC
cfea3820 86#define LINK_SPEC \
489fc1bc 87 "-z +Accept TypeMismatch \
cfea3820 88 %{shared:-b} \
89 %{!shared: \
90 -u main \
91 %{static:-noshared}}"
d838d791 92
93#undef LIB_SPEC
cfea3820 94#define LIB_SPEC \
95 "%{!shared: \
202cd5ca 96 %{mt|pthread:%{fopenmp:-lrt} -lpthread} \
cfea3820 97 %{p:%{!mlp64:-L/usr/lib/hpux32/libp} \
98 %{mlp64:-L/usr/lib/hpux64/libp} -lprof} \
99 %{pg:%{!mlp64:-L/usr/lib/hpux32/libp} \
100 %{mlp64:-L/usr/lib/hpux64/libp} -lgprof} \
101 %{!symbolic:-lc}}"
102
063c2715 103#define MULTILIB_DEFAULTS { "milp32" }
104
3cc092f7 105/* A C expression whose value is zero if pointers that need to be extended
106 from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and
107 greater then zero if they are zero-extended and less then zero if the
108 ptr_extend instruction should be used. */
109
110#define POINTERS_EXTEND_UNSIGNED -1
111
d838d791 112#define JMP_BUF_SIZE (8 * 76)
113
d838d791 114#undef TARGET_DEFAULT
c1cc6575 115#define TARGET_DEFAULT \
dd7870fa 116 (MASK_DWARF2_ASM | MASK_BIG_ENDIAN | MASK_ILP32)
23551094 117
b44dc256 118/* ASM_OUTPUT_EXTERNAL_LIBCALL defaults to just a globalize_label call,
119 but that doesn't put out the @function type information which causes
120 shared library problems. */
121
122#undef ASM_OUTPUT_EXTERNAL_LIBCALL
123#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
124do { \
125 (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
126 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, XSTR (FUN, 0), "function"); \
127} while (0)
128
23551094 129#undef FUNCTION_ARG_PADDING
130#define FUNCTION_ARG_PADDING(MODE, TYPE) \
131 ia64_hpux_function_arg_padding ((MODE), (TYPE))
132
133#undef PAD_VARARGS_DOWN
134#define PAD_VARARGS_DOWN (!AGGREGATE_TYPE_P (type))
23ebf0fe 135
eb180587 136#define REGISTER_TARGET_PRAGMAS() \
137 c_register_pragma (0, "builtin", ia64_hpux_handle_builtin_pragma)
d7b7c754 138
139/* Tell ia64.c that we are using the HP linker and we should delay output of
140 function extern declarations so that we don't output them for functions
141 which are never used (and may not be defined). */
142
143#undef TARGET_HPUX_LD
144#define TARGET_HPUX_LD 1
145
120a2fed 146/* The HPUX dynamic linker objects to weak symbols with no
147 definitions, so do not use them in gthr-posix.h. */
148#define GTHREAD_USE_WEAK 0
149
8e7fb219 150#undef CTORS_SECTION_ASM_OP
151#define CTORS_SECTION_ASM_OP "\t.section\t.init_array,\t\"aw\",\"init_array\""
152
153#undef DTORS_SECTION_ASM_OP
154#define DTORS_SECTION_ASM_OP "\t.section\t.fini_array,\t\"aw\",\"fini_array\""
155
2ab59802 156/* The init_array/fini_array technique does not permit the use of
157 initialization priorities. */
158#define SUPPORTS_INIT_PRIORITY 0
159
8e7fb219 160#undef READONLY_DATA_SECTION_ASM_OP
161#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata,\t\"a\",\t\"progbits\""
162
163#undef DATA_SECTION_ASM_OP
164#define DATA_SECTION_ASM_OP "\t.section\t.data,\t\"aw\",\t\"progbits\""
165
166#undef SDATA_SECTION_ASM_OP
167#define SDATA_SECTION_ASM_OP "\t.section\t.sdata,\t\"asw\",\t\"progbits\""
168
169#undef BSS_SECTION_ASM_OP
170#define BSS_SECTION_ASM_OP "\t.section\t.bss,\t\"aw\",\t\"nobits\""
171
172#undef SBSS_SECTION_ASM_OP
173#define SBSS_SECTION_ASM_OP "\t.section\t.sbss,\t\"asw\",\t\"nobits\""
174
175#undef TEXT_SECTION_ASM_OP
176#define TEXT_SECTION_ASM_OP "\t.section\t.text,\t\"ax\",\t\"progbits\""
4004adf0 177
178/* It is illegal to have relocations in shared segments on HPUX.
179 Pretend flag_pic is always set. */
4e151b05 180#undef TARGET_ASM_RELOC_RW_MASK
181#define TARGET_ASM_RELOC_RW_MASK ia64_hpux_reloc_rw_mask
63d3e737 182
183/* ia64 HPUX has the float and long double forms of math functions. */
184#undef TARGET_C99_FUNCTIONS
185#define TARGET_C99_FUNCTIONS 1
186
ea5219c2 187#undef TARGET_INIT_LIBFUNCS
f2f543a3 188#define TARGET_INIT_LIBFUNCS ia64_hpux_init_libfuncs
189
190#define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode)
30d98e61 191
192/* Put all *xf routines in libgcc, regardless of long double size. */
193#undef LIBGCC2_HAS_XF_MODE
194#define LIBGCC2_HAS_XF_MODE 1
3212edfa 195#define XF_SIZE 64
30d98e61 196
197/* Put all *tf routines in libgcc, regardless of long double size. */
198#undef LIBGCC2_HAS_TF_MODE
199#define LIBGCC2_HAS_TF_MODE 1
3212edfa 200#define TF_SIZE 113
8c23b8da 201
202/* HP-UX headers are C++-compatible. */
203#define NO_IMPLICIT_EXTERN_C
f0ae8b21 204
205/* HP-UX uses PROFILE_HOOK instead of FUNCTION_PROFILER but we need a
206 FUNCTION_PROFILER defined because its use is not ifdefed. When using
207 PROFILE_HOOK, the profile call comes after the prologue. */
208
209#undef FUNCTION_PROFILER
210#define FUNCTION_PROFILER(FILE, LABELNO) do { } while (0)
211
212#undef PROFILE_HOOK
213#define PROFILE_HOOK(LABEL) ia64_profile_hook (LABEL)
214
215#undef PROFILE_BEFORE_PROLOGUE
216
217#undef NO_PROFILE_COUNTERS
218#define NO_PROFILE_COUNTERS 0
066cf272 219
7fa16a61 220/* The HP-UX linker has a bug that causes calls from functions in
221 .text.unlikely to functions in .text to cause a segfault. Until
222 it is fixed, prevent code from being put into .text.unlikely or
223 .text.hot. */
224
3b73548b 225#define TARGET_ASM_FUNCTION_SECTION ia64_hpux_function_section
44dcfcab 226
227#define TARGET_POSIX_IO
28d5c3d9 228
229/* Define this to be nonzero if static stack checking is supported. */
230#define STACK_CHECK_STATIC_BUILTIN 1
231
232/* Minimum amount of stack required to recover from an anticipated stack
233 overflow detection. */
234#define STACK_CHECK_PROTECT (24 * 1024)