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