OSDN Git Service

* target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op,
[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,
3    2001 Free Software Foundation, Inc.
4
5 This file is part of GNU CC.
6
7 GNU CC 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 2, or (at your option)
10 any later version.
11
12 GNU CC 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.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 #define TARGET_IRIX5 1
23
24 #ifndef TARGET_DEFAULT
25 #define TARGET_DEFAULT  MASK_ABICALLS
26 #endif
27 #define ABICALLS_ASM_OP "\t.option pic2"
28
29 #include "mips/iris3.h"
30 #include "mips/mips.h"
31 #include "mips/iris4.h"
32
33 /* Irix 5 doesn't use COFF, so disable special COFF handling in collect2.c.  */
34 #undef OBJECT_FORMAT_COFF
35
36 /* ??? This is correct, but not very useful, because there is no file that
37    uses this macro.  */
38 /* ??? The best way to handle global constructors under ELF is to use .init
39    and .fini sections.  Unfortunately, there is apparently no way to get
40    the Irix 5.x (x <= 2) assembler to create these sections.  So we instead
41    use collect.  The linker can create these sections via -init and -fini
42    options, but using this would require modifying how crtstuff works, and
43    I will leave that for another time (or someone else).  */
44 #define OBJECT_FORMAT_ELF
45 #define HAS_INIT_SECTION
46 #define LD_INIT_SWITCH "-init"
47 #define LD_FINI_SWITCH "-fini"
48
49 /* The linker needs a space after "-o".  */
50 #define SWITCHES_NEED_SPACES "o"
51
52 /* Specify wchar_t types.  */
53 #undef  WCHAR_TYPE
54 #undef  WCHAR_TYPE_SIZE
55 #undef  MAX_WCHAR_TYPE_SIZE
56
57 #define WCHAR_TYPE     "int"
58 #define WCHAR_TYPE_SIZE        INT_TYPE_SIZE
59 #define MAX_WCHAR_TYPE_SIZE    MAX_INT_TYPE_SIZE
60
61 #define WORD_SWITCH_TAKES_ARG(STR)                      \
62  (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)                   \
63   || !strcmp (STR, "rpath"))
64
65 #undef SUBTARGET_CC1_SPEC
66 #define SUBTARGET_CC1_SPEC "%{static: -mno-abicalls}"
67
68 /* ??? _MIPS_SIM and _MIPS_SZPTR should eventually depend on options when
69    options for them exist.  */
70
71 #undef CPP_PREDEFINES
72 #define CPP_PREDEFINES \
73  "-Dunix -Dmips -Dsgi -Dhost_mips -DMIPSEB -D_MIPSEB -DSYSTYPE_SVR4 \
74   -D_SVR4_SOURCE -D_MODERN_C -D__DSO__ \
75   -D_MIPS_SIM=_MIPS_SIM_ABI32 -D_MIPS_SZPTR=32 \
76   -Asystem=unix -Asystem=svr4 -Acpu=mips -Amachine=sgi"
77
78 #undef SUBTARGET_CPP_SPEC
79 #define SUBTARGET_CPP_SPEC "\
80 %{!ansi:-D__EXTENSIONS__ -D_SGI_SOURCE -D_LONGLONG} \
81 %{!mfp64: -D_MIPS_FPSET=16}%{mfp64: -D_MIPS_FPSET=32} \
82 %{mips1: -D_MIPS_ISA=_MIPS_ISA_MIPS1} \
83 %{mips2: -D_MIPS_ISA=_MIPS_ISA_MIPS2} \
84 %{mips3: -D_MIPS_ISA=_MIPS_ISA_MIPS3} \
85 %{!mips1: %{!mips2: %{!mips3: -D_MIPS_ISA=_MIPS_ISA_MIPS1}}} \
86 %{!mint64: -D_MIPS_SZINT=32}%{mint64: -D_MIPS_SZINT=64} \
87 %{!mlong64: -D_MIPS_SZLONG=32}%{mlong64: -D_MIPS_SZLONG=64}"
88
89 #undef LINK_SPEC
90 #define LINK_SPEC "\
91 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \
92 %{bestGnum} %{shared} %{non_shared} \
93 %{call_shared} %{no_archive} %{exact_version} \
94 %{static: -non_shared} \
95 %{!static: \
96   %{!shared:%{!non_shared:%{!call_shared: -call_shared -no_unresolved}}}} \
97 %{rpath} \
98 -_SYSTYPE_SVR4"
99
100 /* We now support shared libraries.  */
101 #undef STARTFILE_SPEC
102 #define STARTFILE_SPEC "\
103 %{!static: \
104   %{!shared:%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}}} \
105 %{static: \
106   %{pg:gcrt1.o%s} \
107   %{!pg:%{p:/usr/lib/nonshared/mcrt1.o%s libprof1.a%s} \
108   %{!p:/usr/lib/nonshared/crt1.o%s}}}"
109
110 #undef LIB_SPEC
111 #define LIB_SPEC "%{!shared:%{p:-lprof1} %{pg:-lprof1} -lc}"
112
113 #undef ENDFILE_SPEC
114 #define ENDFILE_SPEC "%{!shared:crtn.o%s}"
115
116 /* We do not want to run mips-tfile!  */
117 #undef ASM_FINAL_SPEC
118
119 /* The system header files are C++ aware.  */
120 /* ??? Unfortunately, most but not all of the headers are C++ aware.
121    Specifically, curses.h is not, and as a consequence, defining this
122    used to prevent libg++ building.  This is no longer the case so
123    define it again to prevent other problems, e.g. with getopt in
124    unistd.h.  We still need some way to fix just those files that need
125    fixing.  */
126 #define NO_IMPLICIT_EXTERN_C 1
127
128 /* We don't support debugging info for now.  */
129 #undef DBX_DEBUGGING_INFO
130 #undef SDB_DEBUGGING_INFO
131 #undef MIPS_DEBUGGING_INFO
132 #undef PREFERRED_DEBUGGING_TYPE
133
134 /* Likewise, the assembler doesn't handle DWARF2 directives.  */
135 #define DWARF2_UNWIND_INFO 0
136
137 #undef MACHINE_TYPE
138 #define MACHINE_TYPE "SGI running IRIX 5.x"
139
140  /* Dollar signs are OK in Irix5 but not in Irix3.  */
141 #undef DOLLARS_IN_IDENTIFIERS
142 #undef NO_DOLLAR_IN_LABEL
143
144 /* -G is incompatible with -KPIC which is the default, so only allow objects
145    in the small data section if the user explicitly asks for it.  */
146 #undef MIPS_DEFAULT_GVALUE
147 #define MIPS_DEFAULT_GVALUE 0
148
149 /* In Irix 5, we must output a `.global name .text' directive for every used
150    but undefined function.  If we don't, the linker may perform an optimization
151    (skipping over the insns that set $gp) when it is unsafe.  This is used
152    indirectly by ASM_OUTPUT_EXTERNAL.  */
153 #define ASM_OUTPUT_UNDEF_FUNCTION(FILE, NAME)   \
154 do {                                            \
155   fputs ("\t.globl ", FILE);                    \
156   assemble_name (FILE, NAME);                   \
157   fputs (" .text\n", FILE);                     \
158 } while (0)
159
160 /* Also do this for libcalls.  */
161 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)  \
162   mips_output_external_libcall (FILE, XSTR (FUN, 0))
163
164 /* This does for functions what ASM_DECLARE_OBJECT_NAME does for variables.
165    This is used indirectly by ASM_OUTPUT_EXTERNAL.  */
166 #define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL)   \
167 do {                                                    \
168   tree name_tree = get_identifier (NAME);               \
169   TREE_ASM_WRITTEN (name_tree) = 1;                     \
170 } while (0)
171
172 /* This is how we tell the assembler that a symbol is weak.  */
173
174 #define ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, VALUE)        \
175   do                                                    \
176     {                                                   \
177       ASM_GLOBALIZE_LABEL (FILE, NAME);                 \
178       fputs ("\t.weakext\t", FILE);                     \
179       assemble_name (FILE, NAME);                       \
180       if (VALUE)                                        \
181         {                                               \
182           fputc (' ', FILE);                            \
183           assemble_name (FILE, VALUE);                  \
184         }                                               \
185       fputc ('\n', FILE);                               \
186     }                                                   \
187   while (0)
188
189 #define ASM_WEAKEN_LABEL(FILE, NAME) ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, 0)
190
191 /* Handle #pragma weak and #pragma pack.  */
192 #undef HANDLE_SYSV_PRAGMA
193 #define HANDLE_SYSV_PRAGMA 1