1/* Definitions of target machine for GNU compiler.  IRIX version 6.
2   Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004,
3   2005, 2006, 2007
4   Free Software Foundation, Inc.
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2, or (at your option)
11any later version.
12
13GCC is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GCC; see the file COPYING.  If not, write to
20the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21Boston, MA 02110-1301, USA.  */
22
23/* Allow some special handling for IRIX 6.  */
24#undef TARGET_IRIX6
25#define TARGET_IRIX6 1
26
27/* Default to -mabi=n32 and -mips3.  */
28#undef MULTILIB_DEFAULTS
29#define MULTILIB_DEFAULTS { "mabi=n32" }
30
31/* Force the default ABI onto the command line in order to make the specs
32   easier to write.  Default to the mips2 ISA for the O32 ABI.  */
33#define DRIVER_SELF_SPECS \
34  "%{!mabi=*: -mabi=n32}", \
35  "%{mabi=32: %{!mips*: %{!march*: -mips2}}}"
36
37/* Force the generation of dwarf .debug_frame sections even if not
38   compiling -g.  This guarantees that we can unwind the stack.  */
39#define DWARF2_FRAME_INFO 1
40
41/* The system unwinder in libexc requires a specific dwarf return address
42   column to work.  */
43#undef  DWARF_FRAME_RETURN_COLUMN
44#define DWARF_FRAME_RETURN_COLUMN (FP_REG_LAST + 1)
45
46#undef MACHINE_TYPE
47#define MACHINE_TYPE "SGI running IRIX 6.x"
48
49#ifdef IRIX_USING_GNU_LD
50#define IRIX_SUBTARGET_LINK_SPEC \
51  "%{mabi=32: -melf32bsmip}%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}"
52#else
53#define IRIX_SUBTARGET_LINK_SPEC \
54  "%{w} -_SYSTYPE_SVR4 -woff 131 \
55   %{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"
56#endif
57
58/* Profiling is supported via libprof1.a not -lc_p as in IRIX 3.  */
59#undef STARTFILE_SPEC
60#define STARTFILE_SPEC \
61  "%{!shared: \
62     %{mabi=32:%{pg:gcrt1.o%s} \
63       %{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}} \
64     %{mabi=n32: \
65       %{mips4:%{pg:/usr/lib32/mips4/gcrt1.o%s} \
66         %{!pg:%{p:/usr/lib32/mips4/mcrt1.o%s /usr/lib32/mips4/libprof1.a%s} \
67           %{!p:/usr/lib32/mips4/crt1.o%s}}} \
68       %{!mips4:%{pg:/usr/lib32/mips3/gcrt1.o%s} \
69         %{!pg:%{p:/usr/lib32/mips3/mcrt1.o%s /usr/lib32/mips3/libprof1.a%s} \
70           %{!p:/usr/lib32/mips3/crt1.o%s}}}} \
71     %{mabi=64: \
72       %{mips4:%{pg:/usr/lib64/mips4/gcrt1.o} \
73         %{!pg:%{p:/usr/lib64/mips4/mcrt1.o /usr/lib64/mips4/libprof1.a} \
74           %{!p:/usr/lib64/mips4/crt1.o}}} \
75       %{!mips4:%{pg:/usr/lib64/mips3/gcrt1.o} \
76         %{!pg:%{p:/usr/lib64/mips3/mcrt1.o /usr/lib64/mips3/libprof1.a} \
77           %{!p:/usr/lib64/mips3/crt1.o}}}}} \
78  irix-crti.o%s crtbegin.o%s"
79
80#ifdef IRIX_USING_GNU_LD
81#define SUBTARGET_DONT_WARN_UNUSED_SPEC ""
82#define SUBTARGET_WARN_UNUSED_SPEC ""
83#else
84#define SUBTARGET_DONT_WARN_UNUSED_SPEC "-dont_warn_unused"
85#define SUBTARGET_WARN_UNUSED_SPEC "-warn_unused"
86#endif
87
88#undef LIB_SPEC
89#define LIB_SPEC \
90  "%{mabi=n32: %{mips4:-L/usr/lib32/mips4} %{!mips4:-L/usr/lib32/mips3} \
91     -L/usr/lib32} \
92   %{mabi=64: %{mips4:-L/usr/lib64/mips4} %{!mips4:-L/usr/lib64/mips3} \
93     -L/usr/lib64} \
94   %{!shared:" \
95     SUBTARGET_DONT_WARN_UNUSED_SPEC \
96     " %{pthread:-lpthread} %{p:libprof1.a%s}%{pg:libprof1.a%s} -lc " \
97     SUBTARGET_WARN_UNUSED_SPEC "}"
98
99/* Avoid getting two warnings for libgcc.a everytime we link.  libgcc.a
100   contains references to copysignl, so link with libm to resolve them.  */
101#undef LIBGCC_SPEC
102#define LIBGCC_SPEC \
103  SUBTARGET_DONT_WARN_UNUSED_SPEC " -lgcc -lm " SUBTARGET_WARN_UNUSED_SPEC
104
105#undef ENDFILE_SPEC
106#define ENDFILE_SPEC \
107  "crtend.o%s irix-crtn.o%s \
108   %{!shared: \
109     %{mabi=32:crtn.o%s}\
110     %{mabi=n32:%{mips4:/usr/lib32/mips4/crtn.o%s}\
111       %{!mips4:/usr/lib32/mips3/crtn.o%s}}\
112     %{mabi=64:%{mips4:/usr/lib64/mips4/crtn.o%s}\
113       %{!mips4:/usr/lib64/mips3/crtn.o%s}}}"
114
115#define MIPS_TFMODE_FORMAT mips_extended_format
116
117#undef SUBTARGET_CPP_SPEC
118#define SUBTARGET_CPP_SPEC "%{pthread:-D_REENTRANT}"
119
120