* config.gcc (mipsisa64*-*-linux*): New configuration. Set ISA
[official-gcc.git] / gcc / config / mips / iris.h
blob312845b39230294490be2b87a3c450fa4f2f21bf
1 /* Definitions of target machine for GNU compiler. Generic IRIX version.
2 Copyright (C) 1993, 1995, 1996, 1998, 2000,
3 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 /* We are compiling for IRIX now. */
22 #undef TARGET_IRIX
23 #define TARGET_IRIX 1
25 /* MIPS specific debugging info */
26 #define MIPS_DEBUGGING_INFO 1
28 /* The size in bytes of a DWARF field indicating an offset or length
29 relative to a debug info section, specified to be 4 bytes in the DWARF-2
30 specification. The SGI/MIPS ABI defines it to be the same as PTR_SIZE. */
31 #define DWARF_OFFSET_SIZE PTR_SIZE
33 /* The size in bytes of the initial length field in a debug info
34 section. The DWARF 3 (draft) specification defines this to be
35 either 4 or 12 (with a 4-byte "escape" word when it's 12), but the
36 SGI/MIPS ABI predates this standard and defines it to be the same
37 as DWARF_OFFSET_SIZE. */
38 #define DWARF_INITIAL_LENGTH_SIZE DWARF_OFFSET_SIZE
40 /* MIPS assemblers don't have the usual .set foo,bar construct;
41 .set is used for assembler options instead. */
42 #undef SET_ASM_OP
43 #define ASM_OUTPUT_DEF(FILE, LABEL1, LABEL2) \
44 do \
45 { \
46 fputc ('\t', FILE); \
47 assemble_name (FILE, LABEL1); \
48 fputs (" = ", FILE); \
49 assemble_name (FILE, LABEL2); \
50 fputc ('\n', FILE); \
51 } \
52 while (0)
54 /* The MIPSpro o32 linker warns about not linking .comment sections. */
55 #undef IDENT_ASM_OP
57 #undef LOCAL_LABEL_PREFIX
58 #define LOCAL_LABEL_PREFIX (TARGET_NEWABI ? "." : "$")
60 #undef ASM_DECLARE_OBJECT_NAME
61 #define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
63 #undef ASM_FINISH_DECLARE_OBJECT
64 #define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
66 /* The linker needs a space after "-o". */
67 #define SWITCHES_NEED_SPACES "o"
69 /* Specify wchar_t types. */
70 #undef WCHAR_TYPE
71 #define WCHAR_TYPE (Pmode == DImode ? "int" : "long int")
73 #undef WCHAR_TYPE_SIZE
74 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
76 /* Same for wint_t. */
77 #undef WINT_TYPE
78 #define WINT_TYPE (Pmode == DImode ? "int" : "long int")
80 #undef WINT_TYPE_SIZE
81 #define WINT_TYPE_SIZE 32
83 /* Plain char is unsigned in the SGI compiler. */
84 #undef DEFAULT_SIGNED_CHAR
85 #define DEFAULT_SIGNED_CHAR 0
87 #define WORD_SWITCH_TAKES_ARG(STR) \
88 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
89 || strcmp (STR, "rpath") == 0)
91 #define TARGET_OS_CPP_BUILTINS() \
92 do \
93 { \
94 builtin_define_std ("host_mips"); \
95 builtin_define_std ("sgi"); \
96 builtin_define_std ("unix"); \
97 builtin_define_std ("SYSTYPE_SVR4"); \
98 builtin_define ("_MODERN_C"); \
99 builtin_define ("_SVR4_SOURCE"); \
100 builtin_define ("__DSO__"); \
101 builtin_assert ("system=unix"); \
102 builtin_assert ("system=svr4"); \
103 builtin_assert ("machine=sgi"); \
105 if (!ISA_MIPS1 && !ISA_MIPS2) \
106 builtin_define ("_COMPILER_VERSION=601"); \
108 /* We must always define _LONGLONG, even when -ansi is \
109 used, because IRIX 5 system header files require it. \
110 This is OK, because gcc never warns when long long \
111 is used in system header files. \
113 An alternative would be to support the SGI builtin \
114 type __long_long. */ \
115 builtin_define ("_LONGLONG"); \
117 /* IRIX 6.5.18 and above provide many ISO C99 \
118 features protected by the __c99 macro. \
119 libstdc++ v3 needs them as well. */ \
120 if (TARGET_IRIX6) \
121 if (flag_isoc99 || c_dialect_cxx ()) \
122 builtin_define ("__c99"); \
124 /* The GNU C++ standard library requires that \
125 __EXTENSIONS__ and _SGI_SOURCE be defined on at \
126 least IRIX 6.2 and probably all IRIX 6 prior to 6.5. \
127 We don't need this on IRIX 6.5 itself, but it \
128 shouldn't hurt other than the namespace pollution. */ \
129 if (!flag_iso || (TARGET_IRIX6 && c_dialect_cxx ())) \
131 builtin_define ("__EXTENSIONS__"); \
132 builtin_define ("_SGI_SOURCE"); \
135 while (0)
137 #undef SUBTARGET_CC1_SPEC
138 #define SUBTARGET_CC1_SPEC "%{static: -mno-abicalls}"
140 #undef INIT_SECTION_ASM_OP
141 #define INIT_SECTION_ASM_OP "\t.section\t.gcc_init,\"ax\",@progbits"
143 #undef FINI_SECTION_ASM_OP
144 #define FINI_SECTION_ASM_OP "\t.section\t.gcc_fini,\"ax\",@progbits"
146 #ifdef IRIX_USING_GNU_LD
147 #define IRIX_NO_UNRESOLVED ""
148 #else
149 #define IRIX_NO_UNRESOLVED "-no_unresolved"
150 #endif
152 /* Generic part of the LINK_SPEC. */
153 #undef LINK_SPEC
154 #define LINK_SPEC "\
155 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
156 %{bestGnum} %{shared} %{non_shared} \
157 %{call_shared} %{no_archive} %{exact_version} \
158 %{!shared: \
159 %{!non_shared: %{!call_shared:%{!r: -call_shared " IRIX_NO_UNRESOLVED "}}}} \
160 %{rpath} -init __gcc_init -fini __gcc_fini " IRIX_SUBTARGET_LINK_SPEC
162 /* A linker error can empirically be avoided by removing duplicate
163 library search directories. */
164 #define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 1
166 /* Add -g to mips.h default to avoid confusing gas with local symbols
167 generated from stabs info. */
168 #undef NM_FLAGS
169 #define NM_FLAGS "-Bng"
171 /* The system header files are C++ aware. */
172 /* ??? Unfortunately, most but not all of the headers are C++ aware.
173 Specifically, curses.h is not, and as a consequence, defining this
174 used to prevent libg++ building. This is no longer the case so
175 define it again to prevent other problems, e.g. with getopt in
176 unistd.h. We still need some way to fix just those files that need
177 fixing. */
178 #define NO_IMPLICIT_EXTERN_C 1
180 /* -G is incompatible with -KPIC which is the default, so only allow objects
181 in the small data section if the user explicitly asks for it. */
182 #undef MIPS_DEFAULT_GVALUE
183 #define MIPS_DEFAULT_GVALUE 0
185 /* The native o32 IRIX linker does not support merging without a
186 special elspec(5) file. */
187 #ifndef IRIX_USING_GNU_LD
188 #undef HAVE_GAS_SHF_MERGE
189 #define HAVE_GAS_SHF_MERGE 0
190 #endif