1 /* Definitions of target machine GNU compiler. IA-64 version.
2 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009, 2010,
3 2011 Free Software Foundation, Inc.
4 Contributed by Steve Ellcey <sje@cup.hp.com> and
5 Reva Cuthbertson <reva@cup.hp.com>
7 This file is part of GCC.
9 GCC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 GCC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING3. If not see
21 <http://www.gnu.org/licenses/>. */
23 /* Enable HPUX ABI quirks. */
28 #define WCHAR_TYPE "unsigned int"
30 #undef WCHAR_TYPE_SIZE
31 #define WCHAR_TYPE_SIZE 32
33 /* Target OS builtins. */
34 #define TARGET_OS_CPP_BUILTINS() \
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"); \
43 builtin_define("_INCLUDE_LONGLONG"); \
44 builtin_define("__STDC_EXT__"); \
45 builtin_define("_UINT128_T"); \
46 if (c_dialect_cxx () || !flag_iso) \
48 builtin_define("_HPUX_SOURCE"); \
49 builtin_define("__STDCPP__"); \
50 builtin_define("_INCLUDE__STDC_A1_SOURCE"); \
53 builtin_define("_ILP32"); \
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. */
64 #define ASM_EXTRA_SPEC "%{milp32:-milp32} %{mlp64:-mlp64}"
67 #define AS_NEEDS_DASH_FOR_PIPED_INPUT
70 #ifndef CROSS_DIRECTORY_STRUCTURE
72 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
74 #undef MD_STARTFILE_PREFIX
75 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
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}}"
87 "-z +Accept TypeMismatch \
96 %{mt|pthread:%{fopenmp:-lrt} -lpthread} \
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} \
103 #define MULTILIB_DEFAULTS { "milp32" }
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. */
110 #define POINTERS_EXTEND_UNSIGNED -1
112 #define JMP_BUF_SIZE (8 * 76)
114 #undef TARGET_DEFAULT
115 #define TARGET_DEFAULT \
116 (MASK_DWARF2_ASM | MASK_BIG_ENDIAN | MASK_ILP32)
118 /* ??? Might not be needed anymore. */
119 #define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) ((MODE) == TFmode)
121 /* ASM_OUTPUT_EXTERNAL_LIBCALL defaults to just a globalize_label call,
122 but that doesn't put out the @function type information which causes
123 shared library problems. */
125 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
126 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
128 (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
129 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, XSTR (FUN, 0), "function"); \
132 #undef FUNCTION_ARG_PADDING
133 #define FUNCTION_ARG_PADDING(MODE, TYPE) \
134 ia64_hpux_function_arg_padding ((MODE), (TYPE))
136 #undef PAD_VARARGS_DOWN
137 #define PAD_VARARGS_DOWN (!AGGREGATE_TYPE_P (type))
139 #define REGISTER_TARGET_PRAGMAS() \
140 c_register_pragma (0, "builtin", ia64_hpux_handle_builtin_pragma)
142 /* Tell ia64.c that we are using the HP linker and we should delay output of
143 function extern declarations so that we don't output them for functions
144 which are never used (and may not be defined). */
146 #undef TARGET_HPUX_LD
147 #define TARGET_HPUX_LD 1
149 /* The HPUX dynamic linker objects to weak symbols with no
150 definitions, so do not use them in gthr-posix.h. */
151 #define GTHREAD_USE_WEAK 0
153 #undef CTORS_SECTION_ASM_OP
154 #define CTORS_SECTION_ASM_OP "\t.section\t.init_array,\t\"aw\",\"init_array\""
156 #undef DTORS_SECTION_ASM_OP
157 #define DTORS_SECTION_ASM_OP "\t.section\t.fini_array,\t\"aw\",\"fini_array\""
159 /* The init_array/fini_array technique does not permit the use of
160 initialization priorities. */
161 #define SUPPORTS_INIT_PRIORITY 0
163 #undef READONLY_DATA_SECTION_ASM_OP
164 #define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata,\t\"a\",\t\"progbits\""
166 #undef DATA_SECTION_ASM_OP
167 #define DATA_SECTION_ASM_OP "\t.section\t.data,\t\"aw\",\t\"progbits\""
169 #undef SDATA_SECTION_ASM_OP
170 #define SDATA_SECTION_ASM_OP "\t.section\t.sdata,\t\"asw\",\t\"progbits\""
172 #undef BSS_SECTION_ASM_OP
173 #define BSS_SECTION_ASM_OP "\t.section\t.bss,\t\"aw\",\t\"nobits\""
175 #undef SBSS_SECTION_ASM_OP
176 #define SBSS_SECTION_ASM_OP "\t.section\t.sbss,\t\"asw\",\t\"nobits\""
178 #undef TEXT_SECTION_ASM_OP
179 #define TEXT_SECTION_ASM_OP "\t.section\t.text,\t\"ax\",\t\"progbits\""
181 /* It is illegal to have relocations in shared segments on HPUX.
182 Pretend flag_pic is always set. */
183 #undef TARGET_ASM_RELOC_RW_MASK
184 #define TARGET_ASM_RELOC_RW_MASK ia64_hpux_reloc_rw_mask
186 /* ia64 HPUX has the float and long double forms of math functions. */
187 #undef TARGET_C99_FUNCTIONS
188 #define TARGET_C99_FUNCTIONS 1
190 #undef TARGET_INIT_LIBFUNCS
191 #define TARGET_INIT_LIBFUNCS ia64_hpux_init_libfuncs
193 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode)
195 /* Put all *xf routines in libgcc, regardless of long double size. */
196 #undef LIBGCC2_HAS_XF_MODE
197 #define LIBGCC2_HAS_XF_MODE 1
200 /* Put all *tf routines in libgcc, regardless of long double size. */
201 #undef LIBGCC2_HAS_TF_MODE
202 #define LIBGCC2_HAS_TF_MODE 1
205 /* HP-UX headers are C++-compatible. */
206 #define NO_IMPLICIT_EXTERN_C
208 /* HP-UX uses PROFILE_HOOK instead of FUNCTION_PROFILER but we need a
209 FUNCTION_PROFILER defined because its use is not ifdefed. When using
210 PROFILE_HOOK, the profile call comes after the prologue. */
212 #undef FUNCTION_PROFILER
213 #define FUNCTION_PROFILER(FILE, LABELNO) do { } while (0)
216 #define PROFILE_HOOK(LABEL) ia64_profile_hook (LABEL)
218 #undef PROFILE_BEFORE_PROLOGUE
220 #undef NO_PROFILE_COUNTERS
221 #define NO_PROFILE_COUNTERS 0
223 /* The HP-UX linker has a bug that causes calls from functions in
224 .text.unlikely to functions in .text to cause a segfault. Until
225 it is fixed, prevent code from being put into .text.unlikely or
228 #define TARGET_ASM_FUNCTION_SECTION ia64_hpux_function_section
230 #define TARGET_POSIX_IO