]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/gcc/config/ia64/hpux.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / gcc / config / ia64 / hpux.h
1 /* Definitions of target machine GNU compiler.  IA-64 version.
2    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
3    Free Software Foundation, Inc.
4    Contributed by Steve Ellcey <sje@cup.hp.com> and
5                   Reva Cuthbertson <reva@cup.hp.com>
6
7 This file is part of GCC.
8
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 2, or (at your option)
12 any later version.
13
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.
18
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING.  If not, write to
21 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110-1301, USA.  */
23
24 /* This macro is a C statement to print on `stderr' a string describing the
25    particular machine description choice.  */
26
27 #define TARGET_VERSION fprintf (stderr, " (IA-64) HP-UX");
28
29 /* Enable HPUX ABI quirks.  */
30 #undef  TARGET_HPUX
31 #define TARGET_HPUX 1
32
33 #undef WCHAR_TYPE
34 #define WCHAR_TYPE "unsigned int"
35
36 #undef WCHAR_TYPE_SIZE
37 #define WCHAR_TYPE_SIZE 32
38
39 /* Target OS builtins.  */
40 #define TARGET_OS_CPP_BUILTINS()                        \
41 do {                                                    \
42         builtin_assert("system=hpux");                  \
43         builtin_assert("system=posix");                 \
44         builtin_assert("system=unix");                  \
45         builtin_define_std("hpux");                     \
46         builtin_define_std("unix");                     \
47         builtin_define("__IA64__");                     \
48         builtin_define("_LONGLONG");                    \
49         builtin_define("_INCLUDE_LONGLONG");            \
50         builtin_define("_UINT128_T");                   \
51         if (c_dialect_cxx () || !flag_iso)              \
52           {                                             \
53             builtin_define("_HPUX_SOURCE");             \
54             builtin_define("__STDC_EXT__");             \
55             builtin_define("__STDCPP__");               \
56             builtin_define("_INCLUDE__STDC_A1_SOURCE"); \
57           }                                             \
58         if (TARGET_ILP32)                               \
59           builtin_define("_ILP32");                     \
60 } while (0)
61
62 #undef CPP_SPEC
63 #define CPP_SPEC \
64   "%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}"
65 /* aCC defines also -DRWSTD_MULTI_THREAD, -DRW_MULTI_THREAD.  These
66    affect only aCC's C++ library (Rogue Wave-derived) which we do not
67    use, and they violate the user's name space.  */
68
69 #undef  ASM_EXTRA_SPEC
70 #define ASM_EXTRA_SPEC "%{milp32:-milp32} %{mlp64:-mlp64}"
71
72 #undef ENDFILE_SPEC
73
74 #undef STARTFILE_SPEC
75 #define STARTFILE_SPEC "%{!shared:%{static:crt0%O%s} \
76                           %{mlp64:/usr/lib/hpux64/unix98%O%s} \
77                           %{!mlp64:/usr/lib/hpux32/unix98%O%s}}"
78
79 #undef LINK_SPEC
80 #define LINK_SPEC \
81   "-z +Accept TypeMismatch \
82    %{shared:-b} \
83    %{!shared: \
84      -u main \
85      %{static:-noshared}}"
86
87 #undef  LIB_SPEC
88 #define LIB_SPEC \
89   "%{!shared: \
90      %{mt|pthread:-lpthread} \
91      %{p:%{!mlp64:-L/usr/lib/hpux32/libp} \
92          %{mlp64:-L/usr/lib/hpux64/libp} -lprof} \
93      %{pg:%{!mlp64:-L/usr/lib/hpux32/libp} \
94           %{mlp64:-L/usr/lib/hpux64/libp} -lgprof} \
95      %{!symbolic:-lc}}"
96
97 #define MULTILIB_DEFAULTS { "milp32" }
98
99 /* A C expression whose value is zero if pointers that need to be extended
100    from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and
101    greater then zero if they are zero-extended and less then zero if the
102    ptr_extend instruction should be used.  */
103
104 #define POINTERS_EXTEND_UNSIGNED -1
105
106 #define JMP_BUF_SIZE  (8 * 76)
107
108 #undef TARGET_DEFAULT
109 #define TARGET_DEFAULT \
110   (MASK_DWARF2_ASM | MASK_BIG_ENDIAN | MASK_ILP32)
111
112 /* ??? Might not be needed anymore.  */
113 #define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) ((MODE) == TFmode)
114
115 /* ASM_OUTPUT_EXTERNAL_LIBCALL defaults to just a globalize_label call,
116    but that doesn't put out the @function type information which causes
117    shared library problems.  */
118
119 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
120 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)                  \
121 do {                                                            \
122   (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0));     \
123   ASM_OUTPUT_TYPE_DIRECTIVE (FILE, XSTR (FUN, 0), "function");  \
124 } while (0)
125
126 #undef FUNCTION_ARG_PADDING
127 #define FUNCTION_ARG_PADDING(MODE, TYPE) \
128         ia64_hpux_function_arg_padding ((MODE), (TYPE))
129
130 #undef PAD_VARARGS_DOWN
131 #define PAD_VARARGS_DOWN (!AGGREGATE_TYPE_P (type))
132
133 #define REGISTER_TARGET_PRAGMAS() \
134   c_register_pragma (0, "builtin", ia64_hpux_handle_builtin_pragma)
135
136 /* Tell ia64.c that we are using the HP linker and we should delay output of
137    function extern declarations so that we don't output them for functions
138    which are never used (and may not be defined).  */
139
140 #undef TARGET_HPUX_LD
141 #define TARGET_HPUX_LD  1
142
143 /* The HPUX dynamic linker objects to weak symbols with no
144    definitions, so do not use them in gthr-posix.h.  */
145 #define GTHREAD_USE_WEAK 0
146
147 #undef CTORS_SECTION_ASM_OP
148 #define CTORS_SECTION_ASM_OP  "\t.section\t.init_array,\t\"aw\",\"init_array\""
149
150 #undef DTORS_SECTION_ASM_OP
151 #define DTORS_SECTION_ASM_OP  "\t.section\t.fini_array,\t\"aw\",\"fini_array\""
152
153 /* The init_array/fini_array technique does not permit the use of
154    initialization priorities.  */
155 #define SUPPORTS_INIT_PRIORITY 0
156
157 #undef READONLY_DATA_SECTION_ASM_OP
158 #define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata,\t\"a\",\t\"progbits\""
159
160 #undef DATA_SECTION_ASM_OP
161 #define DATA_SECTION_ASM_OP "\t.section\t.data,\t\"aw\",\t\"progbits\""
162
163 #undef SDATA_SECTION_ASM_OP
164 #define SDATA_SECTION_ASM_OP "\t.section\t.sdata,\t\"asw\",\t\"progbits\""
165
166 #undef BSS_SECTION_ASM_OP
167 #define BSS_SECTION_ASM_OP "\t.section\t.bss,\t\"aw\",\t\"nobits\""
168
169 #undef SBSS_SECTION_ASM_OP
170 #define SBSS_SECTION_ASM_OP "\t.section\t.sbss,\t\"asw\",\t\"nobits\""
171
172 #undef TEXT_SECTION_ASM_OP
173 #define TEXT_SECTION_ASM_OP "\t.section\t.text,\t\"ax\",\t\"progbits\""
174
175 /* It is illegal to have relocations in shared segments on HPUX.
176    Pretend flag_pic is always set.  */
177 #undef  TARGET_ASM_RELOC_RW_MASK
178 #define TARGET_ASM_RELOC_RW_MASK  ia64_hpux_reloc_rw_mask
179
180 /* ia64 HPUX has the float and long double forms of math functions.  */
181 #undef TARGET_C99_FUNCTIONS
182 #define TARGET_C99_FUNCTIONS  1
183
184 #undef TARGET_INIT_LIBFUNCS
185 #define TARGET_INIT_LIBFUNCS ia64_hpux_init_libfuncs
186
187 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode)
188
189 /* Put all *xf routines in libgcc, regardless of long double size.  */
190 #undef LIBGCC2_HAS_XF_MODE
191 #define LIBGCC2_HAS_XF_MODE 1
192 #define XF_SIZE 64
193
194 /* Put all *tf routines in libgcc, regardless of long double size.  */
195 #undef LIBGCC2_HAS_TF_MODE
196 #define LIBGCC2_HAS_TF_MODE 1
197 #define TF_SIZE 113
198
199 /* HP-UX headers are C++-compatible.  */
200 #define NO_IMPLICIT_EXTERN_C
201
202 /* HP-UX uses PROFILE_HOOK instead of FUNCTION_PROFILER but we need a
203    FUNCTION_PROFILER defined because its use is not ifdefed.  When using
204    PROFILE_HOOK, the profile call comes after the prologue.  */
205
206 #undef FUNCTION_PROFILER
207 #define FUNCTION_PROFILER(FILE, LABELNO) do { } while (0)
208
209 #undef PROFILE_HOOK
210 #define PROFILE_HOOK(LABEL) ia64_profile_hook (LABEL)
211
212 #undef  PROFILE_BEFORE_PROLOGUE
213
214 #undef NO_PROFILE_COUNTERS
215 #define NO_PROFILE_COUNTERS 0
216
217 #undef HANDLE_PRAGMA_PACK_PUSH_POP
218 #define HANDLE_PRAGMA_PACK_PUSH_POP