Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / config / i386 / sol2-10.h
blob8f597753376e02a013f2d7ff5d42c09453912c8e
1 /* Solaris 10 configuration.
2 Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010
3 Free Software Foundation, Inc.
4 Contributed by CodeSourcery, LLC.
6 This file is part of GCC.
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.
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.
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/>. */
22 #undef ASM_COMMENT_START
23 #define ASM_COMMENT_START "/"
25 /* binutils' GNU as understands --32 and --64, but the native Solaris
26 assembler requires -xarch=generic or -xarch=generic64 instead. */
27 #undef ASM_SPEC
28 #ifdef USE_GAS
29 #define ASM_SPEC "%{m32:--32} %{m64:--64} -s %(asm_cpu)"
30 #else
31 #define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{Ym,*} %{Yd,*} " \
32 "%{m32:-xarch=generic} %{m64:-xarch=generic64} " \
33 "-s %(asm_cpu)"
34 #endif
36 /* The native Solaris assembler can't calculate the difference between
37 symbols in different sections, which causes problems for -fPIC jump
38 tables in .rodata. */
39 #ifndef HAVE_AS_IX86_DIFF_SECT_DELTA
40 #undef JUMP_TABLES_IN_TEXT_SECTION
41 #define JUMP_TABLES_IN_TEXT_SECTION 1
43 /* The native Solaris assembler cannot handle the SYMBOL-. syntax, but
44 requires SYMBOL@rel/@rel64 instead. */
45 #define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL) \
46 do { \
47 fputs (integer_asm_op (SIZE, FALSE), FILE); \
48 assemble_name (FILE, LABEL); \
49 fputs (SIZE == 8 ? "@rel64" : "@rel", FILE); \
50 } while (0)
51 #endif
53 /* As in sol2.h, override the default from i386/x86-64.h to work around
54 Sun as TLS bug. */
55 #undef ASM_OUTPUT_ALIGNED_COMMON
56 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
57 do \
58 { \
59 if (TARGET_SUN_TLS \
60 && in_section \
61 && ((in_section->common.flags & (SECTION_TLS | SECTION_BSS)) \
62 == (SECTION_TLS | SECTION_BSS))) \
63 switch_to_section (bss_section); \
64 x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); \
65 } \
66 while (0)
68 #undef NO_PROFILE_COUNTERS
70 #undef MCOUNT_NAME
71 #define MCOUNT_NAME "_mcount"
73 #undef WCHAR_TYPE
74 #define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")
75 #undef WCHAR_TYPE_SIZE
76 #define WCHAR_TYPE_SIZE 32
78 #undef WINT_TYPE
79 #define WINT_TYPE (TARGET_64BIT ? "int" : "long int")
80 #undef WINT_TYPE_SIZE
81 #define WINT_TYPE_SIZE 32
83 #define USE_IX86_FRAME_POINTER 1
84 #define USE_X86_64_FRAME_POINTER 1
86 /* Override i386/sol2.h version: return 8-byte vectors in MMX registers if
87 possible, matching Sun Studio 12 Update 1+ compilers and other x86
88 targets. */
89 #undef TARGET_SUBTARGET_DEFAULT
90 #define TARGET_SUBTARGET_DEFAULT \
91 (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
93 #define SUBTARGET_OPTIMIZATION_OPTIONS \
94 { OPT_LEVELS_1_PLUS, OPT_momit_leaf_frame_pointer, NULL, 1 }
96 #define MULTILIB_DEFAULTS { "m32" }
98 #undef LINK_ARCH64_SPEC_BASE
99 #define LINK_ARCH64_SPEC_BASE \
100 "%{G:-G} \
101 %{YP,*} \
102 %{R*} \
103 %{compat-bsd: \
104 %{!YP,*:%{p|pg:-Y P,/usr/ucblib/64:/usr/lib/libp/64:/lib/64:/usr/lib/64} \
105 %{!p:%{!pg:-Y P,/usr/ucblib/64:/lib:/usr/lib/64}}} \
106 -R /usr/ucblib/64} \
107 %{!compat-bsd: \
108 %{!YP,*:%{p|pg:-Y P,/usr/lib/libp/64:/lib/64:/usr/lib/64} \
109 %{!p:%{!pg:-Y P,/lib/64:/usr/lib/64}}}}"
111 #undef LINK_ARCH64_SPEC
112 #define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE
114 #ifdef TARGET_GNU_LD
115 /* Since binutils 2.21, GNU ld supports new *_sol2 emulations to strictly
116 follow the Solaris 2 ABI. Prefer them if present. */
117 #ifdef HAVE_LD_SOL2_EMULATION
118 #define I386_EMULATION "elf_i386_sol2"
119 #define X86_64_EMULATION "elf_x86_64_sol2"
120 #else
121 #define I386_EMULATION "elf_i386"
122 #define X86_64_EMULATION "elf_x86_64"
123 #endif
125 #define TARGET_LD_EMULATION "%{m64:-m " X86_64_EMULATION "}" \
126 "%{!m64:-m " I386_EMULATION "} "
127 #else
128 #define TARGET_LD_EMULATION ""
129 #endif
131 #undef LINK_ARCH_SPEC
132 #define LINK_ARCH_SPEC TARGET_LD_EMULATION \
133 "%{m64:" LINK_ARCH64_SPEC "}%{!m64:" LINK_ARCH32_SPEC "}"
135 /* We do not need to search a special directory for startup files. */
136 #undef MD_STARTFILE_PREFIX
138 #undef TARGET_ASM_NAMED_SECTION
139 #define TARGET_ASM_NAMED_SECTION i386_solaris_elf_named_section