Merged r157653 through r157895 into branch.
[official-gcc.git] / gcc / config / i386 / sol2-10.h
bloba15ada326a5e5e588c9496faa9dc9de11c6cb4e5
1 /* Solaris 10 configuration.
2 Copyright (C) 2004, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
3 Contributed by CodeSourcery, LLC.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 #undef ASM_COMMENT_START
22 #define ASM_COMMENT_START "/"
24 /* binutils' GNU as understands --32 and --64, but the native Solaris
25 assembler requires -xarch=generic or -xarch=generic64 instead. */
26 #undef ASM_SPEC
27 #ifdef USE_GAS
28 #define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} " \
29 "%{Wa,*:%*} %{m32:--32} %{m64:--64} -s %(asm_cpu)"
30 #else
31 #define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} " \
32 "%{Wa,*:%*} %{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 SUBTARGET_OVERRIDE_OPTIONS \
84 do \
85 { \
86 if (flag_omit_frame_pointer == 2) \
87 flag_omit_frame_pointer = 0; \
88 } \
89 while (0)
91 #undef TARGET_SUBTARGET_DEFAULT
92 #define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP \
93 | MASK_FLOAT_RETURNS)
95 #define SUBTARGET_OPTIMIZATION_OPTIONS \
96 do \
97 { \
98 if (optimize >= 1) \
99 target_flags |= MASK_OMIT_LEAF_FRAME_POINTER; \
101 while (0)
103 #define MULTILIB_DEFAULTS { "m32" }
105 #undef LINK_ARCH64_SPEC_BASE
106 #define LINK_ARCH64_SPEC_BASE \
107 "%{G:-G} \
108 %{YP,*} \
109 %{R*} \
110 %{compat-bsd: \
111 %{!YP,*:%{p|pg:-Y P,/usr/ucblib/64:/usr/lib/libp/64:/lib/64:/usr/lib/64} \
112 %{!p:%{!pg:-Y P,/usr/ucblib/64:/lib:/usr/lib/64}}} \
113 -R /usr/ucblib/64} \
114 %{!compat-bsd: \
115 %{!YP,*:%{p|pg:-Y P,/usr/lib/libp/64:/lib/64:/usr/lib/64} \
116 %{!p:%{!pg:-Y P,/lib/64:/usr/lib/64}}}}"
118 #undef LINK_ARCH64_SPEC
119 #define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE
121 #ifdef TARGET_GNU_LD
122 #define TARGET_LD_EMULATION "%{m64:-m elf_x86_64}%{!m64:-m elf_i386} "
123 #else
124 #define TARGET_LD_EMULATION ""
125 #endif
127 #undef LINK_ARCH_SPEC
128 #define LINK_ARCH_SPEC TARGET_LD_EMULATION \
129 "%{m64:" LINK_ARCH64_SPEC "}%{!m64:" LINK_ARCH32_SPEC "}"
131 /* We do not need to search a special directory for startup files. */
132 #undef MD_STARTFILE_PREFIX
134 #undef TARGET_ASM_NAMED_SECTION
135 #define TARGET_ASM_NAMED_SECTION i386_solaris_elf_named_section
137 #undef SUBTARGET_RETURN_IN_MEMORY
138 #define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \
139 ix86_sol10_return_in_memory (TYPE, FNTYPE)