1 |
709 |
jeremybenn |
/* Definitions of target machine for GNU compiler. IRIX 6.5 version.
|
2 |
|
|
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2000,
|
3 |
|
|
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
|
4 |
|
|
Free Software Foundation, Inc.
|
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 3, 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 COPYING3. If not see
|
20 |
|
|
<http://www.gnu.org/licenses/>. */
|
21 |
|
|
|
22 |
|
|
/* We are compiling for IRIX 6 now. */
|
23 |
|
|
#undef TARGET_IRIX6
|
24 |
|
|
#define TARGET_IRIX6 1
|
25 |
|
|
|
26 |
|
|
/* Default to -mabi=n32 and -mips3. */
|
27 |
|
|
#undef MULTILIB_DEFAULTS
|
28 |
|
|
#define MULTILIB_DEFAULTS { "mabi=n32" }
|
29 |
|
|
|
30 |
|
|
/* -march=native handling only makes sense with compiler running on
|
31 |
|
|
a MIPS chip. */
|
32 |
|
|
#if defined(__mips__)
|
33 |
|
|
extern const char *host_detect_local_cpu (int argc, const char **argv);
|
34 |
|
|
# define EXTRA_SPEC_FUNCTIONS \
|
35 |
|
|
{ "local_cpu_detect", host_detect_local_cpu },
|
36 |
|
|
|
37 |
|
|
# define MARCH_MTUNE_NATIVE_SPECS \
|
38 |
|
|
" %{march=native:%<march=native %:local_cpu_detect(arch)}" \
|
39 |
|
|
" %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"
|
40 |
|
|
#else
|
41 |
|
|
# define MARCH_MTUNE_NATIVE_SPECS ""
|
42 |
|
|
#endif
|
43 |
|
|
|
44 |
|
|
/* Force the default ABI onto the command line in order to make the specs
|
45 |
|
|
easier to write. */
|
46 |
|
|
#undef DRIVER_SELF_SPECS
|
47 |
|
|
#define DRIVER_SELF_SPECS \
|
48 |
|
|
"%{!mabi=*: -mabi=n32}", \
|
49 |
|
|
/* Configuration-independent MIPS rules. */ \
|
50 |
|
|
BASE_DRIVER_SELF_SPECS, \
|
51 |
|
|
MARCH_MTUNE_NATIVE_SPECS
|
52 |
|
|
|
53 |
|
|
/* IRIX 6.5 has the float and long double forms of math functions. */
|
54 |
|
|
#define TARGET_C99_FUNCTIONS 1
|
55 |
|
|
|
56 |
|
|
/* MIPS specific debugging info */
|
57 |
|
|
#define MIPS_DEBUGGING_INFO 1
|
58 |
|
|
|
59 |
|
|
/* Force the generation of dwarf .debug_frame sections even if not
|
60 |
|
|
compiling -g. This guarantees that we can unwind the stack. */
|
61 |
|
|
#define DWARF2_FRAME_INFO 1
|
62 |
|
|
|
63 |
|
|
/* The system unwinder in libexc requires a specific dwarf return address
|
64 |
|
|
column to work. */
|
65 |
|
|
#undef DWARF_FRAME_RETURN_COLUMN
|
66 |
|
|
#define DWARF_FRAME_RETURN_COLUMN (FP_REG_LAST + 1)
|
67 |
|
|
|
68 |
|
|
/* The size in bytes of a DWARF field indicating an offset or length
|
69 |
|
|
relative to a debug info section, specified to be 4 bytes in the DWARF-2
|
70 |
|
|
specification. The SGI/MIPS ABI defines it to be the same as PTR_SIZE. */
|
71 |
|
|
#define DWARF_OFFSET_SIZE PTR_SIZE
|
72 |
|
|
|
73 |
|
|
/* The size in bytes of the initial length field in a debug info
|
74 |
|
|
section. The DWARF 3 (draft) specification defines this to be
|
75 |
|
|
either 4 or 12 (with a 4-byte "escape" word when it's 12), but the
|
76 |
|
|
SGI/MIPS ABI predates this standard and defines it to be the same
|
77 |
|
|
as DWARF_OFFSET_SIZE. */
|
78 |
|
|
#define DWARF_INITIAL_LENGTH_SIZE DWARF_OFFSET_SIZE
|
79 |
|
|
|
80 |
|
|
/* MIPS assemblers don't have the usual .set foo,bar construct;
|
81 |
|
|
.set is used for assembler options instead. */
|
82 |
|
|
#undef SET_ASM_OP
|
83 |
|
|
#define ASM_OUTPUT_DEF(FILE, LABEL1, LABEL2) \
|
84 |
|
|
do \
|
85 |
|
|
{ \
|
86 |
|
|
fputc ('\t', FILE); \
|
87 |
|
|
assemble_name (FILE, LABEL1); \
|
88 |
|
|
fputs (" = ", FILE); \
|
89 |
|
|
assemble_name (FILE, LABEL2); \
|
90 |
|
|
fputc ('\n', FILE); \
|
91 |
|
|
} \
|
92 |
|
|
while (0)
|
93 |
|
|
|
94 |
|
|
#undef LOCAL_LABEL_PREFIX
|
95 |
|
|
#define LOCAL_LABEL_PREFIX "."
|
96 |
|
|
|
97 |
|
|
#undef ASM_DECLARE_OBJECT_NAME
|
98 |
|
|
#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
|
99 |
|
|
|
100 |
|
|
#undef ASM_FINISH_DECLARE_OBJECT
|
101 |
|
|
#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
|
102 |
|
|
|
103 |
|
|
/* The native IRIX 6 linker does not support merging without a special
|
104 |
|
|
elspec(5) file. */
|
105 |
|
|
#ifndef IRIX_USING_GNU_LD
|
106 |
|
|
#undef HAVE_GAS_SHF_MERGE
|
107 |
|
|
#define HAVE_GAS_SHF_MERGE 0
|
108 |
|
|
#endif
|
109 |
|
|
|
110 |
|
|
/* Specify wchar_t types. */
|
111 |
|
|
#undef WCHAR_TYPE
|
112 |
|
|
#define WCHAR_TYPE (Pmode == DImode ? "int" : "long int")
|
113 |
|
|
|
114 |
|
|
#undef WCHAR_TYPE_SIZE
|
115 |
|
|
#define WCHAR_TYPE_SIZE INT_TYPE_SIZE
|
116 |
|
|
|
117 |
|
|
/* Same for wint_t. */
|
118 |
|
|
#undef WINT_TYPE
|
119 |
|
|
#define WINT_TYPE (Pmode == DImode ? "int" : "long int")
|
120 |
|
|
|
121 |
|
|
#undef WINT_TYPE_SIZE
|
122 |
|
|
#define WINT_TYPE_SIZE INT_TYPE_SIZE
|
123 |
|
|
|
124 |
|
|
/* C99 stdint.h types. */
|
125 |
|
|
#define INT8_TYPE "signed char"
|
126 |
|
|
#define INT16_TYPE "short int"
|
127 |
|
|
#define INT32_TYPE "int"
|
128 |
|
|
#define INT64_TYPE "long long int"
|
129 |
|
|
#define UINT8_TYPE "unsigned char"
|
130 |
|
|
#define UINT16_TYPE "short unsigned int"
|
131 |
|
|
#define UINT32_TYPE "unsigned int"
|
132 |
|
|
#define UINT64_TYPE "long long unsigned int"
|
133 |
|
|
|
134 |
|
|
#define INT_LEAST8_TYPE "signed char"
|
135 |
|
|
#define INT_LEAST16_TYPE "short int"
|
136 |
|
|
#define INT_LEAST32_TYPE "int"
|
137 |
|
|
#define INT_LEAST64_TYPE "long long int"
|
138 |
|
|
#define UINT_LEAST8_TYPE "unsigned char"
|
139 |
|
|
#define UINT_LEAST16_TYPE "short unsigned int"
|
140 |
|
|
#define UINT_LEAST32_TYPE "unsigned int"
|
141 |
|
|
#define UINT_LEAST64_TYPE "long long unsigned int"
|
142 |
|
|
|
143 |
|
|
#define INT_FAST8_TYPE "signed char"
|
144 |
|
|
#define INT_FAST16_TYPE "short int"
|
145 |
|
|
#define INT_FAST32_TYPE "int"
|
146 |
|
|
#define INT_FAST64_TYPE "long long int"
|
147 |
|
|
#define UINT_FAST8_TYPE "unsigned char"
|
148 |
|
|
#define UINT_FAST16_TYPE "short unsigned int"
|
149 |
|
|
#define UINT_FAST32_TYPE "unsigned int"
|
150 |
|
|
#define UINT_FAST64_TYPE "long long unsigned int"
|
151 |
|
|
|
152 |
|
|
#define INTMAX_TYPE "long long int"
|
153 |
|
|
#define UINTMAX_TYPE "long long unsigned int"
|
154 |
|
|
|
155 |
|
|
#define INTPTR_TYPE "long int"
|
156 |
|
|
#define UINTPTR_TYPE "long unsigned int"
|
157 |
|
|
|
158 |
|
|
#define SIG_ATOMIC_TYPE "int"
|
159 |
|
|
|
160 |
|
|
/* Plain char is unsigned in the SGI compiler. */
|
161 |
|
|
#undef DEFAULT_SIGNED_CHAR
|
162 |
|
|
#define DEFAULT_SIGNED_CHAR 0
|
163 |
|
|
|
164 |
|
|
#define TARGET_OS_CPP_BUILTINS() \
|
165 |
|
|
do \
|
166 |
|
|
{ \
|
167 |
|
|
builtin_define_std ("host_mips"); \
|
168 |
|
|
builtin_define_std ("sgi"); \
|
169 |
|
|
builtin_define_std ("unix"); \
|
170 |
|
|
builtin_define_std ("SYSTYPE_SVR4"); \
|
171 |
|
|
builtin_define ("_MODERN_C"); \
|
172 |
|
|
builtin_define ("_SVR4_SOURCE"); \
|
173 |
|
|
builtin_define ("__DSO__"); \
|
174 |
|
|
builtin_assert ("system=unix"); \
|
175 |
|
|
builtin_assert ("system=svr4"); \
|
176 |
|
|
builtin_assert ("machine=sgi"); \
|
177 |
|
|
\
|
178 |
|
|
if (!ISA_MIPS1 && !ISA_MIPS2) \
|
179 |
|
|
builtin_define ("_COMPILER_VERSION=601"); \
|
180 |
|
|
\
|
181 |
|
|
/* We must always define _LONGLONG, even when -ansi is \
|
182 |
|
|
used, because IRIX 5 system header files require it. \
|
183 |
|
|
This is OK, because gcc never warns when long long \
|
184 |
|
|
is used in system header files. \
|
185 |
|
|
\
|
186 |
|
|
An alternative would be to support the SGI builtin \
|
187 |
|
|
type __long_long. */ \
|
188 |
|
|
builtin_define ("_LONGLONG"); \
|
189 |
|
|
\
|
190 |
|
|
/* IRIX 6.5.18 and above provide many ISO C99 \
|
191 |
|
|
features protected by the __c99 macro. \
|
192 |
|
|
libstdc++ v3 needs them as well. */ \
|
193 |
|
|
if (flag_isoc99 || c_dialect_cxx ()) \
|
194 |
|
|
builtin_define ("__c99"); \
|
195 |
|
|
\
|
196 |
|
|
/* The GNU C++ standard library requires that \
|
197 |
|
|
__EXTENSIONS__ and _SGI_SOURCE be defined on at \
|
198 |
|
|
least IRIX 6.2 and probably all IRIX 6 prior to 6.5. \
|
199 |
|
|
We don't need this on IRIX 6.5 itself, but it \
|
200 |
|
|
shouldn't hurt other than the namespace pollution. */ \
|
201 |
|
|
if (!flag_iso || c_dialect_cxx ()) \
|
202 |
|
|
{ \
|
203 |
|
|
builtin_define ("__EXTENSIONS__"); \
|
204 |
|
|
builtin_define ("_SGI_SOURCE"); \
|
205 |
|
|
} \
|
206 |
|
|
} \
|
207 |
|
|
while (0)
|
208 |
|
|
|
209 |
|
|
#undef SUBTARGET_CC1_SPEC
|
210 |
|
|
#define SUBTARGET_CC1_SPEC "%{static: -mno-abicalls}"
|
211 |
|
|
|
212 |
|
|
#undef SUBTARGET_CPP_SPEC
|
213 |
|
|
#define SUBTARGET_CPP_SPEC "%{pthread:-D_REENTRANT}"
|
214 |
|
|
|
215 |
|
|
#undef INIT_SECTION_ASM_OP
|
216 |
|
|
#define INIT_SECTION_ASM_OP "\t.section\t.gcc_init,\"ax\",@progbits"
|
217 |
|
|
|
218 |
|
|
#undef FINI_SECTION_ASM_OP
|
219 |
|
|
#define FINI_SECTION_ASM_OP "\t.section\t.gcc_fini,\"ax\",@progbits"
|
220 |
|
|
|
221 |
|
|
#ifdef IRIX_USING_GNU_LD
|
222 |
|
|
#define IRIX_NO_UNRESOLVED ""
|
223 |
|
|
#else
|
224 |
|
|
#define IRIX_NO_UNRESOLVED "-no_unresolved"
|
225 |
|
|
#endif
|
226 |
|
|
|
227 |
|
|
#ifdef IRIX_USING_GNU_LD
|
228 |
|
|
#define SUBTARGET_DONT_WARN_UNUSED_SPEC ""
|
229 |
|
|
#define SUBTARGET_WARN_UNUSED_SPEC ""
|
230 |
|
|
#else
|
231 |
|
|
#define SUBTARGET_DONT_WARN_UNUSED_SPEC "-dont_warn_unused"
|
232 |
|
|
#define SUBTARGET_WARN_UNUSED_SPEC "-warn_unused"
|
233 |
|
|
#endif
|
234 |
|
|
|
235 |
|
|
/* Profiling is supported via libprof1.a not -lc_p as in IRIX 3. */
|
236 |
|
|
#undef STARTFILE_SPEC
|
237 |
|
|
#define STARTFILE_SPEC \
|
238 |
|
|
"%{!shared: \
|
239 |
|
|
%{mabi=n32: \
|
240 |
|
|
%{mips4:%{pg:/usr/lib32/mips4/gcrt1.o%s} \
|
241 |
|
|
%{!pg:%{p:/usr/lib32/mips4/mcrt1.o%s /usr/lib32/mips4/libprof1.a%s} \
|
242 |
|
|
%{!p:/usr/lib32/mips4/crt1.o%s}}} \
|
243 |
|
|
%{!mips4:%{pg:/usr/lib32/mips3/gcrt1.o%s} \
|
244 |
|
|
%{!pg:%{p:/usr/lib32/mips3/mcrt1.o%s /usr/lib32/mips3/libprof1.a%s} \
|
245 |
|
|
%{!p:/usr/lib32/mips3/crt1.o%s}}}} \
|
246 |
|
|
%{mabi=64: \
|
247 |
|
|
%{mips4:%{pg:/usr/lib64/mips4/gcrt1.o} \
|
248 |
|
|
%{!pg:%{p:/usr/lib64/mips4/mcrt1.o /usr/lib64/mips4/libprof1.a} \
|
249 |
|
|
%{!p:/usr/lib64/mips4/crt1.o}}} \
|
250 |
|
|
%{!mips4:%{pg:/usr/lib64/mips3/gcrt1.o} \
|
251 |
|
|
%{!pg:%{p:/usr/lib64/mips3/mcrt1.o /usr/lib64/mips3/libprof1.a} \
|
252 |
|
|
%{!p:/usr/lib64/mips3/crt1.o}}}}} \
|
253 |
|
|
irix-crti.o%s crtbegin.o%s"
|
254 |
|
|
|
255 |
|
|
#undef LIB_SPEC
|
256 |
|
|
#define LIB_SPEC \
|
257 |
|
|
"%{mabi=n32: %{mips4:-L/usr/lib32/mips4} %{!mips4:-L/usr/lib32/mips3} \
|
258 |
|
|
-L/usr/lib32} \
|
259 |
|
|
%{mabi=64: %{mips4:-L/usr/lib64/mips4} %{!mips4:-L/usr/lib64/mips3} \
|
260 |
|
|
-L/usr/lib64} \
|
261 |
|
|
%{!shared:" \
|
262 |
|
|
SUBTARGET_DONT_WARN_UNUSED_SPEC \
|
263 |
|
|
" %{pthread:-lpthread} %{p:libprof1.a%s}%{pg:libprof1.a%s} -lc " \
|
264 |
|
|
SUBTARGET_WARN_UNUSED_SPEC "}"
|
265 |
|
|
|
266 |
|
|
/* Avoid getting two warnings for libgcc.a everytime we link. libgcc.a
|
267 |
|
|
contains references to copysignl, so link with libm to resolve them. */
|
268 |
|
|
#undef LIBGCC_SPEC
|
269 |
|
|
#define LIBGCC_SPEC \
|
270 |
|
|
SUBTARGET_DONT_WARN_UNUSED_SPEC " -lgcc -lm " SUBTARGET_WARN_UNUSED_SPEC
|
271 |
|
|
|
272 |
|
|
#undef ENDFILE_SPEC
|
273 |
|
|
#define ENDFILE_SPEC \
|
274 |
|
|
"%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
|
275 |
|
|
crtend.o%s irix-crtn.o%s \
|
276 |
|
|
%{!shared: \
|
277 |
|
|
%{mabi=n32:%{mips4:/usr/lib32/mips4/crtn.o%s}\
|
278 |
|
|
%{!mips4:/usr/lib32/mips3/crtn.o%s}}\
|
279 |
|
|
%{mabi=64:%{mips4:/usr/lib64/mips4/crtn.o%s}\
|
280 |
|
|
%{!mips4:/usr/lib64/mips3/crtn.o%s}}}"
|
281 |
|
|
|
282 |
|
|
/* Generic part of the LINK_SPEC. */
|
283 |
|
|
#undef LINK_SPEC
|
284 |
|
|
#define LINK_SPEC "\
|
285 |
|
|
%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
|
286 |
|
|
%{bestGnum} %{shared} %{non_shared} \
|
287 |
|
|
%{call_shared} %{no_archive} %{exact_version} \
|
288 |
|
|
%{!shared: \
|
289 |
|
|
%{!non_shared: %{!call_shared:%{!r: -call_shared " IRIX_NO_UNRESOLVED "}}}} \
|
290 |
|
|
%{rpath} %{!r: -init __gcc_init -fini __gcc_fini} " IRIX_SUBTARGET_LINK_SPEC
|
291 |
|
|
|
292 |
|
|
#ifdef IRIX_USING_GNU_LD
|
293 |
|
|
#define IRIX_SUBTARGET_LINK_SPEC \
|
294 |
|
|
"%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}"
|
295 |
|
|
#else
|
296 |
|
|
/* Explicitly hide crt symbols that would normally be marked with
|
297 |
|
|
a "hidden" visibility attribute.
|
298 |
|
|
|
299 |
|
|
We have traditionally disabled this attribute when using the
|
300 |
|
|
native linker because the native linker's visibility support is
|
301 |
|
|
not fully-compatible with the GNU linker's. In particular, the
|
302 |
|
|
native linker does not pull in archive objects purely to resolve
|
303 |
|
|
references to the object's hidden symbols, whereas the GNU
|
304 |
|
|
linker does.
|
305 |
|
|
|
306 |
|
|
The gcc build system currently hides symbols in some static
|
307 |
|
|
libraries (typically libgcov.a or libgcc.a) whenever visibility
|
308 |
|
|
attributes are supported. On targets with GNU semantics, this
|
309 |
|
|
makes sure that uses of libx.so symbols in one dynamic object are
|
310 |
|
|
not resolved to libx.a symbols in another dynamic object. But
|
311 |
|
|
on targets with IRIX semantics, hiding the symbols prevents the
|
312 |
|
|
static archive from working at all.
|
313 |
|
|
|
314 |
|
|
It would probably be better to enable visiblity attributes for
|
315 |
|
|
IRIX ld and disable the static archives versioning. It shouldn't
|
316 |
|
|
make anything worse, since libx.a symbols are global by default
|
317 |
|
|
anyway. However, no-one has volunteered to do this yet. */
|
318 |
|
|
|
319 |
|
|
#define IRIX_SUBTARGET_LINK_SPEC \
|
320 |
|
|
"%{w} -_SYSTYPE_SVR4 -woff 131 \
|
321 |
|
|
%{shared:-hidden_symbol __dso_handle} \
|
322 |
|
|
%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"
|
323 |
|
|
#endif
|
324 |
|
|
|
325 |
|
|
/* A linker error can empirically be avoided by removing duplicate
|
326 |
|
|
library search directories. */
|
327 |
|
|
#define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 1
|
328 |
|
|
|
329 |
|
|
/* The SGI linker doesn't understand constructor priorities. */
|
330 |
|
|
#ifndef IRIX_USING_GNU_LD
|
331 |
|
|
#define SUPPORTS_INIT_PRIORITY 0
|
332 |
|
|
#endif
|
333 |
|
|
|
334 |
|
|
/* Add -g to mips.h default to avoid confusing gas with local symbols
|
335 |
|
|
generated from stabs info. */
|
336 |
|
|
#undef NM_FLAGS
|
337 |
|
|
#define NM_FLAGS "-Bng"
|
338 |
|
|
|
339 |
|
|
/* The system header files are C++ aware. */
|
340 |
|
|
/* ??? Unfortunately, most but not all of the headers are C++ aware.
|
341 |
|
|
Specifically, curses.h is not, and as a consequence, defining this
|
342 |
|
|
used to prevent libg++ building. This is no longer the case so
|
343 |
|
|
define it again to prevent other problems, e.g. with getopt in
|
344 |
|
|
unistd.h. We still need some way to fix just those files that need
|
345 |
|
|
fixing. */
|
346 |
|
|
#define NO_IMPLICIT_EXTERN_C 1
|
347 |
|
|
|
348 |
|
|
/* -G is incompatible with -KPIC which is the default, so only allow objects
|
349 |
|
|
in the small data section if the user explicitly asks for it. */
|
350 |
|
|
#undef MIPS_DEFAULT_GVALUE
|
351 |
|
|
#define MIPS_DEFAULT_GVALUE 0
|
352 |
|
|
|
353 |
|
|
#define MIPS_TFMODE_FORMAT mips_extended_format
|