| 1 |
/* Definitions of target machine for GCC, for SPARC running Solaris 2 |
| 2 |
Copyright (C) 1992-2025 Free Software Foundation, Inc. |
| 3 |
Contributed by Ron Guilmette ([email protected]). |
| 4 |
Additional changes by David V. Henkel-Wallace ([email protected]). |
| 5 |
|
| 6 |
This file is part of GCC. |
| 7 |
|
| 8 |
GCC 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 3, or (at your option) |
| 11 |
any later version. |
| 12 |
|
| 13 |
GCC 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 GCC; see the file COPYING3. If not see |
| 20 |
<http://www.gnu.org/licenses/>. */ |
| 21 |
|
| 22 |
/* Solaris allows 64-bit out and global registers to be used in 32-bit mode. |
| 23 |
sparc_override_options will disable V8+ if either not generating V9 code |
| 24 |
or generating 64-bit code. */ |
| 25 |
#undef TARGET_DEFAULT |
| 26 |
#ifdef TARGET_64BIT_DEFAULT |
| 27 |
#define TARGET_DEFAULT \ |
| 28 |
(MASK_V9 + MASK_64BIT + MASK_PTR64 + MASK_STACK_BIAS + \ |
| 29 |
MASK_V8PLUS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128) |
| 30 |
#else |
| 31 |
#define TARGET_DEFAULT \ |
| 32 |
(MASK_V8PLUS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128) |
| 33 |
#endif |
| 34 |
|
| 35 |
/* The default code model used to be CM_MEDANY on Solaris |
| 36 |
but even Sun eventually found it to be quite wasteful |
| 37 |
and changed it to CM_MEDMID in the Studio 9 compiler. */ |
| 38 |
#undef SPARC_DEFAULT_CMODEL |
| 39 |
#define SPARC_DEFAULT_CMODEL CM_MEDMID |
| 40 |
|
| 41 |
/* Redue ggc-page.cc's chunk size to account for mmap red-zone pages. */ |
| 42 |
#define GGC_QUIRE_SIZE 510 |
| 43 |
|
| 44 |
/* Select a format to encode pointers in exception handling data. CODE |
| 45 |
is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is |
| 46 |
true if the symbol may be affected by dynamic relocations. |
| 47 |
|
| 48 |
Some Solaris dynamic linkers don't handle unaligned section relative |
| 49 |
relocs properly, so force them to be aligned. */ |
| 50 |
#ifndef HAVE_AS_SPARC_UA_PCREL |
| 51 |
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ |
| 52 |
((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr) |
| 53 |
#endif |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
/* Supposedly the same as vanilla sparc svr4, except for the stuff below: */ |
| 58 |
|
| 59 |
/* If the assembler supports -xarch=sparc4, we switch to the explicit |
| 60 |
word size selection mechanism available both in GNU as and Sun as, |
| 61 |
for the Niagara4 and above configurations. */ |
| 62 |
#ifdef HAVE_AS_SPARC4 |
| 63 |
|
| 64 |
#define AS_SPARC32_FLAG "" |
| 65 |
#define AS_SPARC64_FLAG "" |
| 66 |
|
| 67 |
#ifndef USE_GAS |
| 68 |
#undef ASM_ARCH32_SPEC |
| 69 |
#define ASM_ARCH32_SPEC "-m32" |
| 70 |
#undef ASM_ARCH64_SPEC |
| 71 |
#define ASM_ARCH64_SPEC "-m64" |
| 72 |
#endif |
| 73 |
|
| 74 |
/* Both Sun as and GNU as understand -K PIC. */ |
| 75 |
#undef ASM_SPEC |
| 76 |
#define ASM_SPEC ASM_SPEC_BASE " %(asm_arch)" ASM_PIC_SPEC |
| 77 |
|
| 78 |
#else /* HAVE_AS_SPARC4 */ |
| 79 |
|
| 80 |
#define AS_SPARC32_FLAG "-xarch=v8plus" |
| 81 |
#define AS_SPARC64_FLAG "-xarch=v9" |
| 82 |
|
| 83 |
#undef AS_NIAGARA4_FLAG |
| 84 |
#define AS_NIAGARA4_FLAG AS_NIAGARA3_FLAG |
| 85 |
|
| 86 |
#undef ASM_ARCH32_SPEC |
| 87 |
#define ASM_ARCH32_SPEC "" |
| 88 |
|
| 89 |
#undef ASM_ARCH64_SPEC |
| 90 |
#define ASM_ARCH64_SPEC "" |
| 91 |
|
| 92 |
#undef ASM_ARCH_DEFAULT_SPEC |
| 93 |
#define ASM_ARCH_DEFAULT_SPEC "" |
| 94 |
|
| 95 |
#undef ASM_ARCH_SPEC |
| 96 |
#define ASM_ARCH_SPEC "" |
| 97 |
|
| 98 |
/* Both Sun as and GNU as understand -K PIC. */ |
| 99 |
#undef ASM_SPEC |
| 100 |
#define ASM_SPEC ASM_SPEC_BASE ASM_PIC_SPEC |
| 101 |
|
| 102 |
#endif /* HAVE_AS_SPARC4 */ |
| 103 |
|
| 104 |
|
| 105 |
#undef ASM_CPU32_DEFAULT_SPEC |
| 106 |
#define ASM_CPU32_DEFAULT_SPEC "" |
| 107 |
#undef ASM_CPU64_DEFAULT_SPEC |
| 108 |
#define ASM_CPU64_DEFAULT_SPEC "-xarch=v9" |
| 109 |
|
| 110 |
#if TARGET_CPU_DEFAULT == TARGET_CPU_v9 |
| 111 |
#undef CPP_CPU64_DEFAULT_SPEC |
| 112 |
#define CPP_CPU64_DEFAULT_SPEC "" |
| 113 |
#undef ASM_CPU32_DEFAULT_SPEC |
| 114 |
#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plus" |
| 115 |
#endif |
| 116 |
|
| 117 |
#if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc |
| 118 |
#undef CPP_CPU64_DEFAULT_SPEC |
| 119 |
#define CPP_CPU64_DEFAULT_SPEC "" |
| 120 |
#undef ASM_CPU32_DEFAULT_SPEC |
| 121 |
#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusa" |
| 122 |
#undef ASM_CPU64_DEFAULT_SPEC |
| 123 |
#define ASM_CPU64_DEFAULT_SPEC "-xarch=v9a" |
| 124 |
#endif |
| 125 |
|
| 126 |
#if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3 |
| 127 |
#undef CPP_CPU64_DEFAULT_SPEC |
| 128 |
#define CPP_CPU64_DEFAULT_SPEC "" |
| 129 |
#undef ASM_CPU32_DEFAULT_SPEC |
| 130 |
#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusb" |
| 131 |
#undef ASM_CPU64_DEFAULT_SPEC |
| 132 |
#define ASM_CPU64_DEFAULT_SPEC "-xarch=v9b" |
| 133 |
#endif |
| 134 |
|
| 135 |
#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara |
| 136 |
#undef CPP_CPU64_DEFAULT_SPEC |
| 137 |
#define CPP_CPU64_DEFAULT_SPEC "" |
| 138 |
#undef ASM_CPU32_DEFAULT_SPEC |
| 139 |
#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusb" |
| 140 |
#undef ASM_CPU64_DEFAULT_SPEC |
| 141 |
#define ASM_CPU64_DEFAULT_SPEC "-xarch=v9b" |
| 142 |
#endif |
| 143 |
|
| 144 |
#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara2 |
| 145 |
#undef CPP_CPU64_DEFAULT_SPEC |
| 146 |
#define CPP_CPU64_DEFAULT_SPEC "" |
| 147 |
#undef ASM_CPU32_DEFAULT_SPEC |
| 148 |
#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusb" |
| 149 |
#undef ASM_CPU64_DEFAULT_SPEC |
| 150 |
#define ASM_CPU64_DEFAULT_SPEC "-xarch=v9b" |
| 151 |
#endif |
| 152 |
|
| 153 |
#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara3 |
| 154 |
#undef CPP_CPU64_DEFAULT_SPEC |
| 155 |
#define CPP_CPU64_DEFAULT_SPEC "" |
| 156 |
#undef ASM_CPU32_DEFAULT_SPEC |
| 157 |
#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plus" AS_NIAGARA3_FLAG |
| 158 |
#undef ASM_CPU64_DEFAULT_SPEC |
| 159 |
#define ASM_CPU64_DEFAULT_SPEC "-xarch=v9" AS_NIAGARA3_FLAG |
| 160 |
#endif |
| 161 |
|
| 162 |
#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara4 |
| 163 |
#undef CPP_CPU64_DEFAULT_SPEC |
| 164 |
#define CPP_CPU64_DEFAULT_SPEC "" |
| 165 |
#undef ASM_CPU32_DEFAULT_SPEC |
| 166 |
#define ASM_CPU32_DEFAULT_SPEC AS_SPARC32_FLAG AS_NIAGARA4_FLAG |
| 167 |
#undef ASM_CPU64_DEFAULT_SPEC |
| 168 |
#define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG AS_NIAGARA4_FLAG |
| 169 |
#endif |
| 170 |
|
| 171 |
#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara7 |
| 172 |
#undef CPP_CPU64_DEFAULT_SPEC |
| 173 |
#define CPP_CPU64_DEFAULT_SPEC "" |
| 174 |
#undef ASM_CPU32_DEFAULT_SPEC |
| 175 |
#define ASM_CPU32_DEFAULT_SPEC AS_SPARC32_FLAG AS_NIAGARA7_FLAG |
| 176 |
#undef ASM_CPU64_DEFAULT_SPEC |
| 177 |
#define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG AS_NIAGARA7_FLAG |
| 178 |
#endif |
| 179 |
|
| 180 |
#if TARGET_CPU_DEFAULT == TARGET_CPU_m8 |
| 181 |
#undef CPP_CPU64_DEFAULT_SPEC |
| 182 |
#define CPP_CPU64_DEFAULT_SPEC "" |
| 183 |
#undef ASM_CPU32_DEFAULT_SPEC |
| 184 |
#define ASM_CPU32_DEFAULT_SPEC AS_SPARC32_FLAG AS_M8_FLAG |
| 185 |
#undef ASM_CPU64_DEFAULT_SPEC |
| 186 |
#define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG AS_M8_FLAG |
| 187 |
#endif |
| 188 |
|
| 189 |
#undef CPP_CPU_SPEC |
| 190 |
#define CPP_CPU_SPEC "\ |
| 191 |
%{mcpu=sparclet|mcpu=tsc701:-D__sparclet__} \ |
| 192 |
%{mcpu=sparclite|mcpu-f930|mcpu=f934:-D__sparclite__} \ |
| 193 |
%{mcpu=v8:" DEF_ARCH32_SPEC("-D__sparcv8") "} \ |
| 194 |
%{mcpu=supersparc:-D__supersparc__ " DEF_ARCH32_SPEC("-D__sparcv8") "} \ |
| 195 |
%{mcpu=v9|mcpu=ultrasparc|mcpu=ultrasparc3|mcpu=niagara|mcpu=niagara2|mcpu=niagara3|mcpu=niagara4|mcpu=niagara7|mcpu=m8:" DEF_ARCH32_SPEC("-D__sparcv8") "} \ |
| 196 |
%{!mcpu*:%(cpp_cpu_default)} \ |
| 197 |
" |
| 198 |
|
| 199 |
#undef CPP_CPU_DEFAULT_SPEC |
| 200 |
#define CPP_CPU_DEFAULT_SPEC \ |
| 201 |
(DEFAULT_ARCH32_P ? "\ |
| 202 |
%{m64:" CPP_CPU64_DEFAULT_SPEC "} \ |
| 203 |
%{!m64:" CPP_CPU32_DEFAULT_SPEC "} \ |
| 204 |
" : "\ |
| 205 |
%{m32:" CPP_CPU32_DEFAULT_SPEC "} \ |
| 206 |
%{!m32:" CPP_CPU64_DEFAULT_SPEC "} \ |
| 207 |
") |
| 208 |
|
| 209 |
#undef CPP_ARCH32_SPEC |
| 210 |
#define CPP_ARCH32_SPEC "" |
| 211 |
#undef CPP_ARCH64_SPEC |
| 212 |
#define CPP_ARCH64_SPEC "-D__arch64__ -D__sparcv9" |
| 213 |
|
| 214 |
#undef CPP_ARCH_SPEC |
| 215 |
#define CPP_ARCH_SPEC "\ |
| 216 |
%{m32:%(cpp_arch32)} \ |
| 217 |
%{m64:%(cpp_arch64)} \ |
| 218 |
%{!m32:%{!m64:%(cpp_arch_default)}} \ |
| 219 |
" |
| 220 |
|
| 221 |
/* -mcpu=native handling only makes sense with compiler running on |
| 222 |
a SPARC chip. */ |
| 223 |
#if defined(__sparc__) && defined(__SVR4) |
| 224 |
extern const char *host_detect_local_cpu (int argc, const char **argv); |
| 225 |
# define EXTRA_SPEC_FUNCTIONS \ |
| 226 |
{ "local_cpu_detect", host_detect_local_cpu }, |
| 227 |
|
| 228 |
# define MCPU_MTUNE_NATIVE_SPECS \ |
| 229 |
" %{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}" \ |
| 230 |
" %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}" |
| 231 |
#else |
| 232 |
# define MCPU_MTUNE_NATIVE_SPECS "" |
| 233 |
#endif |
| 234 |
|
| 235 |
#define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS |
| 236 |
|
| 237 |
#undef CC1_SPEC |
| 238 |
#if DEFAULT_ARCH32_P |
| 239 |
#define CC1_SPEC "\ |
| 240 |
%{m64:%{m32:%emay not use both -m32 and -m64}} \ |
| 241 |
%{m64:-mptr64 -mstack-bias -mno-v8plus \ |
| 242 |
%{!mcpu*:-%{!mv8plus:mcpu=v9}}} \ |
| 243 |
" ASAN_CC1_SPEC |
| 244 |
#else |
| 245 |
#define CC1_SPEC "\ |
| 246 |
%{m32:%{m64:%emay not use both -m32 and -m64}} \ |
| 247 |
%{m32:-mptr32 -mno-stack-bias \ |
| 248 |
%{!mcpu*:%{!mv8plus:-mcpu=v9}}} \ |
| 249 |
%{mv8plus:-m32 -mptr32 -mno-stack-bias \ |
| 250 |
%{!mcpu*:-mcpu=v9}} \ |
| 251 |
" ASAN_CC1_SPEC |
| 252 |
#endif |
| 253 |
|
| 254 |
/* Support for a compile-time default CPU, et cetera. The rules are: |
| 255 |
--with-cpu is ignored if -mcpu is specified; likewise --with-cpu-32 |
| 256 |
and --with-cpu-64. |
| 257 |
--with-tune is ignored if -mtune is specified; likewise --with-tune-32 |
| 258 |
and --with-tune-64. |
| 259 |
--with-float is ignored if -mhard-float, -msoft-float, -mfpu, or -mno-fpu |
| 260 |
are specified. |
| 261 |
In the SPARC_BI_ARCH compiler we cannot pass %{!mcpu=*:-mcpu=%(VALUE)} |
| 262 |
here, otherwise say -mcpu=v7 would be passed even when -m64. |
| 263 |
CC1_SPEC above takes care of this instead. |
| 264 |
|
| 265 |
Note that the order of the cpu* and tune* options matters: the |
| 266 |
config.gcc file always sets with_cpu to some value, even if the |
| 267 |
user didn't use --with-cpu when invoking the configure script. |
| 268 |
This value is based on the target name. Therefore we have to make |
| 269 |
sure that --with-cpu-32 takes precedence to --with-cpu in < v9 |
| 270 |
systems, and that --with-cpu-64 takes precedence to --with-cpu in |
| 271 |
>= v9 systems. As for the tune* options, in some platforms |
| 272 |
config.gcc also sets a default value for it if the user didn't use |
| 273 |
--with-tune when invoking the configure script. */ |
| 274 |
#undef OPTION_DEFAULT_SPECS |
| 275 |
#if DEFAULT_ARCH32_P |
| 276 |
#define OPTION_DEFAULT_SPECS \ |
| 277 |
{"cpu_32", "%{!m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ |
| 278 |
{"cpu_64", "%{m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ |
| 279 |
{"cpu", "%{!m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ |
| 280 |
{"tune_32", "%{!m64:%{!mtune=*:-mtune=%(VALUE)}}" }, \ |
| 281 |
{"tune_64", "%{m64:%{!mtune=*:-mtune=%(VALUE)}}" }, \ |
| 282 |
{"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \ |
| 283 |
{"float", "%{!msoft-float:%{!mhard-float:%{!mfpu:%{!mno-fpu:-m%(VALUE)-float}}}}" } |
| 284 |
#else |
| 285 |
#define OPTION_DEFAULT_SPECS \ |
| 286 |
{"cpu_32", "%{m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ |
| 287 |
{"cpu_64", "%{!m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ |
| 288 |
{"cpu", "%{!m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ |
| 289 |
{"tune_32", "%{m32:%{!mtune=*:-mtune=%(VALUE)}}" }, \ |
| 290 |
{"tune_64", "%{!m32:%{!mtune=*:-mtune=%(VALUE)}}" }, \ |
| 291 |
{"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \ |
| 292 |
{"float", "%{!msoft-float:%{!mhard-float:%{!mfpu:%{!mno-fpu:-m%(VALUE)-float}}}}" } |
| 293 |
#endif |
| 294 |
|
| 295 |
#undef ASM_CPU_SPEC |
| 296 |
#define ASM_CPU_SPEC "\ |
| 297 |
%{mcpu=v9:" DEF_ARCH32_SPEC("-xarch=v8plus") DEF_ARCH64_SPEC("-xarch=v9") "} \ |
| 298 |
%{mcpu=ultrasparc:" DEF_ARCH32_SPEC("-xarch=v8plusa") DEF_ARCH64_SPEC("-xarch=v9a") "} \ |
| 299 |
%{mcpu=ultrasparc3:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC("-xarch=v9b") "} \ |
| 300 |
%{mcpu=niagara:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC("-xarch=v9b") "} \ |
| 301 |
%{mcpu=niagara2:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC("-xarch=v9b") "} \ |
| 302 |
%{mcpu=niagara3:" DEF_ARCH32_SPEC("-xarch=v8plus" AS_NIAGARA3_FLAG) DEF_ARCH64_SPEC("-xarch=v9" AS_NIAGARA3_FLAG) "} \ |
| 303 |
%{mcpu=niagara4:" DEF_ARCH32_SPEC(AS_SPARC32_FLAG AS_NIAGARA4_FLAG) DEF_ARCH64_SPEC(AS_SPARC64_FLAG AS_NIAGARA4_FLAG) "} \ |
| 304 |
%{mcpu=niagara7:" DEF_ARCH32_SPEC(AS_SPARC32_FLAG AS_NIAGARA7_FLAG) DEF_ARCH64_SPEC(AS_SPARC64_FLAG AS_NIAGARA7_FLAG) "} \ |
| 305 |
%{mcpu=m8:" DEF_ARCH32_SPEC(AS_SPARC32_FLAG AS_M8_FLAG) DEF_ARCH64_SPEC(AS_SPARC64_FLAG AS_M8_FLAG) "} \ |
| 306 |
%{!mcpu=m8:%{!mcpu=niagara7:%{!mcpu=niagara4:%{!mcpu=niagara3:%{!mcpu=niagara2:%{!mcpu=niagara:%{!mcpu=ultrasparc3:%{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:" DEF_ARCH32_SPEC("-xarch=v8") DEF_ARCH64_SPEC("-xarch=v9") "}}}}}}}}}} \ |
| 307 |
%{!mcpu*:%(asm_cpu_default)} \ |
| 308 |
" |
| 309 |
|
| 310 |
#ifdef USE_GLD |
| 311 |
/* Since binutils 2.21, GNU ld supports new *_sol2 emulations to strictly |
| 312 |
follow the Solaris 2 ABI. Prefer them if present. */ |
| 313 |
#ifdef HAVE_LD_SOL2_EMULATION |
| 314 |
#define ARCH32_EMULATION "elf32_sparc_sol2" |
| 315 |
#define ARCH64_EMULATION "elf64_sparc_sol2" |
| 316 |
#else |
| 317 |
#define ARCH32_EMULATION "elf32_sparc" |
| 318 |
#define ARCH64_EMULATION "elf64_sparc" |
| 319 |
#endif |
| 320 |
#endif |
| 321 |
|
| 322 |
#define ARCH64_SUBDIR "sparcv9" |
| 323 |
|
| 324 |
#define SUBTARGET_CPU_EXTRA_SPECS |
| 325 |
|
| 326 |
#define ENDFILE_ARCH_SPEC "" |
| 327 |
|
| 328 |
/* -fsanitize=address is currently only supported for 32-bit. */ |
| 329 |
#define ASAN_REJECT_SPEC \ |
| 330 |
DEF_ARCH64_SPEC("%e-fsanitize=address is not supported in this configuration") |
| 331 |
|
| 332 |
|
| 333 |
/* Register the Solaris-specific #pragma directives. */ |
| 334 |
#define REGISTER_TARGET_PRAGMAS() solaris_register_pragmas () |
| 335 |
|
| 336 |
#if defined(USE_GAS) && defined(HAVE_AS_TLS) |
| 337 |
/* Use GNU extensions to TLS support. */ |
| 338 |
#undef TARGET_SUN_TLS |
| 339 |
#undef TARGET_GNU_TLS |
| 340 |
#define TARGET_SUN_TLS 0 |
| 341 |
#define TARGET_GNU_TLS 1 |
| 342 |
#endif |
| 343 |
|
| 344 |
#undef LOCAL_LABEL_PREFIX |
| 345 |
#define LOCAL_LABEL_PREFIX "." |
| 346 |
|
| 347 |
/* The Solaris 2 assembler uses .skip, not .zero, so put this back. */ |
| 348 |
#undef ASM_OUTPUT_SKIP |
| 349 |
#define ASM_OUTPUT_SKIP(FILE,SIZE) \ |
| 350 |
fprintf (FILE, "\t.skip %u\n", (int)(SIZE)) |
| 351 |
|
| 352 |
/* This is how to store into the string LABEL |
| 353 |
the symbol_ref name of an internal numbered label where |
| 354 |
PREFIX is the class of label and NUM is the number within the class. |
| 355 |
This is suitable for output with `assemble_name'. */ |
| 356 |
|
| 357 |
#undef ASM_GENERATE_INTERNAL_LABEL |
| 358 |
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ |
| 359 |
sprintf ((LABEL), "*.L%s%lu", (PREFIX), (unsigned long)(NUM)) |
| 360 |
|
| 361 |
/* The native TLS-enabled assembler requires the directive #tls_object |
| 362 |
to be put on objects in TLS sections (as of v7.1). This is not |
| 363 |
required by GNU as but supported on SPARC. */ |
| 364 |
#undef ASM_DECLARE_OBJECT_NAME |
| 365 |
#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ |
| 366 |
do \ |
| 367 |
{ \ |
| 368 |
HOST_WIDE_INT size; \ |
| 369 |
\ |
| 370 |
if (targetm.have_tls && DECL_THREAD_LOCAL_P (DECL)) \ |
| 371 |
ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "tls_object"); \ |
| 372 |
else \ |
| 373 |
ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \ |
| 374 |
\ |
| 375 |
size_directive_output = 0; \ |
| 376 |
if (!flag_inhibit_size_directive \ |
| 377 |
&& (DECL) && DECL_SIZE (DECL)) \ |
| 378 |
{ \ |
| 379 |
size_directive_output = 1; \ |
| 380 |
size = tree_to_uhwi (DECL_SIZE_UNIT (DECL)); \ |
| 381 |
ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \ |
| 382 |
} \ |
| 383 |
\ |
| 384 |
ASM_OUTPUT_LABEL (FILE, NAME); \ |
| 385 |
} \ |
| 386 |
while (0) |
| 387 |
|
| 388 |
/* Output a simple call for .init/.fini. */ |
| 389 |
#define ASM_OUTPUT_CALL(FILE, FN) \ |
| 390 |
do \ |
| 391 |
{ \ |
| 392 |
fprintf (FILE, "\tcall\t"); \ |
| 393 |
targetm.asm_out.print_operand (FILE, XEXP (DECL_RTL (FN), 0), 0); \ |
| 394 |
fprintf (FILE, "\n\tnop\n"); \ |
| 395 |
} \ |
| 396 |
while (0) |
| 397 |
|
| 398 |
/* Solaris as has a bug: a .common directive in .tbss or .tdata section |
| 399 |
behaves as .tls_common rather than normal non-TLS .common. */ |
| 400 |
#undef ASM_OUTPUT_ALIGNED_COMMON |
| 401 |
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ |
| 402 |
do \ |
| 403 |
{ \ |
| 404 |
if (TARGET_SUN_TLS \ |
| 405 |
&& in_section \ |
| 406 |
&& ((in_section->common.flags & SECTION_TLS) == SECTION_TLS)) \ |
| 407 |
switch_to_section (bss_section); \ |
| 408 |
fprintf ((FILE), "%s", COMMON_ASM_OP); \ |
| 409 |
assemble_name ((FILE), (NAME)); \ |
| 410 |
fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ |
| 411 |
(SIZE), (ALIGN) / BITS_PER_UNIT); \ |
| 412 |
} \ |
| 413 |
while (0) |
| 414 |
|
| 415 |
#ifndef USE_GAS |
| 416 |
/* This is how to output an assembler line that says to advance |
| 417 |
the location counter to a multiple of 2**LOG bytes using the |
| 418 |
NOP instruction as padding. The filler pattern doesn't work |
| 419 |
with GNU as. */ |
| 420 |
#define ASM_OUTPUT_ALIGN_WITH_NOP(FILE,LOG) \ |
| 421 |
if ((LOG) != 0) \ |
| 422 |
fprintf (FILE, "\t.align %d,0x1000000\n", (1 << (LOG))) |
| 423 |
|
| 424 |
/* Use Solaris ELF section syntax with Sun as. */ |
| 425 |
#undef TARGET_ASM_NAMED_SECTION |
| 426 |
#define TARGET_ASM_NAMED_SECTION sparc_solaris_elf_asm_named_section |
| 427 |
|
| 428 |
/* Sun as requires doublequoted section names on SPARC. While GNU as |
| 429 |
supports that, too, we prefer the standard variant. */ |
| 430 |
#define SECTION_NAME_FORMAT "\"%s\"" |
| 431 |
#endif /* !USE_GAS */ |
| 432 |
|
| 433 |
/* Undefine this so that attribute((init_priority)) works with GNU ld. */ |
| 434 |
#ifdef USE_GLD |
| 435 |
#undef CTORS_SECTION_ASM_OP |
| 436 |
#undef DTORS_SECTION_ASM_OP |
| 437 |
#endif |
| 438 |
|
| 439 |
|
| 440 |
|
| 441 |
/* Define for support of TFmode long double. |
| 442 |
SPARC ABI says that long double is 4 words. */ |
| 443 |
#define SPARC_LONG_DOUBLE_TYPE_SIZE 128 |
| 444 |
|
| 445 |
/* Solaris's _Qp_* library routine implementation clobbers the output |
| 446 |
memory before the inputs are fully consumed. */ |
| 447 |
|
| 448 |
#undef TARGET_BUGGY_QP_LIB |
| 449 |
#define TARGET_BUGGY_QP_LIB 1 |
| 450 |
|
| 451 |
#undef SUN_CONVERSION_LIBFUNCS |
| 452 |
#define SUN_CONVERSION_LIBFUNCS 1 |
| 453 |
|
| 454 |
#undef DITF_CONVERSION_LIBFUNCS |
| 455 |
#define DITF_CONVERSION_LIBFUNCS 1 |
| 456 |
|
| 457 |
#undef SUN_INTEGER_MULTIPLY_64 |
| 458 |
#define SUN_INTEGER_MULTIPLY_64 1 |
| 459 |
|
| 460 |
#undef SPARC_LOW_FE_EXCEPT_VALUES |
| 461 |
#define SPARC_LOW_FE_EXCEPT_VALUES 1 |
| 462 |
|
| 463 |
#undef SUN_V9_ABI_COMPATIBILITY |
| 464 |
#define SUN_V9_ABI_COMPATIBILITY 1 |