OSDN Git Service

config:
[pf3gnuchains/gcc-fork.git] / gcc / config / mips / iris5.h
1 /* Definitions of target machine for GNU compiler.  Iris version 5.
2    Copyright (C) 1993, 1995, 1996, 1998, 2000 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
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.
10
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.
15
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.  */
20
21 #ifndef TARGET_DEFAULT
22 #define TARGET_DEFAULT  MASK_ABICALLS
23 #endif
24 #define ABICALLS_ASM_OP "\t.option pic2"
25
26 #include "mips/iris3.h"
27 #include "mips/mips.h"
28 #include "mips/iris4.h"
29
30 /* Irix 5 doesn't use COFF, so disable special COFF handling in collect2.c.  */
31 #undef OBJECT_FORMAT_COFF
32
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"
45
46 /* The linker needs a space after "-o".  */
47 #define SWITCHES_NEED_SPACES "o"
48
49 /* Specify wchar_t types.  */
50 #undef  WCHAR_TYPE
51 #undef  WCHAR_TYPE_SIZE
52 #undef  MAX_WCHAR_TYPE_SIZE
53
54 #define WCHAR_TYPE      "long int"
55 #define WCHAR_TYPE_SIZE LONG_TYPE_SIZE
56 #define MAX_WCHAR_TYPE_SIZE     MAX_LONG_TYPE_SIZE
57
58 #define WORD_SWITCH_TAKES_ARG(STR)                      \
59  (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)                   \
60   || !strcmp (STR, "rpath"))
61
62 #undef SUBTARGET_CC1_SPEC
63 #define SUBTARGET_CC1_SPEC "%{static: -mno-abicalls}"
64
65 /* ??? _MIPS_SIM and _MIPS_SZPTR should eventually depend on options when
66    options for them exist.  */
67
68 #undef CPP_PREDEFINES
69 #define CPP_PREDEFINES \
70  "-Dunix -Dmips -Dsgi -Dhost_mips -DMIPSEB -D_MIPSEB -DSYSTYPE_SVR4 \
71   -D_SVR4_SOURCE -D_MODERN_C -D__DSO__ \
72   -D_MIPS_SIM=_MIPS_SIM_ABI32 -D_MIPS_SZPTR=32 \
73   -Asystem=unix -Asystem=svr4 -Acpu=mips -Amachine=sgi"
74
75 #undef SUBTARGET_CPP_SPEC
76 #define SUBTARGET_CPP_SPEC "\
77 %{!ansi:-D__EXTENSIONS__ -D_SGI_SOURCE -D_LONGLONG} \
78 %{!mfp64: -D_MIPS_FPSET=16}%{mfp64: -D_MIPS_FPSET=32} \
79 %{mips1: -D_MIPS_ISA=_MIPS_ISA_MIPS1} \
80 %{mips2: -D_MIPS_ISA=_MIPS_ISA_MIPS2} \
81 %{mips3: -D_MIPS_ISA=_MIPS_ISA_MIPS3} \
82 %{!mips1: %{!mips2: %{!mips3: -D_MIPS_ISA=_MIPS_ISA_MIPS1}}} \
83 %{!mint64: -D_MIPS_SZINT=32}%{mint64: -D_MIPS_SZINT=64} \
84 %{!mlong64: -D_MIPS_SZLONG=32}%{mlong64: -D_MIPS_SZLONG=64}"
85
86 #undef LINK_SPEC
87 #define LINK_SPEC "\
88 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \
89 %{bestGnum} %{shared} %{non_shared} \
90 %{call_shared} %{no_archive} %{exact_version} \
91 %{static: -non_shared} \
92 %{!static: \
93   %{!shared:%{!non_shared:%{!call_shared: -call_shared -no_unresolved}}}} \
94 %{rpath} \
95 -_SYSTYPE_SVR4"
96
97 /* We now support shared libraries.  */
98 #undef STARTFILE_SPEC
99 #define STARTFILE_SPEC "\
100 %{!static: \
101   %{!shared:%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}}} \
102 %{static: \
103   %{pg:gcrt1.o%s} \
104   %{!pg:%{p:/usr/lib/nonshared/mcrt1.o%s libprof1.a%s} \
105   %{!p:/usr/lib/nonshared/crt1.o%s}}}"
106
107 #undef LIB_SPEC
108 #define LIB_SPEC "%{!shared:%{p:-lprof1} %{pg:-lprof1} -lc}"
109
110 #undef ENDFILE_SPEC
111 #define ENDFILE_SPEC "%{!shared:crtn.o%s}"
112
113 /* We do not want to run mips-tfile!  */
114 #undef ASM_FINAL_SPEC
115
116 /* The system header files are C++ aware. */
117 /* ??? Unfortunately, most but not all of the headers are C++ aware.
118    Specifically, curses.h is not, and as a consequence, defining this
119    used to prevent libg++ building.  This is no longer the case so
120    define it again to prevent other problems, e.g. with getopt in
121    unistd.h.  We still need some way to fix just those files that need
122    fixing.  */
123 #define NO_IMPLICIT_EXTERN_C 1
124
125 /* We don't support debugging info for now. */
126 #undef DBX_DEBUGGING_INFO
127 #undef SDB_DEBUGGING_INFO
128 #undef MIPS_DEBUGGING_INFO
129 #undef PREFERRED_DEBUGGING_TYPE
130
131 /* Likewise, the assembler doesn't handle DWARF2 directives.  */
132 #define DWARF2_UNWIND_INFO 0
133
134 #undef MACHINE_TYPE
135 #define MACHINE_TYPE "SGI running IRIX 5.x"
136
137  /* Dollar signs are OK in Irix5 but not in Irix3.  */
138 #undef DOLLARS_IN_IDENTIFIERS
139 #undef NO_DOLLAR_IN_LABEL
140
141 /* -G is incompatible with -KPIC which is the default, so only allow objects
142    in the small data section if the user explicitly asks for it.  */
143 #undef MIPS_DEFAULT_GVALUE
144 #define MIPS_DEFAULT_GVALUE 0
145
146 /* In Irix 5, we must output a `.global name .text' directive for every used
147    but undefined function.  If we don't, the linker may perform an optimization
148    (skipping over the insns that set $gp) when it is unsafe.  This is used
149    indirectly by ASM_OUTPUT_EXTERNAL.  */
150 #define ASM_OUTPUT_UNDEF_FUNCTION(FILE, NAME)   \
151 do {                                            \
152   fputs ("\t.globl ", FILE);                    \
153   assemble_name (FILE, NAME);                   \
154   fputs (" .text\n", FILE);                     \
155 } while (0)
156
157 /* Also do this for libcalls.  */
158 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)  \
159   mips_output_external_libcall (FILE, XSTR (FUN, 0))
160
161 /* This does for functions what ASM_DECLARE_OBJECT_NAME does for variables.
162    This is used indirectly by ASM_OUTPUT_EXTERNAL.  */
163 #define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL)   \
164 do {                                                    \
165   tree name_tree = get_identifier (NAME);               \
166   TREE_ASM_WRITTEN (name_tree) = 1;                     \
167 } while (0)