OSDN Git Service

PR c/5972
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / sol2.h
1 /* Target definitions for GNU compiler for Intel 80386 running Solaris 2
2    Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
3    Free Software Foundation, Inc.
4    Contributed by Fred Fish (fnf@cygnus.com).
5
6 This file is part of GNU CC.
7
8 GNU CC 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 2, or (at your option)
11 any later version.
12
13 GNU CC 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 GNU CC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.  */
22
23
24 /* We use stabs-in-elf for debugging, because that is what the native
25    toolchain uses.  */
26 #undef PREFERRED_DEBUGGING_TYPE
27 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
28
29 #if ! GAS_REJECTS_MINUS_S
30
31 /*
32   Changed from config/svr4.h in the following ways:
33
34   - Removed -Yd (neither the sun bundled assembler nor gas accept it).
35   - Added "-s" so that stabs are not discarded.
36 */
37
38 #undef ASM_SPEC
39 #define ASM_SPEC \
40   "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s"
41
42 #define CMOV_SUN_AS_SYNTAX 1
43
44 #else /* GAS_REJECTS_MINUS_S */
45
46 /* Same as above, except for -s, unsupported by GNU as.  */
47 #undef ASM_SPEC
48 #define ASM_SPEC \
49   "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*}"
50
51 #endif /* GAS_REJECTS_MINUS_S */
52
53 /* The Solaris 2.0 x86 linker botches alignment of code sections.
54    It tries to align to a 16 byte boundary by padding with 0x00000090
55    ints, rather than 0x90 bytes (nop).  This generates trash in the
56    ".init" section since the contribution from crtbegin.o is only 7
57    bytes.  The linker pads it to 16 bytes with a single 0x90 byte, and
58    two 0x00000090 ints, which generates a segmentation violation when
59    executed.  This macro forces the assembler to do the padding, since
60    it knows what it is doing.  */
61 #define FORCE_CODE_SECTION_ALIGN  asm(ALIGN_ASM_OP "16");
62
63 /* Select a format to encode pointers in exception handling data.  CODE
64    is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
65    true if the symbol may be affected by dynamic relocations.  */
66 #undef ASM_PREFERRED_EH_DATA_FORMAT
67 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)                       \
68   (flag_pic ? (GLOBAL ? DW_EH_PE_indirect : 0) | DW_EH_PE_datarel       \
69    : DW_EH_PE_absptr)
70
71 /* Solaris 2/Intel uses a wint_t different from the default, as on SPARC.  */
72 #undef  WINT_TYPE
73 #define WINT_TYPE "long int"
74
75 #undef  WINT_TYPE_SIZE
76 #define WINT_TYPE_SIZE BITS_PER_WORD
77
78 /* Add "sun" to the list of symbols defined for SVR4.  */
79 #undef CPP_PREDEFINES
80 #define CPP_PREDEFINES \
81   "-Dunix -D__svr4__ -D__SVR4 -Dsun -Asystem=svr4"
82
83 /* Solaris 2/Intel as chokes on #line directives.  */
84 #undef CPP_SPEC
85 #define CPP_SPEC \
86   "%{.S:-P} \
87    %(cpp_cpu) \
88    %{pthreads:-D_REENTRANT -D_PTHREADS} \
89    %{!pthreads:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}} \
90    %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}"
91
92 /* For C++ we need to add some additional macro definitions required
93    by the C++ standard library.  */
94 #define CPLUSPLUS_CPP_SPEC "\
95 -D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 \
96 -D__EXTENSIONS__ \
97 %(cpp) \
98 "
99
100 #undef LIB_SPEC
101 #define LIB_SPEC \
102   "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \
103    %{!shared:\
104      %{!symbolic:\
105        %{pthreads:-lpthread} \
106        %{!pthreads:%{threads:-lthread}} \
107        -lc}}"
108
109 #undef  ENDFILE_SPEC
110 #define ENDFILE_SPEC "crtend.o%s %{pg:crtn.o%s}%{!pg:crtn.o%s}"
111
112 #undef  STARTFILE_SPEC
113 #define STARTFILE_SPEC "%{!shared: \
114                          %{!symbolic: \
115                           %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}}\
116                         %{pg:gmon.o%s} crti.o%s \
117                         %{ansi:values-Xc.o%s} \
118                         %{!ansi:values-Xa.o%s} \
119                         crtbegin.o%s"
120   
121 /* This should be the same as in svr4.h, except with -R added.  */
122 #undef LINK_SPEC
123 #define LINK_SPEC \
124   "%{h*} %{v:-V} \
125    %{b} %{Wl,*:%*} \
126    %{static:-dn -Bstatic} \
127    %{shared:-G -dy %{!mimpure-text:-z text}} \
128    %{symbolic:-Bsymbolic -G -dy -z text} \
129    %{G:-G} \
130    %{YP,*} \
131    %{R*} \
132    %{compat-bsd: \
133      %{!YP,*:%{pg:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
134              %{!pg:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
135                    %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}}} \
136              -R /usr/ucblib} \
137    %{!compat-bsd: \
138      %{!YP,*:%{pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
139              %{!pg:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
140                    %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}} \
141    %{Qy:} %{!Qn:-Qy}"
142
143 /* This defines which switch letters take arguments.
144    It is as in svr4.h but with -R added.  */
145
146 #undef SWITCH_TAKES_ARG
147 #define SWITCH_TAKES_ARG(CHAR) \
148   (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
149    || (CHAR) == 'R' \
150    || (CHAR) == 'h' \
151    || (CHAR) == 'z')
152
153 #define STDC_0_IN_SYSTEM_HEADERS 1
154
155 #undef LOCAL_LABEL_PREFIX
156 #define LOCAL_LABEL_PREFIX "."