OSDN Git Service

config:
[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
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 #include "i386/sysv4.h"
24
25 /* We use stabs-in-elf for debugging, because that is what the native
26    toolchain uses.  */
27 #undef PREFERRED_DEBUGGING_TYPE
28 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
29
30 #if ! GAS_REJECTS_MINUS_S
31
32 /*
33   Changed from config/svr4.h in the following ways:
34
35   - Removed -Yd (neither the sun bundled assembler nor gas accept it).
36   - Added "-s" so that stabs are not discarded.
37 */
38
39 #undef ASM_SPEC
40 #define ASM_SPEC \
41   "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s"
42
43 #else /* GAS_REJECTS_MINUS_S */
44
45 /* Same as above, except for -s, unsupported by GNU as.  */
46 #undef ASM_SPEC
47 #define ASM_SPEC \
48   "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*}"
49
50 #endif /* GAS_REJECTS_MINUS_S */
51
52 /* The Solaris 2.0 x86 linker botches alignment of code sections.
53    It tries to align to a 16 byte boundary by padding with 0x00000090
54    ints, rather than 0x90 bytes (nop).  This generates trash in the
55    ".init" section since the contribution from crtbegin.o is only 7
56    bytes.  The linker pads it to 16 bytes with a single 0x90 byte, and
57    two 0x00000090 ints, which generates a segmentation violation when
58    executed.  This macro forces the assembler to do the padding, since
59    it knows what it is doing. */
60
61 #define FORCE_INIT_SECTION_ALIGN asm (ALIGN_ASM_OP ## "16")
62 #define FORCE_FINI_SECTION_ALIGN FORCE_INIT_SECTION_ALIGN
63
64 /* Add "sun" to the list of symbols defined for SVR4.  */
65 #undef CPP_PREDEFINES
66 #define CPP_PREDEFINES \
67   "-Dunix -D__svr4__ -D__SVR4 -Dsun -Asystem=svr4"
68
69 #undef CPP_SPEC
70 #define CPP_SPEC "%(cpp_cpu) \
71   %{pthreads:-D_REENTRANT -D_PTHREADS} \
72   %{!pthreads:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}} \
73   %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}"
74
75 #undef LIB_SPEC
76 #define LIB_SPEC \
77   "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \
78    %{!shared:\
79      %{!symbolic:\
80        %{pthreads:-lpthread} \
81        %{!pthreads:%{threads:-lthread}} \
82        -lc}}"
83
84 #undef  ENDFILE_SPEC
85 #define ENDFILE_SPEC "crtend.o%s %{pg:crtn.o%s}%{!pg:crtn.o%s}"
86
87 #undef  STARTFILE_SPEC
88 #define STARTFILE_SPEC "%{!shared: \
89                          %{!symbolic: \
90                           %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}}\
91                         %{pg:gmon.o%s} crti.o%s \
92                         %{ansi:values-Xc.o%s} \
93                         %{!ansi: \
94                          %{traditional:values-Xt.o%s} \
95                          %{!traditional:values-Xa.o%s}} \
96                         crtbegin.o%s"
97   
98 /* This should be the same as in svr4.h, except with -R added.  */
99 #undef LINK_SPEC
100 #define LINK_SPEC \
101   "%{h*} %{v:-V} \
102    %{b} %{Wl,*:%*} \
103    %{static:-dn -Bstatic} \
104    %{shared:-G -dy %{!mimpure-text:-z text}} \
105    %{symbolic:-Bsymbolic -G -dy -z text} \
106    %{G:-G} \
107    %{YP,*} \
108    %{R*} \
109    %{compat-bsd: \
110      %{!YP,*:%{pg:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
111              %{!pg:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
112                    %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}}} \
113              -R /usr/ucblib} \
114    %{!compat-bsd: \
115      %{!YP,*:%{pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
116              %{!pg:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
117                    %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}} \
118    %{Qy:} %{!Qn:-Qy}"
119
120 /* This defines which switch letters take arguments.
121    It is as in svr4.h but with -R added.  */
122
123 #undef SWITCH_TAKES_ARG
124 #define SWITCH_TAKES_ARG(CHAR) \
125   (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
126    || (CHAR) == 'R' \
127    || (CHAR) == 'h' \
128    || (CHAR) == 'z')
129
130 #define STDC_0_IN_SYSTEM_HEADERS 1
131
132 #undef LOCAL_LABEL_PREFIX
133 #define LOCAL_LABEL_PREFIX "."