1 /* Operating system specific defines to be used when targeting GCC for some
2 generic System V Release 4 system.
3 Copyright (C) 1991, 94-99, 2000 Free Software Foundation, Inc.
4 Contributed by Ron Guilmette (rfg@monkeys.com).
6 This file is part of GNU CC.
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)
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.
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.
23 To use this file, make up a file with a name like:
27 where ????? is replaced by the name of the basic hardware that you
28 are targeting for. Then, in the file ?????svr4.h, put something
34 followed by any really system-specific defines (or overrides of
35 defines) which you find that you need. For example, CPP_PREDEFINES
36 is defined here with only the defined -Dunix and -DSVR4. You should
37 probably override that in your target-specific ?????svr4.h file
38 with a set of defines that includes these, but also contains an
39 appropriate define for the type of hardware that you are targeting.
42 /* Define a symbol indicating that we are using svr4.h. */
47 /* Cpp, assembler, linker, library, and startfile spec's. */
49 /* This defines which switch letters take arguments. On svr4, most of
50 the normal cases (defined in gcc.c) apply, and we also have -h* and
51 -z* options (for the linker). Note however that there is no such
52 thing as a -T option for svr4. */
54 #define SWITCH_TAKES_ARG(CHAR) \
55 (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
60 /* This defines which multi-letter switches take arguments. On svr4,
61 there are no such switches except those implemented by GCC itself. */
63 #define WORD_SWITCH_TAKES_ARG(STR) \
64 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
65 && strcmp (STR, "Tdata") && strcmp (STR, "Ttext") \
66 && strcmp (STR, "Tbss"))
68 /* You should redefine CPP_PREDEFINES in any file which includes this one.
69 The definition should be appropriate for the type of target system
70 involved, and it should include any -A (assertion) options which are
71 appropriate for the given target system. */
74 /* Provide an ASM_SPEC appropriate for svr4. Here we try to support as
75 many of the specialized svr4 assembler options as seems reasonable,
76 given that there are certain options which we can't (or shouldn't)
77 support directly due to the fact that they conflict with other options
78 for other svr4 tools (e.g. ld) or with other options for GCC itself.
79 For example, we don't support the -o (output file) or -R (remove
80 input file) options because GCC already handles these things. We
81 also don't support the -m (run m4) option for the assembler because
82 that conflicts with the -m (produce load map) option of the svr4
83 linker. We do however allow passing arbitrary options to the svr4
84 assembler via the -Wa, option.
86 Note that gcc doesn't allow a space to follow -Y in a -Ym,* or -Yd,*
92 "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
94 /* svr4 assemblers need the `-' (indicating input from stdin) to come after
95 the -o option (and its argument) for some reason. If we try to put it
96 before the -o option, the assembler will try to read the file named as
97 the output file in the -o option as an input file (after it has already
98 written some stuff to it) and the binary stuff contained therein will
99 cause totally confuse the assembler, resulting in many spurious error
102 #undef ASM_FINAL_SPEC
103 #define ASM_FINAL_SPEC "%|"
105 /* Under svr4, the normal location of the `ld' and `as' programs is the
106 /usr/ccs/bin directory. */
108 #ifndef CROSS_COMPILE
109 #undef MD_EXEC_PREFIX
110 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
113 /* Under svr4, the normal location of the various *crt*.o files is the
114 /usr/ccs/lib directory. */
116 #ifndef CROSS_COMPILE
117 #undef MD_STARTFILE_PREFIX
118 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
121 /* Provide a LIB_SPEC appropriate for svr4. Here we tack on the default
122 standard C library (unless we are building a shared library). */
125 #define LIB_SPEC "%{!shared:%{!symbolic:-lc}}"
127 /* Provide an ENDFILE_SPEC appropriate for svr4. Here we tack on our own
128 magical crtend.o file (see crtstuff.c) which provides part of the
129 support for getting C++ file-scope static object constructed before
130 entering `main', followed by the normal svr3/svr4 "finalizer" file,
131 which is either `gcrtn.o' or `crtn.o'. */
134 #define ENDFILE_SPEC "crtend.o%s %{pg:gcrtn.o%s}%{!pg:crtn.o%s}"
136 /* Provide a LINK_SPEC appropriate for svr4. Here we provide support
137 for the special GCC options -static, -shared, and -symbolic which
138 allow us to link things in one of these three modes by applying the
139 appropriate combinations of options at link-time. We also provide
140 support here for as many of the other svr4 linker options as seems
141 reasonable, given that some of them conflict with options for other
142 svr4 tools (e.g. the assembler). In particular, we do support the
143 -z*, -V, -b, -t, -Qy, -Qn, and -YP* options here, and the -e*,
144 -l*, -o*, -r, -s, -u*, and -L* options are directly supported
145 by gcc.c itself. We don't directly support the -m (generate load
146 map) option because that conflicts with the -m (run m4) option of
147 the svr4 assembler. We also don't directly support the svr4 linker's
148 -I* or -M* options because these conflict with existing GCC options.
149 We do however allow passing arbitrary options to the svr4 linker
150 via the -Wl, option. We don't support the svr4 linker's -a option
151 at all because it is totally useless and because it conflicts with
154 Note that gcc doesn't allow a space to follow -Y in a -YP,* option.
156 When the -G link option is used (-shared and -symbolic) a final link is
161 #define LINK_SPEC "%{h*} %{v:-V} \
163 %{static:-dn -Bstatic} \
164 %{shared:-G -dy -z text} \
165 %{symbolic:-Bsymbolic -G -dy -z text} \
170 #define LINK_SPEC "%{h*} %{v:-V} \
172 %{static:-dn -Bstatic} \
173 %{shared:-G -dy -z text} \
174 %{symbolic:-Bsymbolic -G -dy -z text} \
177 %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
178 %{!p:-Y P,/usr/ccs/lib:/usr/lib}} \
182 /* Gcc automatically adds in one of the files /usr/ccs/lib/values-Xc.o,
183 /usr/ccs/lib/values-Xa.o, or /usr/ccs/lib/values-Xt.o for each final
184 link step (depending upon the other gcc options selected, such as
185 -traditional and -ansi). These files each contain one (initialized)
186 copy of a special variable called `_lib_version'. Each one of these
187 files has `_lib_version' initialized to a different (enum) value.
188 The SVR4 library routines query the value of `_lib_version' at run
189 to decide how they should behave. Specifically, they decide (based
190 upon the value of `_lib_version') if they will act in a strictly ANSI
191 conforming manner or not. */
193 #undef STARTFILE_SPEC
194 #define STARTFILE_SPEC "%{!shared: \
196 %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}}\
197 %{pg:gcrti.o%s}%{!pg:crti.o%s} \
198 %{ansi:values-Xc.o%s} \
200 %{traditional:values-Xt.o%s} \
201 %{!traditional:values-Xa.o%s}} \
204 /* Allow #sccs in preprocessor. */
206 #define SCCS_DIRECTIVE
208 /* The numbers used to denote specific machine registers in the System V
209 Release 4 DWARF debugging information are quite likely to be totally
210 different from the numbers used in BSD stabs debugging information
211 for the same kind of target machine. Thus, we undefine the macro
212 DBX_REGISTER_NUMBER here as an extra inducement to get people to
213 provide proper machine-specific definitions of DBX_REGISTER_NUMBER
214 (which is also used to provide DWARF registers numbers in dwarfout.c)
215 in their tm.h files which include this file. */
217 #undef DBX_REGISTER_NUMBER
219 /* Define the actual types of some ANSI-mandated types. (These
220 definitions should work for most SVR4 systems). */
223 #define SIZE_TYPE "unsigned int"
226 #define PTRDIFF_TYPE "int"
229 #define WCHAR_TYPE "long int"
231 #undef WCHAR_TYPE_SIZE
232 #define WCHAR_TYPE_SIZE BITS_PER_WORD
234 /* This causes trouble, because it requires the host machine
235 to support ANSI C. */
236 /* #define MULTIBYTE_CHARS */