OSDN Git Service

* target.h (struct gcc_target): New field 'dwarf_handle_frame_unspec'.
[pf3gnuchains/gcc-fork.git] / gcc / config / sparc / sol2-bi.h
1 /* Definitions of target machine for GCC, for bi-arch SPARC
2    running Solaris 2 using the system assembler and linker.  */
3
4 /* The default code model.  */
5 #undef SPARC_DEFAULT_CMODEL
6 #define SPARC_DEFAULT_CMODEL CM_MEDANY
7
8 #define AS_SPARC64_FLAG "-xarch=v9"
9
10 #undef ASM_CPU32_DEFAULT_SPEC
11 #define ASM_CPU32_DEFAULT_SPEC  ""
12 #undef ASM_CPU64_DEFAULT_SPEC
13 #define ASM_CPU64_DEFAULT_SPEC  AS_SPARC64_FLAG
14
15 #if TARGET_CPU_DEFAULT == TARGET_CPU_v9
16 #undef CPP_CPU64_DEFAULT_SPEC
17 #define CPP_CPU64_DEFAULT_SPEC ""
18 #undef ASM_CPU32_DEFAULT_SPEC
19 #define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plus"
20 #endif
21
22 #if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
23 #undef CPP_CPU64_DEFAULT_SPEC
24 #define CPP_CPU64_DEFAULT_SPEC ""
25 #undef ASM_CPU32_DEFAULT_SPEC
26 #define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusa"
27 #undef ASM_CPU64_DEFAULT_SPEC
28 #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "a"
29 #endif
30
31 #if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3
32 #undef CPP_CPU64_DEFAULT_SPEC
33 #define CPP_CPU64_DEFAULT_SPEC ""
34 #undef ASM_CPU32_DEFAULT_SPEC
35 #define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusb"
36 #undef ASM_CPU64_DEFAULT_SPEC
37 #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "b"
38 #endif
39
40 #if DEFAULT_ARCH32_P
41 #define DEF_ARCH32_SPEC(__str) "%{!m64:" __str "}"
42 #define DEF_ARCH64_SPEC(__str) "%{m64:" __str "}"
43 #else
44 #define DEF_ARCH32_SPEC(__str) "%{m32:" __str "}"
45 #define DEF_ARCH64_SPEC(__str) "%{!m32:" __str "}"
46 #endif
47
48 #undef CPP_CPU_SPEC
49 #define CPP_CPU_SPEC "\
50 %{mcypress:} \
51 %{msparclite|mf930|mf934:-D__sparclite__} \
52 %{mv8:" DEF_ARCH32_SPEC("-D__sparcv8") "} \
53 %{msupersparc:-D__supersparc__ " DEF_ARCH32_SPEC("-D__sparcv8") "} \
54 %{mcpu=sparclet|mcpu=tsc701:-D__sparclet__} \
55 %{mcpu=sparclite|mcpu-f930|mcpu=f934:-D__sparclite__} \
56 %{mcpu=v8:" DEF_ARCH32_SPEC("-D__sparcv8") "} \
57 %{mcpu=supersparc:-D__supersparc__ " DEF_ARCH32_SPEC("-D__sparcv8") "} \
58 %{mcpu=v9|mcpu=ultrasparc|mcpu=ultrasparc3:" DEF_ARCH32_SPEC("-D__sparcv8") "} \
59 %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:%(cpp_cpu_default)}}}}}}} \
60 "
61
62 #undef ASM_CPU_SPEC
63 #define ASM_CPU_SPEC "\
64 %{mcpu=v9:" DEF_ARCH32_SPEC("-xarch=v8plus") DEF_ARCH64_SPEC(AS_SPARC64_FLAG) "} \
65 %{mcpu=ultrasparc:" DEF_ARCH32_SPEC("-xarch=v8plusa") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "a") "} \
66 %{mcpu=ultrasparc3:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "b") "} \
67 %{!mcpu=ultrasparc3:%{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:" DEF_ARCH32_SPEC("-xarch=v8") DEF_ARCH64_SPEC(AS_SPARC64_FLAG) "}}}} \
68 %{!mcpu*:%(asm_cpu_default)} \
69 "
70
71 #undef CPP_CPU_DEFAULT_SPEC
72 #define CPP_CPU_DEFAULT_SPEC \
73 (DEFAULT_ARCH32_P ? "\
74 %{m64:" CPP_CPU64_DEFAULT_SPEC "} \
75 %{!m64:" CPP_CPU32_DEFAULT_SPEC "} \
76 " : "\
77 %{m32:" CPP_CPU32_DEFAULT_SPEC "} \
78 %{!m32:" CPP_CPU64_DEFAULT_SPEC "} \
79 ")
80
81 #undef ASM_CPU_DEFAULT_SPEC
82 #define ASM_CPU_DEFAULT_SPEC \
83 (DEFAULT_ARCH32_P ? "\
84 %{m64:" ASM_CPU64_DEFAULT_SPEC "} \
85 %{!m64:" ASM_CPU32_DEFAULT_SPEC "} \
86 " : "\
87 %{m32:" ASM_CPU32_DEFAULT_SPEC "} \
88 %{!m32:" ASM_CPU64_DEFAULT_SPEC "} \
89 ")
90
91 /* wchar_t is called differently in <wchar.h> for 32 and 64-bit
92    compilations.  This is called for by SCD 2.4.1, p. 6-83, Figure 6-65
93    (32-bit) and p. 6P-10, Figure 6.38 (64-bit).  */
94
95 #undef WCHAR_TYPE
96 #define WCHAR_TYPE (TARGET_ARCH64 ? "int" : "long int")
97
98 #undef WCHAR_TYPE_SIZE
99 #define WCHAR_TYPE_SIZE 32
100
101 /* Same for wint_t.  See SCD 2.4.1, p. 6-83, Figure 6-66 (32-bit).  There's
102    no corresponding 64-bit definition, but this is what Solaris 8
103    <iso/wchar_iso.h> uses.  */
104
105 #undef WINT_TYPE
106 #define WINT_TYPE (TARGET_ARCH64 ? "int" : "long int")
107
108 #undef WINT_TYPE_SIZE
109 #define WINT_TYPE_SIZE 32
110
111 #undef CPP_ARCH32_SPEC
112 #define CPP_ARCH32_SPEC ""
113 #undef CPP_ARCH64_SPEC
114 #define CPP_ARCH64_SPEC "-D__arch64__ -D__sparcv9"
115
116 #undef CPP_ARCH_SPEC
117 #define CPP_ARCH_SPEC "\
118 %{m32:%(cpp_arch32)} \
119 %{m64:%(cpp_arch64)} \
120 %{!m32:%{!m64:%(cpp_arch_default)}} \
121 "
122
123 #undef ASM_ARCH_SPEC
124 #define ASM_ARCH_SPEC ""
125
126 #undef ASM_ARCH32_SPEC
127 #define ASM_ARCH32_SPEC ""
128
129 #undef ASM_ARCH64_SPEC
130 #define ASM_ARCH64_SPEC ""
131
132 #undef ASM_ARCH_DEFAULT_SPEC
133 #define ASM_ARCH_DEFAULT_SPEC ""
134
135 #undef SUBTARGET_EXTRA_SPECS
136 #define SUBTARGET_EXTRA_SPECS \
137   { "startfile_arch",    STARTFILE_ARCH_SPEC },           \
138   { "link_arch32",       LINK_ARCH32_SPEC },              \
139   { "link_arch64",       LINK_ARCH64_SPEC },              \
140   { "link_arch_default", LINK_ARCH_DEFAULT_SPEC },        \
141   { "link_arch",         LINK_ARCH_SPEC },
142     
143 /*
144  * This should be the same as in sol2.h, except with "/sparcv9"
145  * appended to the paths and /usr/ccs/lib is no longer necessary
146  */
147 #define LINK_ARCH64_SPEC_BASE \
148   "%{mcmodel=medlow:-M /usr/lib/ld/sparcv9/map.below4G} \
149    %{G:-G} \
150    %{YP,*} \
151    %{R*} \
152    %{compat-bsd: \
153      %{!YP,*:%{p|pg:-Y P,/usr/ucblib/sparcv9:/usr/lib/libp/sparcv9:/usr/lib/sparcv9} \
154        %{!p:%{!pg:-Y P,/usr/ucblib/sparcv9:/usr/lib/sparcv9}}} \
155      -R /usr/ucblib/sparcv9} \
156    %{!compat-bsd: \
157      %{!YP,*:%{p|pg:-Y P,/usr/lib/libp/sparcv9:/usr/lib/sparcv9} \
158        %{!p:%{!pg:-Y P,/usr/lib/sparcv9}}}}"
159
160 #define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE
161
162 #undef LINK_ARCH_SPEC
163 #if DISABLE_MULTILIB
164 #if DEFAULT_ARCH32_P
165 #define LINK_ARCH_SPEC "\
166 %{m32:%(link_arch32)} \
167 %{m64:%edoes not support multilib} \
168 %{!m32:%{!m64:%(link_arch_default)}} \
169 "
170 #else
171 #define LINK_ARCH_SPEC "\
172 %{m32:%edoes not support multilib} \
173 %{m64:%(link_arch64)} \
174 %{!m32:%{!m64:%(link_arch_default)}} \
175 "
176 #endif
177 #else
178 #define LINK_ARCH_SPEC "\
179 %{m32:%(link_arch32)} \
180 %{m64:%(link_arch64)} \
181 %{!m32:%{!m64:%(link_arch_default)}} \
182 "
183 #endif
184
185 #define LINK_ARCH_DEFAULT_SPEC \
186 (DEFAULT_ARCH32_P ? LINK_ARCH32_SPEC : LINK_ARCH64_SPEC)
187
188 #undef  CC1_SPEC
189 #if DEFAULT_ARCH32_P
190 #define CC1_SPEC "\
191 %{sun4:} %{target:} \
192 %{mcypress:-mcpu=cypress} \
193 %{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
194 %{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
195 %{m32:%{m64:%emay not use both -m32 and -m64}} \
196 %{m64:-mptr64 -mstack-bias -mno-v8plus \
197   %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8*:%{!msupersparc:-mcpu=v9}}}}}}}} \
198 "
199 #else
200 #define CC1_SPEC "\
201 %{sun4:} %{target:} \
202 %{mcypress:-mcpu=cypress} \
203 %{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
204 %{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
205 %{m32:%{m64:%emay not use both -m32 and -m64}} \
206 %{m32:-mptr32 -mno-stack-bias \
207   %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8*:%{!msupersparc:-mcpu=cypress}}}}}}}} \
208 %{mv8plus:-m32 -mptr32 -mno-stack-bias \
209   %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:-mcpu=v9}}}}}}}} \
210 "
211 #endif
212
213 /* Support for a compile-time default CPU, et cetera.  The rules are:
214    --with-cpu is ignored if -mcpu is specified.
215    --with-tune is ignored if -mtune is specified.
216    --with-float is ignored if -mhard-float, -msoft-float, -mfpu, or -mno-fpu
217      are specified.
218    In the SPARC_BI_ARCH compiler we cannot pass %{!mcpu=*:-mcpu=%(VALUE)}
219    here, otherwise say -mcpu=v7 would be passed even when -m64.
220    CC1_SPEC above takes care of this instead.  */
221 #undef OPTION_DEFAULT_SPECS
222 #if DEFAULT_ARCH32_P
223 #define OPTION_DEFAULT_SPECS \
224   {"cpu", "%{!m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
225   {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
226   {"float", "%{!msoft-float:%{!mhard-float:%{!fpu:%{!no-fpu:-m%(VALUE)-float}}}}" }
227 #else
228 #define OPTION_DEFAULT_SPECS \
229   {"cpu", "%{!m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
230   {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
231   {"float", "%{!msoft-float:%{!mhard-float:%{!fpu:%{!no-fpu:-m%(VALUE)-float}}}}" }
232 #endif
233
234 #if DEFAULT_ARCH32_P
235 #define MULTILIB_DEFAULTS { "m32" }
236 #else
237 #define MULTILIB_DEFAULTS { "m64" }
238 #endif