OSDN Git Service

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