OSDN Git Service

* sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete.
[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 "-Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 \
29 -Asystem(unix) -Asystem(svr4)"
30
31 #undef CPP_SUBTARGET_SPEC
32 #define CPP_SUBTARGET_SPEC "\
33 %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude} \
34 "
35
36 /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
37    It's safe to pass -s always, even if -g is not used. */
38 #undef ASM_SPEC
39 #define ASM_SPEC "\
40 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s \
41 %{fpic:-K PIC} %{fPIC:-K PIC} \
42 %(asm_cpu) \
43 "
44
45 /* This is here rather than in sparc.h because it's not known what
46    other assemblers will accept.  */
47 #if TARGET_CPU_DEFAULT == TARGET_CPU_v9
48 #undef ASM_CPU_DEFAULT_SPEC
49 #define ASM_CPU_DEFAULT_SPEC "-xarch=v8plus"
50 #endif
51 #if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
52 #undef ASM_CPU_DEFAULT_SPEC
53 #define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusa"
54 #endif
55 #undef ASM_CPU_SPEC
56 #define ASM_CPU_SPEC "\
57 %{mcpu=v8plus:-xarch=v8plus} \
58 %{mcpu=ultrasparc:-xarch=v8plusa} \
59 %{!mcpu*:%(asm_cpu_default)} \
60 "
61
62 /* However it appears that Solaris 2.0 uses the same reg numbering as
63    the old BSD-style system did. */
64
65 #undef DBX_REGISTER_NUMBER
66 /* Same as sparc.h */
67 #define DBX_REGISTER_NUMBER(REGNO) \
68   (TARGET_FLAT && REGNO == FRAME_POINTER_REGNUM ? 31 : REGNO)
69
70 /* We use stabs-in-elf for debugging, because that is what the native
71    toolchain uses.  */
72 #undef PREFERRED_DEBUGGING_TYPE
73 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
74
75 /* The Solaris 2 assembler uses .skip, not .zero, so put this back. */
76 #undef ASM_OUTPUT_SKIP
77 #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
78   fprintf (FILE, "\t.skip %u\n", (SIZE))
79
80 /* Use .uahalf/.uaword so packed structure members don't generate
81    assembler errors when using the native assembler.  */
82 #undef ASM_SHORT
83 #define ASM_SHORT ".uahalf"
84 #undef ASM_LONG
85 #define ASM_LONG ".uaword"
86
87 /* This is how to output a definition of an internal numbered label where
88    PREFIX is the class of label and NUM is the number within the class.  */
89
90 #undef  ASM_OUTPUT_INTERNAL_LABEL
91 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)      \
92   fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
93
94 /* This is how to output a reference to an internal numbered label where
95    PREFIX is the class of label and NUM is the number within the class.  */
96
97 #undef  ASM_OUTPUT_INTERNAL_LABELREF
98 #define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM)   \
99   fprintf (FILE, ".L%s%d", PREFIX, NUM)
100
101 /* This is how to store into the string LABEL
102    the symbol_ref name of an internal numbered label where
103    PREFIX is the class of label and NUM is the number within the class.
104    This is suitable for output with `assemble_name'.  */
105
106 #undef  ASM_GENERATE_INTERNAL_LABEL
107 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)   \
108   sprintf (LABEL, "*.L%s%d", PREFIX, NUM)
109
110 \f
111 /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us.
112    We don't use the standard LIB_SPEC only because we don't yet support c++ */
113
114 #undef STARTFILE_SPEC
115 #define STARTFILE_SPEC "%{!shared: \
116                          %{!symbolic: \
117                           %{p:mcrt1.o%s} \
118                           %{!p: \
119                             %{pg:gcrt1.o%s gmon.o%s} \
120                             %{!pg:crt1.o%s}}}} \
121                         crti.o%s \
122                         %{ansi:values-Xc.o%s} \
123                         %{!ansi: \
124                          %{traditional:values-Xt.o%s} \
125                          %{!traditional:values-Xa.o%s}} \
126                         crtbegin.o%s"
127
128 /* ??? Note: in order for -compat-bsd to work fully,
129    we must somehow arrange to fixincludes /usr/ucbinclude
130    and put the result in $(libsubdir)/ucbinclude.  */
131
132 #undef LIB_SPEC
133 #define LIB_SPEC \
134   "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} %{!shared:%{!symbolic:-lc}}"
135
136 #undef  ENDFILE_SPEC
137 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
138
139 /* This should be the same as in svr4.h, except with -R added.  */
140 #undef LINK_SPEC
141 #define LINK_SPEC \
142   "%{h*} %{v:-V} \
143    %{b} %{Wl,*:%*} \
144    %{static:-dn -Bstatic} \
145    %{shared:-G -dy %{!mimpure-text:-z text} %{!h*:%{o*:-h %*}}} \
146    %{symbolic:-Bsymbolic -G -dy -z text %{!h*:%{o*:-h %*}}} \
147    %{G:-G} \
148    %{YP,*} \
149    %{R*} \
150    %{compat-bsd: \
151      %{!YP,*:%{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
152        %{pg:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
153        %{!p:%{!pg:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}}} \
154      -R /usr/ucblib} \
155    %{!compat-bsd: \
156      %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
157        %{pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
158        %{!p:%{!pg:-Y P,/usr/ccs/lib:/usr/lib}}}} \
159    %{Qy:} %{!Qn:-Qy}"
160
161 /* This defines which switch letters take arguments.
162    It is as in svr4.h but with -R added.  */
163
164 #undef SWITCH_TAKES_ARG
165 #define SWITCH_TAKES_ARG(CHAR) \
166   (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
167    || (CHAR) == 'R' \
168    || (CHAR) == 'h' \
169    || (CHAR) == 'x' \
170    || (CHAR) == 'z')
171 \f
172 /* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h.
173    Instead, it is enabled here, because it does work under Solaris.  */
174 /* Define for support of TFmode long double and REAL_ARITHMETIC.
175    Sparc ABI says that long double is 4 words.  */
176 #define LONG_DOUBLE_TYPE_SIZE 128