sol2.h revision 90075
118334Speter/* Target definitions for GNU compiler for Intel 80386 running Solaris 2 290075Sobrien Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 390075Sobrien Free Software Foundation, Inc. 450397Sobrien Contributed by Fred Fish (fnf@cygnus.com). 518334Speter 618334SpeterThis file is part of GNU CC. 718334Speter 818334SpeterGNU CC is free software; you can redistribute it and/or modify 918334Speterit under the terms of the GNU General Public License as published by 1018334Speterthe Free Software Foundation; either version 2, or (at your option) 1118334Speterany later version. 1218334Speter 1318334SpeterGNU CC is distributed in the hope that it will be useful, 1418334Speterbut WITHOUT ANY WARRANTY; without even the implied warranty of 1518334SpeterMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1618334SpeterGNU General Public License for more details. 1718334Speter 1818334SpeterYou should have received a copy of the GNU General Public License 1918334Speteralong with GNU CC; see the file COPYING. If not, write to 2018334Speterthe Free Software Foundation, 59 Temple Place - Suite 330, 2118334SpeterBoston, MA 02111-1307, USA. */ 2218334Speter 2318334Speter 2452750Sobrien/* We use stabs-in-elf for debugging, because that is what the native 2552750Sobrien toolchain uses. */ 2652750Sobrien#undef PREFERRED_DEBUGGING_TYPE 2752750Sobrien#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG 2852750Sobrien 2952750Sobrien#if ! GAS_REJECTS_MINUS_S 3052750Sobrien 3152750Sobrien/* 3252750Sobrien Changed from config/svr4.h in the following ways: 3352750Sobrien 3452750Sobrien - Removed -Yd (neither the sun bundled assembler nor gas accept it). 3552750Sobrien - Added "-s" so that stabs are not discarded. 3652750Sobrien*/ 3752750Sobrien 3852750Sobrien#undef ASM_SPEC 3952750Sobrien#define ASM_SPEC \ 4052750Sobrien "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s" 4152750Sobrien 4252750Sobrien#else /* GAS_REJECTS_MINUS_S */ 4352750Sobrien 4452750Sobrien/* Same as above, except for -s, unsupported by GNU as. */ 4552750Sobrien#undef ASM_SPEC 4652750Sobrien#define ASM_SPEC \ 4752750Sobrien "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*}" 4852750Sobrien 4952750Sobrien#endif /* GAS_REJECTS_MINUS_S */ 5052750Sobrien 5118334Speter/* The Solaris 2.0 x86 linker botches alignment of code sections. 5218334Speter It tries to align to a 16 byte boundary by padding with 0x00000090 5318334Speter ints, rather than 0x90 bytes (nop). This generates trash in the 5418334Speter ".init" section since the contribution from crtbegin.o is only 7 5518334Speter bytes. The linker pads it to 16 bytes with a single 0x90 byte, and 5618334Speter two 0x00000090 ints, which generates a segmentation violation when 5718334Speter executed. This macro forces the assembler to do the padding, since 5890075Sobrien it knows what it is doing. */ 5990075Sobrien#define FORCE_CODE_SECTION_ALIGN asm(ALIGN_ASM_OP "16"); 6018334Speter 6190075Sobrien/* Select a format to encode pointers in exception handling data. CODE 6290075Sobrien is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is 6390075Sobrien true if the symbol may be affected by dynamic relocations. */ 6490075Sobrien#undef ASM_PREFERRED_EH_DATA_FORMAT 6590075Sobrien#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ 6690075Sobrien (flag_pic ? (GLOBAL ? DW_EH_PE_indirect : 0) | DW_EH_PE_datarel \ 6790075Sobrien : DW_EH_PE_absptr) 6818334Speter 6990075Sobrien/* Solaris 2/Intel uses a wint_t different from the default, as on SPARC. */ 7090075Sobrien#undef WINT_TYPE 7190075Sobrien#define WINT_TYPE "long int" 7290075Sobrien 7390075Sobrien#undef WINT_TYPE_SIZE 7490075Sobrien#define WINT_TYPE_SIZE BITS_PER_WORD 7590075Sobrien 7618334Speter/* Add "sun" to the list of symbols defined for SVR4. */ 7718334Speter#undef CPP_PREDEFINES 7818334Speter#define CPP_PREDEFINES \ 7990075Sobrien "-Dunix -D__svr4__ -D__SVR4 -Dsun -Asystem=svr4" 8018334Speter 8190075Sobrien/* Solaris 2/Intel as chokes on #line directives. */ 8218334Speter#undef CPP_SPEC 8390075Sobrien#define CPP_SPEC \ 8490075Sobrien "%{.S:-P} \ 8590075Sobrien %(cpp_cpu) \ 8690075Sobrien %{pthreads:-D_REENTRANT -D_PTHREADS} \ 8790075Sobrien %{!pthreads:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}} \ 8818334Speter %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}" 8918334Speter 9090075Sobrien/* For C++ we need to add some additional macro definitions required 9190075Sobrien by the C++ standard library. */ 9290075Sobrien#define CPLUSPLUS_CPP_SPEC "\ 9390075Sobrien-D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 \ 9490075Sobrien-D__EXTENSIONS__ \ 9590075Sobrien%(cpp) \ 9690075Sobrien" 9790075Sobrien 9818334Speter#undef LIB_SPEC 9918334Speter#define LIB_SPEC \ 10090075Sobrien "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \ 10190075Sobrien %{!shared:\ 10290075Sobrien %{!symbolic:\ 10390075Sobrien %{pthreads:-lpthread} \ 10490075Sobrien %{!pthreads:%{threads:-lthread}} \ 10590075Sobrien -lc}}" 10618334Speter 10718334Speter#undef ENDFILE_SPEC 10818334Speter#define ENDFILE_SPEC "crtend.o%s %{pg:crtn.o%s}%{!pg:crtn.o%s}" 10918334Speter 11050397Sobrien#undef STARTFILE_SPEC 11150397Sobrien#define STARTFILE_SPEC "%{!shared: \ 11250397Sobrien %{!symbolic: \ 11350397Sobrien %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}}\ 11450397Sobrien %{pg:gmon.o%s} crti.o%s \ 11550397Sobrien %{ansi:values-Xc.o%s} \ 11650397Sobrien %{!ansi: \ 11750397Sobrien %{traditional:values-Xt.o%s} \ 11850397Sobrien %{!traditional:values-Xa.o%s}} \ 11950397Sobrien crtbegin.o%s" 12050397Sobrien 12118334Speter/* This should be the same as in svr4.h, except with -R added. */ 12218334Speter#undef LINK_SPEC 12318334Speter#define LINK_SPEC \ 12450397Sobrien "%{h*} %{v:-V} \ 12518334Speter %{b} %{Wl,*:%*} \ 12618334Speter %{static:-dn -Bstatic} \ 12790075Sobrien %{shared:-G -dy %{!mimpure-text:-z text}} \ 12818334Speter %{symbolic:-Bsymbolic -G -dy -z text} \ 12918334Speter %{G:-G} \ 13018334Speter %{YP,*} \ 13118334Speter %{R*} \ 13218334Speter %{compat-bsd: \ 13350397Sobrien %{!YP,*:%{pg:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ 13490075Sobrien %{!pg:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ 13590075Sobrien %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}}} \ 13690075Sobrien -R /usr/ucblib} \ 13718334Speter %{!compat-bsd: \ 13850397Sobrien %{!YP,*:%{pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ 13990075Sobrien %{!pg:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ 14090075Sobrien %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}} \ 14118334Speter %{Qy:} %{!Qn:-Qy}" 14218334Speter 14318334Speter/* This defines which switch letters take arguments. 14418334Speter It is as in svr4.h but with -R added. */ 14518334Speter 14618334Speter#undef SWITCH_TAKES_ARG 14718334Speter#define SWITCH_TAKES_ARG(CHAR) \ 14850397Sobrien (DEFAULT_SWITCH_TAKES_ARG(CHAR) \ 14918334Speter || (CHAR) == 'R' \ 15018334Speter || (CHAR) == 'h' \ 15118334Speter || (CHAR) == 'z') 15218334Speter 15390075Sobrien#define STDC_0_IN_SYSTEM_HEADERS 1 15452284Sobrien 15552284Sobrien#undef LOCAL_LABEL_PREFIX 15652284Sobrien#define LOCAL_LABEL_PREFIX "." 157