2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / config / sparc / sol2-bi.h
blob0a763748d854981b0f01378507f1a620dd901bcc
1 /* Definitions of target machine for GCC, for bi-arch SPARC
2 running Solaris 2 using the system assembler and linker. */
4 /* The default code model. */
5 #undef SPARC_DEFAULT_CMODEL
6 #define SPARC_DEFAULT_CMODEL CM_MEDANY
8 #define AS_SPARC64_FLAG "-xarch=v9"
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
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 #if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
22 #undef CPP_CPU64_DEFAULT_SPEC
23 #define CPP_CPU64_DEFAULT_SPEC ""
24 #undef ASM_CPU32_DEFAULT_SPEC
25 #define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusa"
26 #undef ASM_CPU64_DEFAULT_SPEC
27 #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "a"
28 #endif
30 #if DEFAULT_ARCH32_P
31 #define DEF_ARCH32_SPEC(__str) "%{!m64:" __str "}"
32 #define DEF_ARCH64_SPEC(__str) "%{m64:" __str "}"
33 #else
34 #define DEF_ARCH32_SPEC(__str) "%{m32:" __str "}"
35 #define DEF_ARCH64_SPEC(__str) "%{!m32:" __str "}"
36 #endif
38 #undef CPP_CPU_SPEC
39 #define CPP_CPU_SPEC "\
40 %{mcypress:} \
41 %{msparclite|mf930|mf934:-D__sparclite__} \
42 %{mv8:" DEF_ARCH32_SPEC("-D__sparcv8") "} \
43 %{msupersparc:-D__supersparc__ " DEF_ARCH32_SPEC("-D__sparcv8") "} \
44 %{mcpu=sparclet|mcpu=tsc701:-D__sparclet__} \
45 %{mcpu=sparclite|mcpu-f930|mcpu=f934:-D__sparclite__} \
46 %{mcpu=v8:" DEF_ARCH32_SPEC("-D__sparcv8") "} \
47 %{mcpu=supersparc:-D__supersparc__ " DEF_ARCH32_SPEC("-D__sparcv8") "} \
48 %{mcpu=v9|mcpu=ultrasparc:" DEF_ARCH32_SPEC("-D__sparcv8") "} \
49 %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:%(cpp_cpu_default)}}}}}}} \
52 #undef ASM_CPU_SPEC
53 #define ASM_CPU_SPEC "\
54 %{mcpu=ultrasparc:" DEF_ARCH32_SPEC("-xarch=v8plusa") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "a") "} \
55 %{mcpu=v9:" DEF_ARCH32_SPEC("-xarch=v8plus") DEF_ARCH64_SPEC(AS_SPARC64_FLAG) "} \
56 %{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:" DEF_ARCH32_SPEC("-xarch=v8") DEF_ARCH64_SPEC(AS_SPARC64_FLAG) "}}} \
57 %{!mcpu*:%(asm_cpu_default)} \
60 #undef CPP_CPU_DEFAULT_SPEC
61 #define CPP_CPU_DEFAULT_SPEC \
62 (DEFAULT_ARCH32_P ? "\
63 %{m64:" CPP_CPU64_DEFAULT_SPEC "} \
64 %{!m64:" CPP_CPU32_DEFAULT_SPEC "} \
65 " : "\
66 %{m32:" CPP_CPU32_DEFAULT_SPEC "} \
67 %{!m32:" CPP_CPU64_DEFAULT_SPEC "} \
70 #undef ASM_CPU_DEFAULT_SPEC
71 #define ASM_CPU_DEFAULT_SPEC \
72 (DEFAULT_ARCH32_P ? "\
73 %{m64:" ASM_CPU64_DEFAULT_SPEC "} \
74 %{!m64:" ASM_CPU32_DEFAULT_SPEC "} \
75 " : "\
76 %{m32:" ASM_CPU32_DEFAULT_SPEC "} \
77 %{!m32:" ASM_CPU64_DEFAULT_SPEC "} \
80 /* wchar_t is called differently in <wchar.h> for 32 and 64-bit
81 compilations. This is called for by SCD 2.4.1, p. 6-83, Figure 6-65
82 (32-bit) and p. 6P-10, Figure 6.38 (64-bit). */
84 #undef WCHAR_TYPE
85 #define WCHAR_TYPE (TARGET_ARCH64 ? "int" : "long int")
87 #undef WCHAR_TYPE_SIZE
88 #define WCHAR_TYPE_SIZE 32
90 /* Same for wint_t. See SCD 2.4.1, p. 6-83, Figure 6-66 (32-bit). There's
91 no corresponding 64-bit definition, but this is what Solaris 8
92 <iso/wchar_iso.h> uses. */
94 #undef WINT_TYPE
95 #define WINT_TYPE (TARGET_ARCH64 ? "int" : "long int")
97 #undef WINT_TYPE_SIZE
98 #define WINT_TYPE_SIZE 32
100 #undef CPP_ARCH32_SPEC
101 #define CPP_ARCH32_SPEC ""
102 #undef CPP_ARCH64_SPEC
103 #define CPP_ARCH64_SPEC "-D__arch64__ -D__sparcv9"
105 #undef CPP_ARCH_SPEC
106 #define CPP_ARCH_SPEC "\
107 %{m32:%(cpp_arch32)} \
108 %{m64:%(cpp_arch64)} \
109 %{!m32:%{!m64:%(cpp_arch_default)}} \
112 #undef ASM_ARCH_SPEC
113 #define ASM_ARCH_SPEC ""
115 #undef ASM_ARCH32_SPEC
116 #define ASM_ARCH32_SPEC ""
118 #undef ASM_ARCH64_SPEC
119 #define ASM_ARCH64_SPEC ""
121 #undef ASM_ARCH_DEFAULT_SPEC
122 #define ASM_ARCH_DEFAULT_SPEC ""
124 #undef SUBTARGET_EXTRA_SPECS
125 #define SUBTARGET_EXTRA_SPECS \
126 { "startfile_arch", STARTFILE_ARCH_SPEC }, \
127 { "link_arch32", LINK_ARCH32_SPEC }, \
128 { "link_arch64", LINK_ARCH64_SPEC }, \
129 { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
130 { "link_arch", LINK_ARCH_SPEC },
133 * This should be the same as in sol2.h, except with "/sparcv9"
134 * appended to the paths and /usr/ccs/lib is no longer necessary
136 #define LINK_ARCH64_SPEC_BASE \
137 "%{mcmodel=medlow:-M /usr/lib/ld/sparcv9/map.below4G} \
138 %{G:-G} \
139 %{YP,*} \
140 %{R*} \
141 %{compat-bsd: \
142 %{!YP,*:%{p|pg:-Y P,/usr/ucblib/sparcv9:/usr/lib/libp/sparcv9:/usr/lib/sparcv9} \
143 %{!p:%{!pg:-Y P,/usr/ucblib/sparcv9:/usr/lib/sparcv9}}} \
144 -R /usr/ucblib} \
145 %{!compat-bsd: \
146 %{!YP,*:%{p|pg:-Y P,/usr/lib/libp/sparcv9:/usr/lib/sparcv9} \
147 %{!p:%{!pg:-Y P,/usr/lib/sparcv9}}}}"
149 #define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE
151 #undef LINK_ARCH_SPEC
152 #if DISABLE_MULTILIB
153 #if DEFAULT_ARCH32_P
154 #define LINK_ARCH_SPEC "\
155 %{m32:%(link_arch32)} \
156 %{m64:%edoes not support multilib} \
157 %{!m32:%{!m64:%(link_arch_default)}} \
159 #else
160 #define LINK_ARCH_SPEC "\
161 %{m32:%edoes not support multilib} \
162 %{m64:%(link_arch64)} \
163 %{!m32:%{!m64:%(link_arch_default)}} \
165 #endif
166 #else
167 #define LINK_ARCH_SPEC "\
168 %{m32:%(link_arch32)} \
169 %{m64:%(link_arch64)} \
170 %{!m32:%{!m64:%(link_arch_default)}} \
172 #endif
174 #define LINK_ARCH_DEFAULT_SPEC \
175 (DEFAULT_ARCH32_P ? LINK_ARCH32_SPEC : LINK_ARCH64_SPEC)
177 #undef CC1_SPEC
178 #if DEFAULT_ARCH32_P
179 #define CC1_SPEC "\
180 %{sun4:} %{target:} \
181 %{mcypress:-mcpu=cypress} \
182 %{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
183 %{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
184 %{m32:%{m64:%emay not use both -m32 and -m64}} \
185 %{m64:-mptr64 -mstack-bias -mno-v8plus \
186 %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8*:%{!msupersparc:-mcpu=v9}}}}}}}} \
188 #else
189 #define CC1_SPEC "\
190 %{sun4:} %{target:} \
191 %{mcypress:-mcpu=cypress} \
192 %{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
193 %{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
194 %{m32:%{m64:%emay not use both -m32 and -m64}} \
195 %{m32:-mptr32 -mno-stack-bias \
196 %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8*:%{!msupersparc:-mcpu=cypress}}}}}}}} \
197 %{mv8plus:-m32 -mptr32 -mno-stack-bias \
198 %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:-mcpu=v9}}}}}}}} \
200 #endif
202 #if DEFAULT_ARCH32_P
203 #define MULTILIB_DEFAULTS { "m32" }
204 #else
205 #define MULTILIB_DEFAULTS { "m64" }
206 #endif
208 /* We use stabs-in-elf in 32-bit mode, because that is what the native
209 toolchain uses. But gdb can't handle truncated 32-bit stabs so we
210 use dwarf2 in 64-bit mode. */
211 #undef PREFERRED_DEBUGGING_TYPE
212 #define PREFERRED_DEBUGGING_TYPE (TARGET_ARCH32 ? DBX_DEBUG : DWARF2_DEBUG)
214 /* We can't use the above definition for the purposes of specs. */
215 #if defined(HAVE_AS_GDWARF2_DEBUG_FLAG) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
216 # if DEFAULT_ARCH32_P
217 # define ASM_DEBUG_SPEC "%{gdwarf-2*:--gdwarf2}%{!gdwarf-2*:%{g*:--gstabs}}"
218 # else
219 # define ASM_DEBUG_SPEC "%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}"
220 # endif
221 #endif