Import final gcc2 snapshot (990109)
[official-gcc.git] / gcc / config / mips / iris5.h
blobf81fe1c0fdab47ed91e44e74e8d54ea53070ad7b
1 /* Definitions of target machine for GNU compiler. Iris version 5.
2 Copyright (C) 1993, 1995, 1996, 1998 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 #ifndef TARGET_DEFAULT
22 #define TARGET_DEFAULT MASK_ABICALLS
23 #endif
24 #define ABICALLS_ASM_OP ".option pic2"
26 #include "mips/iris3.h"
27 #include "mips/mips.h"
28 #include "mips/iris4.h"
30 /* Irix 5 doesn't use COFF, so disable special COFF handling in collect2.c. */
31 #undef OBJECT_FORMAT_COFF
33 /* ??? This is correct, but not very useful, because there is no file that
34 uses this macro. */
35 /* ??? The best way to handle global constructors under ELF is to use .init
36 and .fini sections. Unfortunately, there is apparently no way to get
37 the Irix 5.x (x <= 2) assembler to create these sections. So we instead
38 use collect. The linker can create these sections via -init and -fini
39 options, but using this would require modifying how crtstuff works, and
40 I will leave that for another time (or someone else). */
41 #define OBJECT_FORMAT_ELF
42 #define HAS_INIT_SECTION
43 #define LD_INIT_SWITCH "-init"
44 #define LD_FINI_SWITCH "-fini"
46 /* Specify wchar_t types. */
47 #undef WCHAR_TYPE
48 #undef WCHAR_TYPE_SIZE
49 #undef MAX_WCHAR_TYPE_SIZE
51 #define WCHAR_TYPE "long int"
52 #define WCHAR_TYPE_SIZE LONG_TYPE_SIZE
53 #define MAX_WCHAR_TYPE_SIZE MAX_LONG_TYPE_SIZE
55 #define WORD_SWITCH_TAKES_ARG(STR) \
56 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
57 || !strcmp (STR, "rpath"))
59 #undef SUBTARGET_CC1_SPEC
60 #define SUBTARGET_CC1_SPEC "%{static: -mno-abicalls}"
62 /* ??? _MIPS_SIM and _MIPS_SZPTR should eventually depend on options when
63 options for them exist. */
65 #undef CPP_PREDEFINES
66 #define CPP_PREDEFINES \
67 "-Dunix -Dmips -Dsgi -Dhost_mips -DMIPSEB -D_MIPSEB -DSYSTYPE_SVR4 \
68 -D_SVR4_SOURCE -D_MODERN_C -D__DSO__ \
69 -D_MIPS_SIM=_MIPS_SIM_ABI32 -D_MIPS_SZPTR=32 \
70 -Asystem(unix) -Asystem(svr4) -Acpu(mips) -Amachine(sgi)"
72 #undef SUBTARGET_CPP_SPEC
73 #define SUBTARGET_CPP_SPEC "\
74 %{!ansi:-D__EXTENSIONS__ -D_SGI_SOURCE -D_LONGLONG} \
75 %{!mfp64: -D_MIPS_FPSET=16}%{mfp64: -D_MIPS_FPSET=32} \
76 %{mips1: -D_MIPS_ISA=_MIPS_ISA_MIPS1} \
77 %{mips2: -D_MIPS_ISA=_MIPS_ISA_MIPS2} \
78 %{mips3: -D_MIPS_ISA=_MIPS_ISA_MIPS3} \
79 %{!mips1: %{!mips2: %{!mips3: -D_MIPS_ISA=_MIPS_ISA_MIPS1}}} \
80 %{!mint64: -D_MIPS_SZINT=32}%{mint64: -D_MIPS_SZINT=64} \
81 %{!mlong64: -D_MIPS_SZLONG=32}%{mlong64: -D_MIPS_SZLONG=64}"
83 #undef LINK_SPEC
84 #define LINK_SPEC "\
85 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \
86 %{bestGnum} %{shared} %{non_shared} \
87 %{call_shared} %{no_archive} %{exact_version} \
88 %{static: -non_shared} \
89 %{!static: \
90 %{!shared:%{!non_shared:%{!call_shared: -call_shared -no_unresolved}}}} \
91 %{rpath} \
92 -_SYSTYPE_SVR4"
94 /* We now support shared libraries. */
95 #undef STARTFILE_SPEC
96 #define STARTFILE_SPEC "\
97 %{!static: \
98 %{!shared:%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}}} \
99 %{static: \
100 %{pg:gcrt1.o%s} \
101 %{!pg:%{p:/usr/lib/nonshared/mcrt1.o%s libprof1.a%s} \
102 %{!p:/usr/lib/nonshared/crt1.o%s}}}"
104 #undef LIB_SPEC
105 #define LIB_SPEC "%{!shared:%{p:-lprof1} %{pg:-lprof1} -lc}"
107 #undef ENDFILE_SPEC
108 #define ENDFILE_SPEC "%{!shared:crtn.o%s}"
110 /* We do not want to run mips-tfile! */
111 #undef ASM_FINAL_SPEC
113 /* The system header files are C++ aware. */
114 /* ??? Unfortunately, most but not all of the headers are C++ aware.
115 Specifically, curses.h is not, and as a consequence, defining this
116 used to prevent libg++ building. This is no longer the case so
117 define it again to prevent other problems, e.g. with getopt in
118 unistd.h. We still need some way to fix just those files that need
119 fixing. */
120 #define NO_IMPLICIT_EXTERN_C 1
122 /* We don't support debugging info for now. */
123 #undef DBX_DEBUGGING_INFO
124 #undef SDB_DEBUGGING_INFO
125 #undef MIPS_DEBUGGING_INFO
127 /* Likewise, the assembler doesn't handle DWARF2 directives. */
128 #define DWARF2_UNWIND_INFO 0
130 #undef MACHINE_TYPE
131 #define MACHINE_TYPE "SGI running IRIX 5.x"
133 /* Dollar signs are OK in Irix5 but not in Irix3. */
134 #undef DOLLARS_IN_IDENTIFIERS
135 #undef NO_DOLLAR_IN_LABEL
137 /* -G is incompatible with -KPIC which is the default, so only allow objects
138 in the small data section if the user explicitly asks for it. */
139 #undef MIPS_DEFAULT_GVALUE
140 #define MIPS_DEFAULT_GVALUE 0
142 /* In Irix 5, we must output a `.global name .text' directive for every used
143 but undefined function. If we don't, the linker may perform an optimization
144 (skipping over the insns that set $gp) when it is unsafe. This is used
145 indirectly by ASM_OUTPUT_EXTERNAL. */
146 #define ASM_OUTPUT_UNDEF_FUNCTION(FILE, NAME) \
147 do { \
148 fputs ("\t.globl ", FILE); \
149 assemble_name (FILE, NAME); \
150 fputs (" .text\n", FILE); \
151 } while (0)
153 /* Also do this for libcalls. */
154 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
155 mips_output_external_libcall (FILE, XSTR (FUN, 0))
157 /* This does for functions what ASM_DECLARE_OBJECT_NAME does for variables.
158 This is used indirectly by ASM_OUTPUT_EXTERNAL. */
159 #define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL) \
160 do { \
161 tree name_tree = get_identifier (NAME); \
162 TREE_ASM_WRITTEN (name_tree) = 1; \
163 } while (0)