OSDN Git Service

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