OSDN Git Service

* config/ia64/linux.h (IA64_GATE_AREA_END): Increase by 64K.
[pf3gnuchains/gcc-fork.git] / gcc / config / ia64 / hpux.h
1 /* Definitions of target machine GNU compiler.  IA-64 version.
2    Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
3    Contributed by Steve Ellcey <sje@cup.hp.com> and
4                   Reva Cuthbertson <reva@cup.hp.com>
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 GCC is distributed in the hope that it will be useful,
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
19 along with GCC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.  */
22
23 /* This macro is a C statement to print on `stderr' a string describing the
24    particular machine description choice.  */
25
26 #define TARGET_VERSION fprintf (stderr, " (IA-64) HP-UX");
27
28 /* Enable HPUX ABI quirks.  */
29 #undef  TARGET_HPUX
30 #define TARGET_HPUX 1
31
32 /* Target OS builtins.  */
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");                    \
42         builtin_define("_UINT128_T");                   \
43         if (c_dialect_cxx () || !flag_iso)              \
44           {                                             \
45             builtin_define("_HPUX_SOURCE");             \
46             builtin_define("__STDC_EXT__");             \
47           }                                             \
48 } while (0)
49
50 #undef CPP_SPEC
51 #define CPP_SPEC \
52   "%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}"
53 /* aCC defines also -DRWSTD_MULTI_THREAD, -DRW_MULTI_THREAD.  These
54    affect only aCC's C++ library (Rogue Wave-derived) which we do not
55    use, and they violate the user's name space.  */
56
57 #undef  ASM_EXTRA_SPEC
58 #define ASM_EXTRA_SPEC "%{milp32:-milp32} %{mlp64:-mlp64}"
59
60 #undef ENDFILE_SPEC
61
62 #undef STARTFILE_SPEC
63 #define STARTFILE_SPEC "%{!shared:%{static:crt0%O%s}}"
64
65 #undef LINK_SPEC
66 #define LINK_SPEC \
67   "+Accept TypeMismatch \
68    %{shared:-b} \
69    %{!shared: \
70      -u main \
71      %{static:-noshared}}"
72
73 #undef  LIB_SPEC
74 #define LIB_SPEC \
75   "%{!shared: \
76      %{mt|pthread:-lpthread} \
77      %{p:%{!mlp64:-L/usr/lib/hpux32/libp} \
78          %{mlp64:-L/usr/lib/hpux64/libp} -lprof} \
79      %{pg:%{!mlp64:-L/usr/lib/hpux32/libp} \
80           %{mlp64:-L/usr/lib/hpux64/libp} -lgprof} \
81      %{!symbolic:-lc}}"
82
83 #ifndef CROSS_COMPILE
84 #undef LIBGCC_SPEC
85 #define LIBGCC_SPEC \
86   "%{shared-libgcc:%{!mlp64:-lgcc_s_hpux32}%{mlp64:-lgcc_s_hpux64} -lgcc} \
87    %{!shared-libgcc:-lgcc}"
88 #endif
89
90 #undef SUBTARGET_SWITCHES
91 #define SUBTARGET_SWITCHES \
92   { "ilp32",    MASK_ILP32,     "Generate ILP32 code" }, \
93   { "lp64",    -MASK_ILP32,     "Generate LP64 code" },
94
95 /* A C expression whose value is zero if pointers that need to be extended
96    from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and
97    greater then zero if they are zero-extended and less then zero if the
98    ptr_extend instruction should be used.  */
99
100 #define POINTERS_EXTEND_UNSIGNED -1
101
102 #define JMP_BUF_SIZE  (8 * 76)
103
104 #undef TARGET_DEFAULT
105 #define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_BIG_ENDIAN | MASK_ILP32)
106
107 /* This needs to be set to force structure arguments with a single
108    field to be treated as structures and not as the type of their
109    field.  Without this a structure with a single char will be
110    returned just like a char variable and that is wrong on HP-UX
111    IA64.  */
112
113 #define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) \
114   (TREE_CODE (TREE_TYPE (FIELD)) != REAL_TYPE || MODE == TFmode)
115
116 /* ASM_OUTPUT_EXTERNAL_LIBCALL defaults to just a globalize_label call,
117    but that doesn't put out the @function type information which causes
118    shared library problems.  */
119
120 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
121 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)                  \
122 do {                                                            \
123   (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0));     \
124   ASM_OUTPUT_TYPE_DIRECTIVE (FILE, XSTR (FUN, 0), "function");  \
125 } while (0)
126
127 #undef FUNCTION_ARG_PADDING
128 #define FUNCTION_ARG_PADDING(MODE, TYPE) \
129         ia64_hpux_function_arg_padding ((MODE), (TYPE))
130
131 #undef PAD_VARARGS_DOWN
132 #define PAD_VARARGS_DOWN (!AGGREGATE_TYPE_P (type))
133
134 #define REGISTER_TARGET_PRAGMAS() \
135   c_register_pragma (0, "builtin", ia64_hpux_handle_builtin_pragma)
136
137 /* Tell ia64.c that we are using the HP linker and we should delay output of
138    function extern declarations so that we don't output them for functions
139    which are never used (and may not be defined).  */
140
141 #undef TARGET_HPUX_LD
142 #define TARGET_HPUX_LD  1
143
144 /* The HPUX dynamic linker objects to weak symbols with no
145    definitions, so do not use them in gthr-posix.h.  */
146 #define GTHREAD_USE_WEAK 0
147
148 /* Put out the needed function declarations at the end.  */
149
150 #define TARGET_ASM_FILE_END ia64_hpux_file_end
151
152 #undef CTORS_SECTION_ASM_OP
153 #define CTORS_SECTION_ASM_OP  "\t.section\t.init_array,\t\"aw\",\"init_array\""
154
155 #undef DTORS_SECTION_ASM_OP
156 #define DTORS_SECTION_ASM_OP  "\t.section\t.fini_array,\t\"aw\",\"fini_array\""
157
158 /* The init_array/fini_array technique does not permit the use of
159    initialization priorities.  */
160 #define SUPPORTS_INIT_PRIORITY 0
161
162 #undef READONLY_DATA_SECTION_ASM_OP
163 #define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata,\t\"a\",\t\"progbits\""
164
165 #undef DATA_SECTION_ASM_OP
166 #define DATA_SECTION_ASM_OP "\t.section\t.data,\t\"aw\",\t\"progbits\""
167
168 #undef SDATA_SECTION_ASM_OP
169 #define SDATA_SECTION_ASM_OP "\t.section\t.sdata,\t\"asw\",\t\"progbits\""
170
171 #undef BSS_SECTION_ASM_OP
172 #define BSS_SECTION_ASM_OP "\t.section\t.bss,\t\"aw\",\t\"nobits\""
173
174 #undef SBSS_SECTION_ASM_OP
175 #define SBSS_SECTION_ASM_OP "\t.section\t.sbss,\t\"asw\",\t\"nobits\""
176
177 #undef TEXT_SECTION_ASM_OP
178 #define TEXT_SECTION_ASM_OP "\t.section\t.text,\t\"ax\",\t\"progbits\""
179
180 /* It is illegal to have relocations in shared segments on HPUX.
181    Pretend flag_pic is always set.  */
182 #undef  TARGET_ASM_SELECT_SECTION
183 #define TARGET_ASM_SELECT_SECTION  ia64_rwreloc_select_section
184 #undef  TARGET_ASM_UNIQUE_SECTION
185 #define TARGET_ASM_UNIQUE_SECTION  ia64_rwreloc_unique_section
186 #undef  TARGET_ASM_SELECT_RTX_SECTION
187 #define TARGET_ASM_SELECT_RTX_SECTION  ia64_rwreloc_select_rtx_section
188 #undef  TARGET_SECTION_TYPE_FLAGS
189 #define TARGET_SECTION_TYPE_FLAGS  ia64_rwreloc_section_type_flags
190
191 /* HP-UX does not support thread-local storage.  */
192 #undef TARGET_HAVE_TLS
193 #define TARGET_HAVE_TLS false
194
195 /* ia64 HPUX has the float and long double forms of math functions.  */
196 #undef TARGET_C99_FUNCTIONS
197 #define TARGET_C99_FUNCTIONS  1
198
199 #define TARGET_INIT_LIBFUNCS ia64_hpux_init_libfuncs
200
201 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode)