OSDN Git Service

f8aa358514c8f8b4abe061cc736e41ca79b5f66d
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / sol2.h
1 /* Target definitions for GNU compiler for Intel 80386 running Solaris 2
2    Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
3    Contributed by Fred Fish (fnf@cygnus.com).
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 #include "i386/sysv4.h"
23
24 /* The Solaris 2.0 x86 linker botches alignment of code sections.
25    It tries to align to a 16 byte boundary by padding with 0x00000090
26    ints, rather than 0x90 bytes (nop).  This generates trash in the
27    ".init" section since the contribution from crtbegin.o is only 7
28    bytes.  The linker pads it to 16 bytes with a single 0x90 byte, and
29    two 0x00000090 ints, which generates a segmentation violation when
30    executed.  This macro forces the assembler to do the padding, since
31    it knows what it is doing. */
32
33 #define FORCE_INIT_SECTION_ALIGN do { asm (ALIGN_ASM_OP ## " 16"); } while (0)
34 #define FORCE_FINI_SECTION_ALIGN FORCE_INIT_SECTION_ALIGN
35
36 /* Add "sun" to the list of symbols defined for SVR4.  */
37 #undef CPP_PREDEFINES
38 #define CPP_PREDEFINES \
39   "-Di386 -Dunix -D__svr4__ -D__SVR4 -Dsun \
40    -Asystem(unix) -Asystem(svr4) -Acpu(i386) -Amachine(i386)"
41
42 #undef CPP_SPEC
43 #define CPP_SPEC "\
44    %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}"
45
46 #undef LIB_SPEC
47 #define LIB_SPEC \
48   "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} %{!shared:%{!symbolic:-lc}}"
49
50 #undef  ENDFILE_SPEC
51 #define ENDFILE_SPEC "crtend.o%s %{pg:crtn.o%s}%{!pg:crtn.o%s}"
52
53 /* This should be the same as in svr4.h, except with -R added.  */
54 #undef LINK_SPEC
55 #define LINK_SPEC \
56   "%{h*} %{V} %{v:%{!V:-V}} \
57    %{b} %{Wl,*:%*} \
58    %{static:-dn -Bstatic} \
59    %{shared:-G -dy -z text} \
60    %{symbolic:-Bsymbolic -G -dy -z text} \
61    %{G:-G} \
62    %{YP,*} \
63    %{R*} \
64    %{compat-bsd: \
65      %{!YP,*:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
66        %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \
67      -R /usr/ucblib} \
68    %{!compat-bsd: \
69      %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
70        %{!p:-Y P,/usr/ccs/lib:/usr/lib}}} \
71    %{Qy:} %{!Qn:-Qy}"
72
73 /* This defines which switch letters take arguments.
74    It is as in svr4.h but with -R added.  */
75
76 #undef SWITCH_TAKES_ARG
77 #define SWITCH_TAKES_ARG(CHAR) \
78   (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
79    || (CHAR) == 'R' \
80    || (CHAR) == 'h' \
81    || (CHAR) == 'z')
82