]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/i386/sol2.h
re PR bootstrap/39150 (Configure scripts have no 64-Bit Solaris defined (only i386...
[thirdparty/gcc.git] / gcc / config / i386 / sol2.h
1 /* Target definitions for GCC for Intel 80386 running Solaris 2
2 Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
3 2004, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
4 Contributed by Fred Fish (fnf@cygnus.com).
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 /* Augment i386/unix.h version to return 8-byte vectors in memory, matching
23 Sun Studio compilers until version 12, the only ones supported on
24 Solaris 8 and 9. */
25 #undef TARGET_SUBTARGET_DEFAULT
26 #define TARGET_SUBTARGET_DEFAULT \
27 (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_VECT8_RETURNS)
28
29 /* Old versions of the Solaris assembler can not handle the difference of
30 labels in different sections, so force DW_EH_PE_datarel. */
31 #undef ASM_PREFERRED_EH_DATA_FORMAT
32 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
33 (flag_pic ? ((GLOBAL ? DW_EH_PE_indirect : 0) \
34 | (TARGET_64BIT ? DW_EH_PE_pcrel | DW_EH_PE_sdata4 \
35 : DW_EH_PE_datarel)) \
36 : DW_EH_PE_absptr)
37
38 /* The Solaris linker will not merge a read-only .eh_frame section
39 with a read-write .eh_frame section. None of the encodings used
40 with non-PIC code require runtime relocations. In 64-bit mode,
41 since there is no backwards compatibility issue, we use a read-only
42 section for .eh_frame. In 32-bit mode, we use a writable .eh_frame
43 section in order to be compatible with G++ for Solaris x86. */
44 #undef EH_TABLES_CAN_BE_READ_ONLY
45 #define EH_TABLES_CAN_BE_READ_ONLY (TARGET_64BIT)
46
47 /* Follow Sun requirements for TLS code sequences and use Sun assembler TLS
48 syntax. */
49 #undef TARGET_SUN_TLS
50 #define TARGET_SUN_TLS 1
51
52 #undef SIZE_TYPE
53 #define SIZE_TYPE "unsigned int"
54
55 #undef PTRDIFF_TYPE
56 #define PTRDIFF_TYPE "int"
57
58 /* Solaris 2/Intel as chokes on #line directives before Solaris 10. */
59 #undef CPP_SPEC
60 #define CPP_SPEC "%{,assembler-with-cpp:-P} %(cpp_subtarget)"
61
62 #define ASM_CPU_DEFAULT_SPEC ""
63
64 #define ASM_CPU_SPEC ""
65
66 /* Don't include ASM_PIC_SPEC. While the Solaris 8 and 9 assembler accepts
67 -K PIC, it gives many warnings:
68 R_386_32 relocation is used for symbol "<symbol>"
69 GNU as doesn't recognize -K at all. */
70 #undef ASM_SPEC
71 #define ASM_SPEC ASM_SPEC_BASE
72
73 #define SUBTARGET_CPU_EXTRA_SPECS \
74 { "cpp_subtarget", CPP_SUBTARGET_SPEC }, \
75 { "asm_cpu", ASM_CPU_SPEC }, \
76 { "asm_cpu_default", ASM_CPU_DEFAULT_SPEC }, \
77
78 #undef SUBTARGET_EXTRA_SPECS
79 #define SUBTARGET_EXTRA_SPECS \
80 { "startfile_arch", STARTFILE_ARCH_SPEC }, \
81 { "link_arch", LINK_ARCH_SPEC }, \
82 SUBTARGET_CPU_EXTRA_SPECS
83
84 /* Register the Solaris-specific #pragma directives. */
85 #define REGISTER_SUBTARGET_PRAGMAS() solaris_register_pragmas ()
86
87 #undef LOCAL_LABEL_PREFIX
88 #define LOCAL_LABEL_PREFIX "."
89
90 /* The 32-bit Solaris assembler does not support .quad. Do not use it. */
91 #ifndef HAVE_AS_IX86_QUAD
92 #undef ASM_QUAD
93 #endif
94
95 /* The Solaris assembler wants a .local for non-exported aliases. */
96 #define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET) \
97 do { \
98 const char *declname = \
99 IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
100 ASM_OUTPUT_DEF ((FILE), declname, \
101 IDENTIFIER_POINTER (TARGET)); \
102 if (! TREE_PUBLIC (DECL)) \
103 { \
104 fprintf ((FILE), "%s", LOCAL_ASM_OP); \
105 assemble_name ((FILE), declname); \
106 fprintf ((FILE), "\n"); \
107 } \
108 } while (0)
109
110 #ifndef USE_GAS
111 /* The Sun assembler uses .tcomm for TLS common sections. */
112 #define TLS_COMMON_ASM_OP ".tcomm"
113
114 /* Similar to the Sun assembler on SPARC, the native assembler requires
115 TLS objects to be declared as @tls_obj (not @tls_object). Unlike SPARC,
116 gas doesn't understand this variant. */
117 #undef ASM_DECLARE_OBJECT_NAME
118 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
119 do \
120 { \
121 HOST_WIDE_INT size; \
122 \
123 if (targetm.have_tls && DECL_THREAD_LOCAL_P (DECL)) \
124 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "tls_obj"); \
125 else \
126 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
127 \
128 size_directive_output = 0; \
129 if (!flag_inhibit_size_directive \
130 && (DECL) && DECL_SIZE (DECL)) \
131 { \
132 size_directive_output = 1; \
133 size = int_size_in_bytes (TREE_TYPE (DECL)); \
134 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
135 } \
136 \
137 ASM_OUTPUT_LABEL (FILE, NAME); \
138 } \
139 while (0)
140 #endif /* !USE_GAS */
141
142 /* Output a simple call for .init/.fini. */
143 #define ASM_OUTPUT_CALL(FILE, FN) \
144 do \
145 { \
146 fprintf (FILE, "\tcall\t"); \
147 ix86_print_operand (FILE, XEXP (DECL_RTL (FN), 0), 'P'); \
148 fprintf (FILE, "\n"); \
149 } \
150 while (0)
151
152 #undef TARGET_ASM_NAMED_SECTION
153 #define TARGET_ASM_NAMED_SECTION i386_solaris_elf_named_section
154
155 /* We do not need NT_VERSION notes. */
156 #undef X86_FILE_START_VERSION_DIRECTIVE
157 #define X86_FILE_START_VERSION_DIRECTIVE false
158
159 /* Only recent versions of Solaris 11 ld properly support hidden .gnu.linkonce
160 sections, so don't use them. */
161 #ifndef USE_GLD
162 #define USE_HIDDEN_LINKONCE 0
163 #endif
164
165 /* Put all *tf routines in libgcc. */
166 #undef LIBGCC2_HAS_TF_MODE
167 #define LIBGCC2_HAS_TF_MODE 1
168 #define LIBGCC2_TF_CEXT q
169 #define TF_SIZE 113