OSDN Git Service

* config/ia64/fde-glibc.c: Fix comment typos.
[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 GNU CC.
7
8 GNU CC 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 GNU CC 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 GNU CC; 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 /* Target OS builtins.  */
29 /* -D__fpreg=long double is needed to compensate for
30    the lack of __fpreg which is a primitive type in
31    HP C but does not exist in GNU C.  */
32 #define TARGET_OS_CPP_BUILTINS()                        \
33 do {                                                    \
34         builtin_assert("system=hpux");                  \
35         builtin_assert("system=posix");                 \
36         builtin_assert("system=unix");                  \
37         builtin_define_std("hpux");                     \
38         builtin_define_std("unix");                     \
39         builtin_define("__IA64__");                     \
40         builtin_define("_LONGLONG");                    \
41         builtin_define("_UINT128_T");                   \
42         builtin_define("__fpreg=long double");          \
43         builtin_define("__float80=long double");        \
44         builtin_define("__float128=long double");       \
45         if (c_language == clk_cplusplus || !flag_iso)   \
46           {                                             \
47             builtin_define("_HPUX_SOURCE");             \
48             builtin_define("__STDC_EXT__");             \
49           }                                             \
50 } while (0)
51
52 #undef  ASM_EXTRA_SPEC
53 #define ASM_EXTRA_SPEC "%{milp32:-milp32} %{mlp64:-mlp64}"
54
55 #undef ENDFILE_SPEC
56
57 #undef STARTFILE_SPEC
58 #define STARTFILE_SPEC "%{!shared:%{static:crt0%O%s}}"
59
60 #ifndef CROSS_COMPILE
61 #define STARTFILE_PREFIX_SPEC \
62   "%{mlp64: /usr/ccs/lib/hpux64/} \
63    %{!mlp64: /usr/ccs/lib/hpux32/}"
64 #endif
65
66 #undef LINK_SPEC
67 #define LINK_SPEC \
68   "+Accept TypeMismatch \
69    %{shared:-b} \
70    %{!shared: \
71      -u main \
72      %{static:-noshared}}"
73
74 #undef  LIB_SPEC
75 #define LIB_SPEC \
76   "%{!shared: \
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) (TREE_CODE (TREE_TYPE (FIELD)) != REAL_TYPE || (MODE == TFmode && !INTEL_EXTENDED_IEEE_FORMAT))
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 /* Put out the needed function declarations at the end.  */
144
145 #define ASM_FILE_END(STREAM) ia64_hpux_asm_file_end(STREAM)
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 #undef READONLY_DATA_SECTION_ASM_OP
154 #define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata,\t\"a\",\t\"progbits\""
155
156 #undef DATA_SECTION_ASM_OP
157 #define DATA_SECTION_ASM_OP "\t.section\t.data,\t\"aw\",\t\"progbits\""
158
159 #undef SDATA_SECTION_ASM_OP
160 #define SDATA_SECTION_ASM_OP "\t.section\t.sdata,\t\"asw\",\t\"progbits\""
161
162 #undef BSS_SECTION_ASM_OP
163 #define BSS_SECTION_ASM_OP "\t.section\t.bss,\t\"aw\",\t\"nobits\""
164
165 #undef SBSS_SECTION_ASM_OP
166 #define SBSS_SECTION_ASM_OP "\t.section\t.sbss,\t\"asw\",\t\"nobits\""
167
168 #undef TEXT_SECTION_ASM_OP
169 #define TEXT_SECTION_ASM_OP "\t.section\t.text,\t\"ax\",\t\"progbits\""
170
171 /* It is illegal to have relocations in shared segments on HPUX.
172    Pretend flag_pic is always set.  */
173 #undef  TARGET_ASM_SELECT_SECTION
174 #define TARGET_ASM_SELECT_SECTION  ia64_rwreloc_select_section
175 #undef  TARGET_ASM_UNIQUE_SECTION
176 #define TARGET_ASM_UNIQUE_SECTION  ia64_rwreloc_unique_section
177 #undef  TARGET_ASM_SELECT_RTX_SECTION
178 #define TARGET_ASM_SELECT_RTX_SECTION  ia64_rwreloc_select_rtx_section