OSDN Git Service

828949d8ebca296afb96b6cd214956c7593dcb43
[pf3gnuchains/gcc-fork.git] / gcc / config / sparc / sol2.h
1 /* Definitions of target machine for GNU compiler, for SPARC running Solaris 2
2    Copyright 1992, 1995, 1996 Free Software Foundation, Inc.
3    Contributed by Ron Guilmette (rfg@netcom.com).
4    Additional changes by David V. Henkel-Wallace (gumby@cygnus.com).
5
6 This file is part of GNU CC.
7
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.  */
22
23 /* Supposedly the same as vanilla sparc svr4, except for the stuff below: */
24 #include "sparc/sysv4.h"
25
26 #undef CPP_PREDEFINES
27 #define CPP_PREDEFINES \
28  "-Dsun -Dsparc -Dunix -D__svr4__ -D__SVR4 \
29   -Asystem(unix) -Asystem(svr4) -Acpu(sparc) -Amachine(sparc)\
30   -D__GCC_NEW_VARARGS__"
31
32 #undef CPP_SPEC
33 #define CPP_SPEC "\
34    %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}\
35    %{msparclite:-D__sparclite__} %{mv8:-D__sparc_v8__}\
36    %{msupersparc:-D__supersparc__ -D__sparc_v8__}"
37
38 /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
39    It's safe to pass -s always, even if -g is not used. */
40 #undef ASM_SPEC
41 #define ASM_SPEC \
42   "%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s \
43    %{fpic:-K PIC} %{fPIC:-K PIC}"
44
45 /* However it appears that Solaris 2.0 uses the same reg numbering as
46    the old BSD-style system did. */
47
48 #undef DBX_REGISTER_NUMBER
49 /* Same as sparc.h */
50 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
51
52 /* We use stabs-in-elf for debugging, because that is what the native
53    toolchain uses.  */
54 #undef PREFERRED_DEBUGGING_TYPE
55 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
56
57 /* The Solaris 2 assembler uses .skip, not .zero, so put this back. */
58 #undef ASM_OUTPUT_SKIP
59 #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
60   fprintf (FILE, "\t.skip %u\n", (SIZE))
61
62 /* This is how to output a definition of an internal numbered label where
63    PREFIX is the class of label and NUM is the number within the class.  */
64
65 #undef  ASM_OUTPUT_INTERNAL_LABEL
66 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)      \
67   fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
68
69 /* This is how to output a reference to an internal numbered label where
70    PREFIX is the class of label and NUM is the number within the class.  */
71
72 #undef  ASM_OUTPUT_INTERNAL_LABELREF
73 #define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM)   \
74   fprintf (FILE, ".L%s%d", PREFIX, NUM)
75
76 /* This is how to store into the string LABEL
77    the symbol_ref name of an internal numbered label where
78    PREFIX is the class of label and NUM is the number within the class.
79    This is suitable for output with `assemble_name'.  */
80
81 #undef  ASM_GENERATE_INTERNAL_LABEL
82 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)   \
83   sprintf (LABEL, "*.L%s%d", PREFIX, NUM)
84
85 \f
86 /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us.
87    We don't use the standard LIB_SPEC only because we don't yet support c++ */
88
89 #undef STARTFILE_SPEC
90 #define STARTFILE_SPEC "%{!shared: \
91                          %{!symbolic: \
92                           %{p:mcrt1.o%s} \
93                           %{!p: \
94                             %{pg:gcrt1.o%s gmon.o%s} \
95                             %{!pg:crt1.o%s}}}} \
96                         crti.o%s \
97                         %{ansi:values-Xc.o%s} \
98                         %{!ansi: \
99                          %{traditional:values-Xt.o%s} \
100                          %{!traditional:values-Xa.o%s}} \
101                         crtbegin.o%s"
102
103 /* ??? Note: in order for -compat-bsd to work fully,
104    we must somehow arrange to fixincludes /usr/ucbinclude
105    and put the result in $(libsubdir)/ucbinclude.  */
106
107 #undef LIB_SPEC
108 #define LIB_SPEC \
109   "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} %{!shared:%{!symbolic:-lc}}"
110
111 #undef  ENDFILE_SPEC
112 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
113
114 /* This should be the same as in svr4.h, except with -R added.  */
115 #undef LINK_SPEC
116 #define LINK_SPEC \
117   "%{h*} %{V} %{v:%{!V:-V}} \
118    %{b} %{Wl,*:%*} \
119    %{static:-dn -Bstatic} \
120    %{shared:-G -dy -z text %{!h*:%{o*:-h %*}}} \
121    %{symbolic:-Bsymbolic -G -dy -z text %{!h*:%{o*:-h %*}}} \
122    %{G:-G} \
123    %{YP,*} \
124    %{R*} \
125    %{compat-bsd: \
126      %{!YP,*:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
127        %{pg:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
128        %{!p:%{!pg:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}}} \
129      -R /usr/ucblib} \
130    %{!compat-bsd: \
131      %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
132        %{pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
133        %{!p:%{!pg:-Y P,/usr/ccs/lib:/usr/lib}}}} \
134    %{Qy:} %{!Qn:-Qy}"
135
136 /* This defines which switch letters take arguments.
137    It is as in svr4.h but with -R added.  */
138
139 #undef SWITCH_TAKES_ARG
140 #define SWITCH_TAKES_ARG(CHAR) \
141   (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
142    || (CHAR) == 'h' \
143    || (CHAR) == 'x' \
144    || (CHAR) == 'z')
145 \f
146 /* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h.
147    Instead, it is enabled here, because it does work under Solaris.  */
148 /* Define for support of TFmode long double and REAL_ARITHMETIC.
149    Sparc ABI says that long double is 4 words.  */
150 #define LONG_DOUBLE_TYPE_SIZE 128