iris6.h revision 302408
1193326Sed/* Definitions of target machine for GNU compiler.  IRIX version 6.
2193326Sed   Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004,
3353358Sdim   2005, 2006, 2007
4353358Sdim   Free Software Foundation, Inc.
5353358Sdim
6193326SedThis file is part of GCC.
7193326Sed
8193326SedGCC is free software; you can redistribute it and/or modify
9193326Sedit under the terms of the GNU General Public License as published by
10193326Sedthe Free Software Foundation; either version 2, or (at your option)
11193326Sedany later version.
12193326Sed
13296417SdimGCC is distributed in the hope that it will be useful,
14314564Sdimbut WITHOUT ANY WARRANTY; without even the implied warranty of
15288943SdimMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16193326SedGNU General Public License for more details.
17249423Sdim
18309124SdimYou should have received a copy of the GNU General Public License
19321369Sdimalong with GCC; see the file COPYING.  If not, write to
20193326Sedthe Free Software Foundation, 51 Franklin Street, Fifth Floor,
21327952SdimBoston, MA 02110-1301, USA.  */
22353358Sdim
23321369Sdim/* Allow some special handling for IRIX 6.  */
24193326Sed#undef TARGET_IRIX6
25360784Sdim#define TARGET_IRIX6 1
26201361Srdivacky
27193326Sed/* Default to -mabi=n32 and -mips3.  */
28193326Sed#undef MULTILIB_DEFAULTS
29309124Sdim#define MULTILIB_DEFAULTS { "mabi=n32" }
30344779Sdim
31193326Sed/* Force the default ABI onto the command line in order to make the specs
32193326Sed   easier to write.  Default to the mips2 ISA for the O32 ABI.  */
33261991Sdim#define DRIVER_SELF_SPECS \
34344779Sdim  "%{!mabi=*: -mabi=n32}", \
35249423Sdim  "%{mabi=32: %{!mips*: %{!march*: -mips2}}}"
36249423Sdim
37249423Sdim/* Force the generation of dwarf .debug_frame sections even if not
38249423Sdim   compiling -g.  This guarantees that we can unwind the stack.  */
39309124Sdim#define DWARF2_FRAME_INFO 1
40193326Sed
41193326Sed/* The system unwinder in libexc requires a specific dwarf return address
42193326Sed   column to work.  */
43193326Sed#undef  DWARF_FRAME_RETURN_COLUMN
44193326Sed#define DWARF_FRAME_RETURN_COLUMN (FP_REG_LAST + 1)
45296417Sdim
46207619Srdivacky#undef MACHINE_TYPE
47288943Sdim#define MACHINE_TYPE "SGI running IRIX 6.x"
48207619Srdivacky
49207619Srdivacky#ifdef IRIX_USING_GNU_LD
50207619Srdivacky#define IRIX_SUBTARGET_LINK_SPEC \
51207619Srdivacky  "%{mabi=32: -melf32bsmip}%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}"
52261991Sdim#else
53261991Sdim#define IRIX_SUBTARGET_LINK_SPEC \
54207619Srdivacky  "%{w} -_SYSTYPE_SVR4 -woff 131 \
55207619Srdivacky   %{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"
56210299Sed#endif
57321369Sdim
58207619Srdivacky/* Profiling is supported via libprof1.a not -lc_p as in IRIX 3.  */
59207619Srdivacky#undef STARTFILE_SPEC
60207619Srdivacky#define STARTFILE_SPEC \
61207619Srdivacky  "%{!shared: \
62207619Srdivacky     %{mabi=32:%{pg:gcrt1.o%s} \
63251662Sdim       %{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}} \
64218893Sdim     %{mabi=n32: \
65207619Srdivacky       %{mips4:%{pg:/usr/lib32/mips4/gcrt1.o%s} \
66226633Sdim         %{!pg:%{p:/usr/lib32/mips4/mcrt1.o%s /usr/lib32/mips4/libprof1.a%s} \
67193326Sed           %{!p:/usr/lib32/mips4/crt1.o%s}}} \
68207619Srdivacky       %{!mips4:%{pg:/usr/lib32/mips3/gcrt1.o%s} \
69207619Srdivacky         %{!pg:%{p:/usr/lib32/mips3/mcrt1.o%s /usr/lib32/mips3/libprof1.a%s} \
70261991Sdim           %{!p:/usr/lib32/mips3/crt1.o%s}}}} \
71207619Srdivacky     %{mabi=64: \
72223017Sdim       %{mips4:%{pg:/usr/lib64/mips4/gcrt1.o} \
73207619Srdivacky         %{!pg:%{p:/usr/lib64/mips4/mcrt1.o /usr/lib64/mips4/libprof1.a} \
74207619Srdivacky           %{!p:/usr/lib64/mips4/crt1.o}}} \
75207619Srdivacky       %{!mips4:%{pg:/usr/lib64/mips3/gcrt1.o} \
76207619Srdivacky         %{!pg:%{p:/usr/lib64/mips3/mcrt1.o /usr/lib64/mips3/libprof1.a} \
77207619Srdivacky           %{!p:/usr/lib64/mips3/crt1.o}}}}} \
78207619Srdivacky  irix-crti.o%s crtbegin.o%s"
79207619Srdivacky
80207619Srdivacky#ifdef IRIX_USING_GNU_LD
81207619Srdivacky#define SUBTARGET_DONT_WARN_UNUSED_SPEC ""
82309124Sdim#define SUBTARGET_WARN_UNUSED_SPEC ""
83309124Sdim#else
84210299Sed#define SUBTARGET_DONT_WARN_UNUSED_SPEC "-dont_warn_unused"
85207619Srdivacky#define SUBTARGET_WARN_UNUSED_SPEC "-warn_unused"
86314564Sdim#endif
87207619Srdivacky
88207619Srdivacky#undef LIB_SPEC
89207619Srdivacky#define LIB_SPEC \
90207619Srdivacky  "%{mabi=n32: %{mips4:-L/usr/lib32/mips4} %{!mips4:-L/usr/lib32/mips3} \
91207619Srdivacky     -L/usr/lib32} \
92251662Sdim   %{mabi=64: %{mips4:-L/usr/lib64/mips4} %{!mips4:-L/usr/lib64/mips3} \
93226633Sdim     -L/usr/lib64} \
94261991Sdim   %{!shared:" \
95309124Sdim     SUBTARGET_DONT_WARN_UNUSED_SPEC \
96288943Sdim     " %{pthread:-lpthread} %{p:libprof1.a%s}%{pg:libprof1.a%s} -lc " \
97314564Sdim     SUBTARGET_WARN_UNUSED_SPEC "}"
98226633Sdim
99193326Sed/* Avoid getting two warnings for libgcc.a everytime we link.  libgcc.a
100193326Sed   contains references to copysignl, so link with libm to resolve them.  */
101193326Sed#undef LIBGCC_SPEC
102198092Srdivacky#define LIBGCC_SPEC \
103193326Sed  SUBTARGET_DONT_WARN_UNUSED_SPEC " -lgcc -lm " SUBTARGET_WARN_UNUSED_SPEC
104200583Srdivacky
105218893Sdim#undef ENDFILE_SPEC
106234353Sdim#define ENDFILE_SPEC \
107249423Sdim  "crtend.o%s irix-crtn.o%s \
108353358Sdim   %{!shared: \
109309124Sdim     %{mabi=32:crtn.o%s}\
110344779Sdim     %{mabi=n32:%{mips4:/usr/lib32/mips4/crtn.o%s}\
111249423Sdim       %{!mips4:/usr/lib32/mips3/crtn.o%s}}\
112353358Sdim     %{mabi=64:%{mips4:/usr/lib64/mips4/crtn.o%s}\
113360784Sdim       %{!mips4:/usr/lib64/mips3/crtn.o%s}}}"
114360784Sdim
115193326Sed#define MIPS_TFMODE_FORMAT mips_extended_format
116193326Sed
117198092Srdivacky#undef SUBTARGET_CPP_SPEC
118261991Sdim#define SUBTARGET_CPP_SPEC "%{pthread:-D_REENTRANT}"
119261991Sdim
120261991Sdim