sol2.h revision 50397
118334Speter/* Target definitions for GNU compiler for Intel 80386 running Solaris 2
250397Sobrien   Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
350397Sobrien   Contributed by Fred Fish (fnf@cygnus.com).
418334Speter
518334SpeterThis file is part of GNU CC.
618334Speter
718334SpeterGNU CC is free software; you can redistribute it and/or modify
818334Speterit under the terms of the GNU General Public License as published by
918334Speterthe Free Software Foundation; either version 2, or (at your option)
1018334Speterany later version.
1118334Speter
1218334SpeterGNU CC is distributed in the hope that it will be useful,
1318334Speterbut WITHOUT ANY WARRANTY; without even the implied warranty of
1418334SpeterMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1518334SpeterGNU General Public License for more details.
1618334Speter
1718334SpeterYou should have received a copy of the GNU General Public License
1818334Speteralong with GNU CC; see the file COPYING.  If not, write to
1918334Speterthe Free Software Foundation, 59 Temple Place - Suite 330,
2018334SpeterBoston, MA 02111-1307, USA.  */
2118334Speter
2218334Speter#include "i386/sysv4.h"
2318334Speter
2418334Speter/* The Solaris 2.0 x86 linker botches alignment of code sections.
2518334Speter   It tries to align to a 16 byte boundary by padding with 0x00000090
2618334Speter   ints, rather than 0x90 bytes (nop).  This generates trash in the
2718334Speter   ".init" section since the contribution from crtbegin.o is only 7
2818334Speter   bytes.  The linker pads it to 16 bytes with a single 0x90 byte, and
2918334Speter   two 0x00000090 ints, which generates a segmentation violation when
3018334Speter   executed.  This macro forces the assembler to do the padding, since
3118334Speter   it knows what it is doing. */
3218334Speter
3350397Sobrien#define FORCE_INIT_SECTION_ALIGN asm (ALIGN_ASM_OP ## " 16")
3418334Speter#define FORCE_FINI_SECTION_ALIGN FORCE_INIT_SECTION_ALIGN
3518334Speter
3618334Speter/* Add "sun" to the list of symbols defined for SVR4.  */
3718334Speter#undef CPP_PREDEFINES
3818334Speter#define CPP_PREDEFINES \
3950397Sobrien  "-Dunix -D__svr4__ -D__SVR4 -Dsun -Asystem(svr4)"
4018334Speter
4118334Speter#undef CPP_SPEC
4250397Sobrien#define CPP_SPEC "%(cpp_cpu) \
4318334Speter   %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}"
4418334Speter
4518334Speter#undef LIB_SPEC
4618334Speter#define LIB_SPEC \
4718334Speter  "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} %{!shared:%{!symbolic:-lc}}"
4818334Speter
4918334Speter#undef  ENDFILE_SPEC
5018334Speter#define ENDFILE_SPEC "crtend.o%s %{pg:crtn.o%s}%{!pg:crtn.o%s}"
5118334Speter
5250397Sobrien#undef	STARTFILE_SPEC
5350397Sobrien#define STARTFILE_SPEC "%{!shared: \
5450397Sobrien			 %{!symbolic: \
5550397Sobrien			  %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}}\
5650397Sobrien			%{pg:gmon.o%s} crti.o%s \
5750397Sobrien			%{ansi:values-Xc.o%s} \
5850397Sobrien			%{!ansi: \
5950397Sobrien			 %{traditional:values-Xt.o%s} \
6050397Sobrien			 %{!traditional:values-Xa.o%s}} \
6150397Sobrien 			crtbegin.o%s"
6250397Sobrien
6318334Speter/* This should be the same as in svr4.h, except with -R added.  */
6418334Speter#undef LINK_SPEC
6518334Speter#define LINK_SPEC \
6650397Sobrien  "%{h*} %{v:-V} \
6718334Speter   %{b} %{Wl,*:%*} \
6818334Speter   %{static:-dn -Bstatic} \
6918334Speter   %{shared:-G -dy -z text} \
7018334Speter   %{symbolic:-Bsymbolic -G -dy -z text} \
7118334Speter   %{G:-G} \
7218334Speter   %{YP,*} \
7318334Speter   %{R*} \
7418334Speter   %{compat-bsd: \
7550397Sobrien     %{!YP,*:%{pg:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
7650397Sobrien     %{!pg:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
7750397Sobrien       %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}}} \
7818334Speter     -R /usr/ucblib} \
7918334Speter   %{!compat-bsd: \
8050397Sobrien     %{!YP,*:%{pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
8150397Sobrien     %{!pg:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
8250397Sobrien       %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}} \
8318334Speter   %{Qy:} %{!Qn:-Qy}"
8418334Speter
8518334Speter/* This defines which switch letters take arguments.
8618334Speter   It is as in svr4.h but with -R added.  */
8718334Speter
8818334Speter#undef SWITCH_TAKES_ARG
8918334Speter#define SWITCH_TAKES_ARG(CHAR) \
9050397Sobrien  (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
9118334Speter   || (CHAR) == 'R' \
9218334Speter   || (CHAR) == 'h' \
9318334Speter   || (CHAR) == 'z')
9418334Speter
9550397Sobrien#define STDC_0_IN_SYSTEM_HEADERS
96