OSDN Git Service

2001-10-19 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
[pf3gnuchains/gcc-fork.git] / gcc / config / svr4.h
1 /* Operating system specific defines to be used when targeting GCC for some
2    generic System V Release 4 system.
3    Copyright (C) 1991, 1994, 1995, 1996, 1997, 1998, 1999,
4    2000, 2001 Free Software Foundation, Inc.
5    Contributed by Ron Guilmette (rfg@monkeys.com).
6
7 This file is part of GNU CC.
8
9 GNU CC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
13
14 GNU CC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GNU CC; see the file COPYING.  If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA.
23
24    To use this file, make up a line like that in config.gcc:
25
26         tm_file="$tm_file elfos.h svr4.h MACHINE/svr4.h"
27
28    where MACHINE is replaced by the name of the basic hardware that you
29    are targeting for.  Then, in the file MACHINE/svr4.h, put any really
30    system-specific defines (or overrides of defines) which you find that
31    you need.  For example, CPP_PREDEFINES is defined here with only the
32    defined -Dunix and -DSVR4.  You should probably override that in your
33    target-specific MACHINE/svr4.h file with a set of defines that
34    includes these, but also contains an appropriate define for the type
35    of hardware that you are targeting.
36 */
37
38 /* Define a symbol indicating that we are using svr4.h.  */
39 #define USING_SVR4_H
40
41 /* Cpp, assembler, linker, library, and startfile spec's.  */
42
43 /* This defines which switch letters take arguments.  On svr4, most of
44    the normal cases (defined in gcc.c) apply, and we also have -h* and
45    -z* options (for the linker).  Note however that there is no such
46    thing as a -T option for svr4.  */
47
48 #define SWITCH_TAKES_ARG(CHAR)          \
49   (DEFAULT_SWITCH_TAKES_ARG (CHAR)      \
50    || (CHAR) == 'h'                     \
51    || (CHAR) == 'x'                     \
52    || (CHAR) == 'z')
53
54 /* This defines which multi-letter switches take arguments.  On svr4,
55    there are no such switches except those implemented by GCC itself.  */
56
57 #define WORD_SWITCH_TAKES_ARG(STR)                      \
58  (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)                   \
59   && strcmp (STR, "Tdata") && strcmp (STR, "Ttext")     \
60   && strcmp (STR, "Tbss"))
61
62 /* You should redefine CPP_PREDEFINES in any file which includes this one.
63    The definition should be appropriate for the type of target system
64    involved, and it should include any -A (assertion) options which are
65    appropriate for the given target system.  */
66 #undef CPP_PREDEFINES
67
68 /* Provide an ASM_SPEC appropriate for svr4.  Here we try to support as
69    many of the specialized svr4 assembler options as seems reasonable,
70    given that there are certain options which we can't (or shouldn't)
71    support directly due to the fact that they conflict with other options
72    for other svr4 tools (e.g. ld) or with other options for GCC itself.
73    For example, we don't support the -o (output file) or -R (remove
74    input file) options because GCC already handles these things.  We
75    also don't support the -m (run m4) option for the assembler because
76    that conflicts with the -m (produce load map) option of the svr4
77    linker.  We do however allow passing arbitrary options to the svr4
78    assembler via the -Wa, option.
79
80    Note that gcc doesn't allow a space to follow -Y in a -Ym,* or -Yd,*
81    option.
82 */
83
84 #undef  ASM_SPEC
85 #define ASM_SPEC \
86   "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
87
88 /* svr4 assemblers need the `-' (indicating input from stdin) to come after
89    the -o option (and its argument) for some reason.  If we try to put it
90    before the -o option, the assembler will try to read the file named as
91    the output file in the -o option as an input file (after it has already
92    written some stuff to it) and the binary stuff contained therein will
93    cause totally confuse the assembler, resulting in many spurious error
94    messages.  */
95
96 #undef  ASM_FINAL_SPEC
97 #define ASM_FINAL_SPEC "%|"
98
99 /* Under svr4, the normal location of the `ld' and `as' programs is the
100    /usr/ccs/bin directory.  */
101
102 #ifndef CROSS_COMPILE
103 #undef  MD_EXEC_PREFIX
104 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
105 #endif
106
107 /* Under svr4, the normal location of the various *crt*.o files is the
108    /usr/ccs/lib directory.  */
109
110 #ifndef CROSS_COMPILE
111 #undef  MD_STARTFILE_PREFIX
112 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
113 #endif
114
115 /* Provide a LIB_SPEC appropriate for svr4.  Here we tack on the default
116    standard C library (unless we are building a shared library).  */
117
118 #undef  LIB_SPEC
119 #define LIB_SPEC "%{!shared:%{!symbolic:-lc}}"
120
121 /* Provide an ENDFILE_SPEC appropriate for svr4.  Here we tack on our own
122    magical crtend.o file (see crtstuff.c) which provides part of the
123    support for getting C++ file-scope static object constructed before
124    entering `main', followed by the normal svr3/svr4 "finalizer" file,
125    which is either `gcrtn.o' or `crtn.o'.  */
126
127 #undef  ENDFILE_SPEC
128 #define ENDFILE_SPEC "crtend.o%s %{pg:gcrtn.o%s}%{!pg:crtn.o%s}"
129
130 /* Provide a LINK_SPEC appropriate for svr4.  Here we provide support
131    for the special GCC options -static, -shared, and -symbolic which
132    allow us to link things in one of these three modes by applying the
133    appropriate combinations of options at link-time.  We also provide
134    support here for as many of the other svr4 linker options as seems
135    reasonable, given that some of them conflict with options for other
136    svr4 tools (e.g. the assembler).  In particular, we do support the
137    -z*, -V, -b, -t, -Qy, -Qn, and -YP* options here, and the -e*, -l*,
138    -o*, -r, -s, -u*, and -L* options are directly supported by gcc.c
139    itself.  We don't directly support the -m (generate load map)
140    option because that conflicts with the -m (run m4) option of the
141    svr4 assembler.  We also don't directly support the svr4 linker's
142    -I* or -M* options because these conflict with existing GCC
143    options.  We do however allow passing arbitrary options to the svr4
144    linker via the -Wl, option, in gcc.c.  We don't support the svr4
145    linker's -a option at all because it is totally useless and because
146    it conflicts with GCC's own -a option.
147
148    Note that gcc doesn't allow a space to follow -Y in a -YP,* option.
149
150    When the -G link option is used (-shared and -symbolic) a final link is
151    not being done.  */
152
153 #undef  LINK_SPEC
154 #ifdef CROSS_COMPILE
155 #define LINK_SPEC "%{h*} %{v:-V} \
156                    %{b} \
157                    %{static:-dn -Bstatic} \
158                    %{shared:-G -dy -z text} \
159                    %{symbolic:-Bsymbolic -G -dy -z text} \
160                    %{G:-G} \
161                    %{YP,*} \
162                    %{Qy:} %{!Qn:-Qy}"
163 #else
164 #define LINK_SPEC "%{h*} %{v:-V} \
165                    %{b} \
166                    %{static:-dn -Bstatic} \
167                    %{shared:-G -dy -z text} \
168                    %{symbolic:-Bsymbolic -G -dy -z text} \
169                    %{G:-G} \
170                    %{YP,*} \
171                    %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
172                     %{!p:-Y P,/usr/ccs/lib:/usr/lib}} \
173                    %{Qy:} %{!Qn:-Qy}"
174 #endif
175
176 /* Gcc automatically adds in one of the files /usr/ccs/lib/values-Xc.o,
177    /usr/ccs/lib/values-Xa.o, or /usr/ccs/lib/values-Xt.o for each final
178    link step (depending upon the other gcc options selected, such as
179    -traditional and -ansi).  These files each contain one (initialized)
180    copy of a special variable called `_lib_version'.  Each one of these
181    files has `_lib_version' initialized to a different (enum) value.
182    The SVR4 library routines query the value of `_lib_version' at run
183    to decide how they should behave.  Specifically, they decide (based
184    upon the value of `_lib_version') if they will act in a strictly ANSI
185    conforming manner or not.  */
186
187 #undef  STARTFILE_SPEC
188 #define STARTFILE_SPEC "%{!shared: \
189                          %{!symbolic: \
190                           %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}}\
191                         %{pg:gcrti.o%s}%{!pg:crti.o%s} \
192                         %{ansi:values-Xc.o%s} \
193                         %{!ansi: \
194                          %{traditional:values-Xt.o%s} \
195                          %{!traditional:values-Xa.o%s}} \
196                         crtbegin.o%s"
197
198 /* Allow #sccs in preprocessor.  */
199
200 #define SCCS_DIRECTIVE
201
202 /* The numbers used to denote specific machine registers in the System V
203    Release 4 DWARF debugging information are quite likely to be totally
204    different from the numbers used in BSD stabs debugging information
205    for the same kind of target machine.  Thus, we undefine the macro
206    DBX_REGISTER_NUMBER here as an extra inducement to get people to
207    provide proper machine-specific definitions of DBX_REGISTER_NUMBER
208    (which is also used to provide DWARF registers numbers in dwarfout.c)
209    in their tm.h files which include this file.  */
210
211 #undef DBX_REGISTER_NUMBER
212
213 /* Define the actual types of some ANSI-mandated types.  (These
214    definitions should work for most SVR4 systems).  */
215
216 #undef  SIZE_TYPE
217 #define SIZE_TYPE "unsigned int"
218
219 #undef  PTRDIFF_TYPE
220 #define PTRDIFF_TYPE "int"
221
222 #undef  WCHAR_TYPE
223 #define WCHAR_TYPE "long int"
224
225 #undef  WCHAR_TYPE_SIZE
226 #define WCHAR_TYPE_SIZE BITS_PER_WORD
227
228 /* This causes trouble, because it requires the host machine
229    to support ANSI C.  */
230 /* #define MULTIBYTE_CHARS */
231
232 #define TARGET_HAS_F_SETLKW