sol2.h revision 18334
117680Spst/* Target definitions for GNU compiler for Intel 80386 running Solaris 2 239300Sfenner Copyright (C) 1993, 1995 Free Software Foundation, Inc. 317680Spst 417680Spst Written by Fred Fish (fnf@cygnus.com). 517680Spst 617680SpstThis file is part of GNU CC. 717680Spst 817680SpstGNU CC is free software; you can redistribute it and/or modify 917680Spstit under the terms of the GNU General Public License as published by 1017680Spstthe Free Software Foundation; either version 2, or (at your option) 1117680Spstany later version. 1217680Spst 1317680SpstGNU CC is distributed in the hope that it will be useful, 1417680Spstbut WITHOUT ANY WARRANTY; without even the implied warranty of 1517680SpstMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1617680SpstGNU General Public License for more details. 1717680Spst 1817680SpstYou should have received a copy of the GNU General Public License 1917680Spstalong with GNU CC; see the file COPYING. If not, write to 2056896Sfennerthe Free Software Foundation, 59 Temple Place - Suite 330, 2156896SfennerBoston, MA 02111-1307, USA. */ 2217680Spst 2317680Spst#include "i386/sysv4.h" 2417680Spst 25127675Sbms/* The Solaris 2.0 x86 linker botches alignment of code sections. 26214478Srpaulo It tries to align to a 16 byte boundary by padding with 0x00000090 2717680Spst ints, rather than 0x90 bytes (nop). This generates trash in the 2817680Spst ".init" section since the contribution from crtbegin.o is only 7 2956896Sfenner bytes. The linker pads it to 16 bytes with a single 0x90 byte, and 3056896Sfenner two 0x00000090 ints, which generates a segmentation violation when 3156896Sfenner executed. This macro forces the assembler to do the padding, since 3256896Sfenner it knows what it is doing. */ 33127675Sbms 3417680Spst#define FORCE_INIT_SECTION_ALIGN do { asm (ALIGN_ASM_OP ## " 16"); } while (0) 3575118Sfenner#define FORCE_FINI_SECTION_ALIGN FORCE_INIT_SECTION_ALIGN 3617680Spst 3717680Spst/* Add "sun" to the list of symbols defined for SVR4. */ 3856896Sfenner#undef CPP_PREDEFINES 3917680Spst#define CPP_PREDEFINES \ 4017680Spst "-Di386 -Dunix -D__svr4__ -D__SVR4 -Dsun \ 4117680Spst -Asystem(unix) -Asystem(svr4) -Acpu(i386) -Amachine(i386)" 4217680Spst 4317680Spst#undef CPP_SPEC 4498527Sfenner#define CPP_SPEC "\ 4598527Sfenner %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}" 4617680Spst 4717680Spst#undef LIB_SPEC 4817680Spst#define LIB_SPEC \ 4917680Spst "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} %{!shared:%{!symbolic:-lc}}" 5098527Sfenner 5117680Spst#undef ENDFILE_SPEC 5298527Sfenner#define ENDFILE_SPEC "crtend.o%s %{pg:crtn.o%s}%{!pg:crtn.o%s}" 5398527Sfenner 5417680Spst/* This should be the same as in svr4.h, except with -R added. */ 5517680Spst#undef LINK_SPEC 5617680Spst#define LINK_SPEC \ 5717680Spst "%{h*} %{V} %{v:%{!V:-V}} \ 5817680Spst %{b} %{Wl,*:%*} \ 59127675Sbms %{static:-dn -Bstatic} \ 6017680Spst %{shared:-G -dy -z text} \ 6117680Spst %{symbolic:-Bsymbolic -G -dy -z text} \ 6217680Spst %{G:-G} \ 6398527Sfenner %{YP,*} \ 6498527Sfenner %{R*} \ 65127675Sbms %{compat-bsd: \ 6698527Sfenner %{!YP,*:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ 67127675Sbms %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \ 68127675Sbms -R /usr/ucblib} \ 6975118Sfenner %{!compat-bsd: \ 7075118Sfenner %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ 7175118Sfenner %{!p:-Y P,/usr/ccs/lib:/usr/lib}}} \ 7275118Sfenner %{Qy:} %{!Qn:-Qy}" 7375118Sfenner 7498527Sfenner/* This defines which switch letters take arguments. 7598527Sfenner It is as in svr4.h but with -R added. */ 7675118Sfenner 7775118Sfenner#undef SWITCH_TAKES_ARG 7875118Sfenner#define SWITCH_TAKES_ARG(CHAR) \ 7975118Sfenner ( (CHAR) == 'D' \ 8075118Sfenner || (CHAR) == 'U' \ 8175118Sfenner || (CHAR) == 'o' \ 8298527Sfenner || (CHAR) == 'e' \ 8398527Sfenner || (CHAR) == 'u' \ 8417680Spst || (CHAR) == 'I' \ 8517680Spst || (CHAR) == 'm' \ 8617680Spst || (CHAR) == 'L' \ 8717680Spst || (CHAR) == 'R' \ 8817680Spst || (CHAR) == 'A' \ 8917680Spst || (CHAR) == 'h' \ 9017680Spst || (CHAR) == 'z') 9175118Sfenner 9217680Spst