OSDN Git Service

* config/i386/i386.md ("*sse_prologue_save_insn"): Use braced output
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / sco5.h
1 /* Definitions for Intel 386 running SCO Unix System V 3.2 Version 5.
2    Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004,
3    2007 Free Software Foundation, Inc.
4    Contributed by Kean Johnston (jkj@sco.com)
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
12
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3.  If not see
20 <http://www.gnu.org/licenses/>.  */
21
22 #undef TARGET_VERSION
23 #define TARGET_VERSION fprintf (stderr, " (i386, SCO OpenServer 5 Syntax)");
24
25 #undef ASM_QUAD
26
27 #undef GLOBAL_ASM_OP
28 #define GLOBAL_ASM_OP                   "\t.globl\t"
29
30 #undef BSS_SECTION_ASM_OP
31 #define BSS_SECTION_ASM_OP              "\t.section\t.bss, \"aw\", @nobits"
32   
33 /*
34  * NOTE: We really do want CTORS_SECTION_ASM_OP and DTORS_SECTION_ASM_OP.
35  * Here's the reason why. If we dont define them, and we dont define them
36  * to always emit to the same section, the default is to emit to "named"
37  * ctors and dtors sections. This would be great if we could use GNU ld,
38  * but we can't. The native linker could possibly be trained to coalesce
39  * named ctors sections, but that hasn't been done either. So if we don't
40  * define these, many C++ ctors and dtors dont get run, because they never
41  * wind up in the ctors/dtors arrays.
42  */
43 #define CTORS_SECTION_ASM_OP            "\t.section\t.ctors, \"aw\""
44 #define DTORS_SECTION_ASM_OP            "\t.section\t.dtors, \"aw\""
45
46 #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
47 #undef X86_FILE_START_VERSION_DIRECTIVE
48 #define X86_FILE_START_VERSION_DIRECTIVE true
49
50 /* A C statement (sans semicolon) to output to the stdio stream
51    FILE the assembler definition of uninitialized global DECL named
52    NAME whose size is SIZE bytes and alignment is ALIGN bytes.
53    Try to use asm_output_aligned_bss to implement this macro.  */
54
55 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
56   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
57
58 #undef DBX_REGISTER_NUMBER
59 #define DBX_REGISTER_NUMBER(n)  svr4_dbx_register_map[n]
60
61 #define DWARF2_DEBUGGING_INFO           1
62 #define DBX_DEBUGGING_INFO              1
63
64 #undef PREFERRED_DEBUGGING_TYPE
65 #define PREFERRED_DEBUGGING_TYPE        DWARF2_DEBUG
66
67 #undef DWARF2_UNWIND_INFO
68 #define DWARF2_UNWIND_INFO              1
69
70 #undef NO_IMPLICIT_EXTERN_C
71 #define NO_IMPLICIT_EXTERN_C            1
72
73 #undef SWITCH_TAKES_ARG
74 #define SWITCH_TAKES_ARG(CHAR)                                          \
75   (DEFAULT_SWITCH_TAKES_ARG(CHAR)                                       \
76    || (CHAR) == 'h'                                                     \
77    || (CHAR) == 'R'                                                     \
78    || (CHAR) == 'Y'                                                     \
79    || (CHAR) == 'z')
80
81 #undef WORD_SWITCH_TAKES_ARG
82 #define WORD_SWITCH_TAKES_ARG(STR)                                      \
83  (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)                                   \
84   && strcmp (STR, "Tdata") && strcmp (STR, "Ttext")                     \
85   && strcmp (STR, "Tbss"))
86
87 #undef TARGET_SUBTARGET_DEFAULT
88 #define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
89
90 /*
91  * Define sizes and types
92  */
93 #undef SIZE_TYPE
94 #undef PTRDIFF_TYPE
95 #undef WCHAR_TYPE
96 #undef WCHAR_TYPE_SIZE
97 #undef WINT_TYPE
98 #define SIZE_TYPE               "unsigned int"
99 #define PTRDIFF_TYPE            "int"
100 #define WCHAR_TYPE              "long int"
101 #define WCHAR_TYPE_SIZE         BITS_PER_WORD
102 #define WINT_TYPE               "long int"
103
104 /*
105  * New for multilib support. Set the default switches for multilib,
106  * which is -melf.
107  */
108 #define MULTILIB_DEFAULTS { "melf" }
109
110 \f
111 /* Please note that these specs may look messy but they are required in
112    order to emulate the SCO Development system as closely as possible.
113    With SCO Open Server 5.0, you now get the linker and assembler free,
114    so that is what these specs are targeted for. These utilities are
115    very argument sensitive: a space in the wrong place breaks everything.
116    So please forgive this mess. It works.
117
118    Parameters which can be passed to gcc, and their SCO equivalents:
119    GCC Parameter                SCO Equivalent
120    -ansi                        -a ansi
121    -posix                       -a posix
122    -Xpg4                        -a xpg4
123    -Xpg4plus                    -a xpg4plus
124    -Xods30                      -a ods30
125
126    As with SCO, the default is XPG4 plus mode. SCO also allows you to
127    specify a C dialect with -Xt, -Xa, -Xc, -Xk and -Xm. These are passed
128    on to the assembler and linker in the same way that the SCO compiler
129    does.
130
131    SCO also allows you to compile, link and generate either ELF or COFF
132    binaries. With gcc, we now only support ELF mode.
133
134    GCC also requires that the user has installed OSS646, the Execution
135    Environment Update, or is running release 5.0.7 or later. This has
136    many fixes to the ELF link editor and assembler, and a considerably
137    improved libc and RTLD.
138
139    In terms of tool usage, we want to use the standard link editor always,
140    and either the GNU assembler or the native assembler. With OSS646 the
141    native assembler has grown up quite a bit. Some of the specs below
142    assume that /usr/gnu is the prefix for the GNU tools, because thats
143    where the SCO provided ones go. This is especially important for
144    include and library search path ordering. We want to look in /usr/gnu
145    first because frequently people are linking against -lintl, and they
146    MEAN to link with gettext. What they get is the SCO intl library. Its
147    a REAL pity that GNU gettext chose that name; perhaps in a future
148    version they can be persuaded to change it to -lgnuintl and have a
149    link so that -lintl will work for other systems. The same goes for
150    header files. We want /usr/gnu/include searched for before the system
151    header files. Hence the -isystem /usr/gnu/include in the CPP_SPEC.
152    We get /usr/gnu/lib first by virtue of the MD_STARTFILE_PREFIX below.
153 */
154
155 #define MD_STARTFILE_PREFIX     "/usr/gnu/lib/"
156 #define MD_STARTFILE_PREFIX_1   "/usr/ccs/lib/"
157
158 #if USE_GAS
159 # define MD_EXEC_PREFIX         "/usr/gnu/bin/"
160 #else
161 # define MD_EXEC_PREFIX         "/usr/ccs/bin/elf/"
162 #endif
163
164 /* Always use the system linker, please.  */
165 #ifndef DEFAULT_LINKER
166 # define DEFAULT_LINKER         "/usr/ccs/bin/elf/ld"
167 #endif
168
169 /* Set up assembler flags for PIC and ELF compilations */
170 #undef ASM_SPEC
171
172 #if USE_GAS
173   /* Leave ASM_SPEC undefined so we pick up the master copy from gcc.c  */
174 #else
175 #define ASM_SPEC \
176    "%{Ym,*} %{Yd,*} %{Wa,*:%*} \
177     -E%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},ELF %{Qn:} %{!Qy:-Qn}"
178 #endif
179
180 /*
181  * Use crti.o for shared objects, crt1.o for normal executables. Make sure
182  * to recognize both -G and -shared as a valid way of introducing shared
183  * library generation. This is important for backwards compatibility.
184  */
185
186 #undef STARTFILE_SPEC
187 #define STARTFILE_SPEC \
188  "%{pg:%e-pg not supported on this platform} \
189   %{p:%{pp:%e-p and -pp specified - pick one}} \
190  %{!shared:\
191    %{!symbolic: \
192     %{!G: \
193      %{pp:pcrt1elf.o%s}%{p:mcrt1.o%s}%{!p:%{!pp:crt1.o%s}}}}} \
194   crti.o%s \
195   %{ansi:values-Xc.o%s} \
196   %{!ansi: \
197    %{traditional:values-Xt.o%s} \
198     %{!traditional: \
199      %{Xa:values-Xa.o%s} \
200       %{!Xa:%{Xc:values-Xc.o%s} \
201        %{!Xc:%{Xk:values-Xk.o%s} \
202         %{!Xk:%{Xt:values-Xt.o%s} \
203          %{!Xt:values-Xa.o%s}}}}}} \
204   crtbegin.o%s"
205
206 #undef ENDFILE_SPEC
207 #define ENDFILE_SPEC \
208  "crtend.o%s crtn.o%s"
209
210 #define TARGET_OS_CPP_BUILTINS()                                \
211   do                                                            \
212     {                                                           \
213         builtin_define ("__unix");                              \
214         builtin_define ("_SCO_DS");                             \
215         builtin_define ("_SCO_DS_LL");                          \
216         builtin_define ("_SCO_ELF");                            \
217         builtin_define ("_M_I386");                             \
218         builtin_define ("_M_XENIX");                            \
219         builtin_define ("_M_UNIX");                             \
220         builtin_assert ("system=svr3");                         \
221         if (flag_iso)                                           \
222           cpp_define (pfile, "_STRICT_ANSI");                   \
223     }                                                           \
224   while (0)
225
226 #undef CPP_SPEC
227 #define CPP_SPEC "\
228   -isystem /usr/gnu/include \
229   %{!Xods30:-D_STRICT_NAMES} \
230   %{!ansi:%{!posix:%{!Xods30:-D_SCO_XPG_VERS=4}}} \
231   %{ansi:-isystem include/ansi%s -isystem /usr/include/ansi} \
232   %{!ansi: \
233    %{posix:-isystem include/posix%s -isystem /usr/include/posix \
234            -D_POSIX_C_SOURCE=2 -D_POSIX_SOURCE=1} \
235     %{!posix:%{Xpg4:-isystem include/xpg4%s -isystem /usr/include/xpg4 \
236                     -D_XOPEN_SOURCE=1} \
237      %{!Xpg4:-D_M_I86 -D_M_I86SM -D_M_INTERNAT -D_M_SDATA -D_M_STEXT \
238              -D_M_BITFIELDS -D_M_SYS5 -D_M_SYSV -D_M_SYSIII \
239              -D_M_WORDSWAP -Dunix -DM_I386 -DM_UNIX -DM_XENIX \
240              %{Xods30:-isystem include/ods_30_compat%s \
241                       -isystem /usr/include/ods_30_compat \
242                       -D_SCO_ODS_30 -DM_I86 -DM_I86SM -DM_SDATA -DM_STEXT \
243                       -DM_BITFIELDS -DM_SYS5 -DM_SYSV -DM_INTERNAT -DM_SYSIII \
244                       -DM_WORDSWAP}}}} \
245   %{scointl:-DM_INTERNAT -D_M_INTERNAT} \
246   %{Xa:-D_SCO_C_DIALECT=1} \
247   %{!Xa:%{Xc:-D_SCO_C_DIALECT=3} \
248    %{!Xc:%{Xk:-D_SCO_C_DIALECT=4} \
249     %{!Xk:%{Xt:-D_SCO_C_DIALECT=2} \
250      %{!Xt:-D_SCO_C_DIALECT=1}}}}"
251
252 #undef LINK_SPEC
253 #define LINK_SPEC \
254  "%{!shared:%{!symbolic:%{!G:-E%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},ELF}}} \
255   %{YP,*} %{YL,*} %{YU,*} \
256   %{!YP,*:%{p:-YP,/usr/ccs/libp:/lib/libp:/usr/lib/libp:/usr/ccs/lib:/lib:/usr/lib} \
257    %{!p:-YP,/usr/ccs/lib:/lib:/usr/lib}} \
258   %{h*} %{static:-dn -Bstatic %{G:%e-G and -static are mutually exclusive}} \
259   %{shared:%{!G:-G}} %{G:%{!shared:-G}} %{shared:%{G:-G}} \
260   %{shared:-dy %{symbolic:-Bsymbolic -G} %{z*}} %{R*} %{Y*} \
261   %{Qn:} %{!Qy:-Qn} -z alt_resolve"
262
263 /* Library spec. If we are not building a shared library, provide the
264    standard libraries, as per the SCO compiler.  */
265
266 #undef LIB_SPEC
267 #define LIB_SPEC \
268  "%{shared:%{!G:pic/libgcc.a%s}} \
269   %{G:%{!shared:pic/libgcc.a%s}} \
270   %{shared:%{G:pic/libgcc.a%s}} \
271   %{p:%{!pp:-lelfprof -lelf}} %{pp:%{!p:-lelfprof -lelf}} \
272   %{!shared:%{!symbolic:%{!G:-lcrypt -lgen -lc}}}"
273
274 #undef LIBGCC_SPEC
275 #define LIBGCC_SPEC \
276  "%{!shared:%{!G:-lgcc}}"
277
278 /* Handle special EH pointer encodings.  Absolute, pc-relative, and
279    indirect are handled automatically.  */
280 #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
281   do {                                                                  \
282     if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel)         \
283       {                                                                 \
284         fputs (ASM_LONG, FILE);                                         \
285         assemble_name (FILE, XSTR (ADDR, 0));                           \
286         fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
287         goto DONE;                                                      \
288       }                                                                 \
289   } while (0)
290
291 /* Used by crtstuff.c to initialize the base of data-relative relocations.
292    These are GOT relative on x86, so return the pic register.  */
293 #ifdef __PIC__
294 #define CRT_GET_RFIB_DATA(BASE)                 \
295   {                                             \
296     register void *ebx_ __asm__("ebx");         \
297     BASE = ebx_;                                \
298   }
299 #else
300 #define CRT_GET_RFIB_DATA(BASE)                                         \
301   __asm__ ("call\t.LPR%=\n"                                             \
302            ".LPR%=:\n\t"                                                \
303            "pop{l}\t%0\n\t"                                             \
304            /* Due to a GAS bug, this cannot use EAX.  That encodes      \
305               smaller than the traditional EBX, which results in the    \
306               offset being off by one.  */                              \
307            "add{l}\t{$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0"              \
308                    "|%0,_GLOBAL_OFFSET_TABLE_+(.-.LPR%=)}"              \
309            : "=d"(BASE))
310 #endif
311