sol2.h revision 52750
1/* Target definitions for GNU compiler for Intel 80386 running Solaris 2
2   Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3   Contributed by Fred Fish (fnf@cygnus.com).
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING.  If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA.  */
21
22#include "i386/sysv4.h"
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#else /* GAS_REJECTS_MINUS_S */
43
44/* Same as above, except for -s, unsupported by GNU as.  */
45#undef ASM_SPEC
46#define ASM_SPEC \
47  "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*}"
48
49#endif /* GAS_REJECTS_MINUS_S */
50
51/* The Solaris 2.0 x86 linker botches alignment of code sections.
52   It tries to align to a 16 byte boundary by padding with 0x00000090
53   ints, rather than 0x90 bytes (nop).  This generates trash in the
54   ".init" section since the contribution from crtbegin.o is only 7
55   bytes.  The linker pads it to 16 bytes with a single 0x90 byte, and
56   two 0x00000090 ints, which generates a segmentation violation when
57   executed.  This macro forces the assembler to do the padding, since
58   it knows what it is doing. */
59
60#define FORCE_INIT_SECTION_ALIGN asm (ALIGN_ASM_OP ## " 16")
61#define FORCE_FINI_SECTION_ALIGN FORCE_INIT_SECTION_ALIGN
62
63/* Add "sun" to the list of symbols defined for SVR4.  */
64#undef CPP_PREDEFINES
65#define CPP_PREDEFINES \
66  "-Dunix -D__svr4__ -D__SVR4 -Dsun -Asystem(svr4)"
67
68#undef CPP_SPEC
69#define CPP_SPEC "%(cpp_cpu) \
70   %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}"
71
72#undef LIB_SPEC
73#define LIB_SPEC \
74  "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} %{!shared:%{!symbolic:-lc}}"
75
76#undef  ENDFILE_SPEC
77#define ENDFILE_SPEC "crtend.o%s %{pg:crtn.o%s}%{!pg:crtn.o%s}"
78
79#undef	STARTFILE_SPEC
80#define STARTFILE_SPEC "%{!shared: \
81			 %{!symbolic: \
82			  %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}}\
83			%{pg:gmon.o%s} crti.o%s \
84			%{ansi:values-Xc.o%s} \
85			%{!ansi: \
86			 %{traditional:values-Xt.o%s} \
87			 %{!traditional:values-Xa.o%s}} \
88 			crtbegin.o%s"
89
90/* This should be the same as in svr4.h, except with -R added.  */
91#undef LINK_SPEC
92#define LINK_SPEC \
93  "%{h*} %{v:-V} \
94   %{b} %{Wl,*:%*} \
95   %{static:-dn -Bstatic} \
96   %{shared:-G -dy -z text} \
97   %{symbolic:-Bsymbolic -G -dy -z text} \
98   %{G:-G} \
99   %{YP,*} \
100   %{R*} \
101   %{compat-bsd: \
102     %{!YP,*:%{pg:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
103     %{!pg:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
104       %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}}} \
105     -R /usr/ucblib} \
106   %{!compat-bsd: \
107     %{!YP,*:%{pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
108     %{!pg:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
109       %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}} \
110   %{Qy:} %{!Qn:-Qy}"
111
112/* This defines which switch letters take arguments.
113   It is as in svr4.h but with -R added.  */
114
115#undef SWITCH_TAKES_ARG
116#define SWITCH_TAKES_ARG(CHAR) \
117  (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
118   || (CHAR) == 'R' \
119   || (CHAR) == 'h' \
120   || (CHAR) == 'z')
121
122#define STDC_0_IN_SYSTEM_HEADERS
123
124#undef LOCAL_LABEL_PREFIX
125#define LOCAL_LABEL_PREFIX "."
126