]> gcc.gnu.org Git - gcc.git/blame - gcc/config/sol2.h
avr.md (*reload_insi): Change predicate #1 to const_int_operand.
[gcc.git] / gcc / config / sol2.h
CommitLineData
8433a25e
RO
1/* Operating system specific defines to be used when targeting GCC for any
2 Solaris 2 system.
12eb1a9c 3 Copyright 2002, 2003, 2004, 2007, 2008, 2009, 2010, 2011
f1c26cad 4 Free Software Foundation, Inc.
8433a25e 5
814499a4 6This file is part of GCC.
8433a25e 7
814499a4 8GCC is free software; you can redistribute it and/or modify
8433a25e 9it under the terms of the GNU General Public License as published by
2f83c7d6 10the Free Software Foundation; either version 3, or (at your option)
8433a25e
RO
11any later version.
12
814499a4 13GCC is distributed in the hope that it will be useful,
8433a25e
RO
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
2f83c7d6
NC
19along with GCC; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
8433a25e 21
2ca48caa
RO
22/* We are compiling for Solaris 2 now. */
23#define TARGET_SOLARIS 1
24
8433a25e
RO
25/* Solaris 2 (at least as of 2.5.1) uses a 32-bit wchar_t. */
26#undef WCHAR_TYPE
27#define WCHAR_TYPE "long int"
28
29#undef WCHAR_TYPE_SIZE
30#define WCHAR_TYPE_SIZE BITS_PER_WORD
31
32/* Solaris 2 uses a wint_t different from the default. This is required
33 by the SCD 2.4.1, p. 6-83, Figure 6-66. */
34#undef WINT_TYPE
35#define WINT_TYPE "long int"
36
37#undef WINT_TYPE_SIZE
38#define WINT_TYPE_SIZE BITS_PER_WORD
39
207bf79d
JM
40#define SIG_ATOMIC_TYPE "int"
41
42/* ??? This definition of int8_t follows the system header but does
43 not conform to C99. Likewise int_fast8_t, int_least8_t. */
44#define INT8_TYPE "char"
45#define INT16_TYPE "short int"
46#define INT32_TYPE "int"
47#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int")
48#define UINT8_TYPE "unsigned char"
49#define UINT16_TYPE "short unsigned int"
50#define UINT32_TYPE "unsigned int"
51#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
52
53#define INT_LEAST8_TYPE "char"
54#define INT_LEAST16_TYPE "short int"
55#define INT_LEAST32_TYPE "int"
56#define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int")
57#define UINT_LEAST8_TYPE "unsigned char"
58#define UINT_LEAST16_TYPE "short unsigned int"
59#define UINT_LEAST32_TYPE "unsigned int"
60#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
61
62#define INT_FAST8_TYPE "char"
63#define INT_FAST16_TYPE "int"
64#define INT_FAST32_TYPE "int"
65#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int")
66#define UINT_FAST8_TYPE "unsigned char"
67#define UINT_FAST16_TYPE "unsigned int"
68#define UINT_FAST32_TYPE "unsigned int"
69#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
70
71#define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
72#define UINTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int")
73
8433a25e
RO
74#undef CPP_SUBTARGET_SPEC
75#define CPP_SUBTARGET_SPEC "\
7ecfa34f 76%{pthreads|pthread:-D_REENTRANT -D_PTHREADS}"
8433a25e
RO
77
78/* Names to predefine in the preprocessor for this target machine. */
6508bdd5 79#define TARGET_SUB_OS_CPP_BUILTINS()
8433a25e
RO
80#define TARGET_OS_CPP_BUILTINS() \
81 do { \
82 builtin_define_std ("unix"); \
83 builtin_define_std ("sun"); \
84 builtin_define ("__svr4__"); \
85 builtin_define ("__SVR4"); \
8433a25e
RO
86 builtin_assert ("system=unix"); \
87 builtin_assert ("system=svr4"); \
6508bdd5 88 /* For C++ we need to add some additional macro \
8433a25e
RO
89 definitions required by the C++ standard \
90 library. */ \
04df6730 91 if (c_dialect_cxx ()) \
8433a25e 92 { \
babc4728
RO
93 builtin_define ("__STDC_VERSION__=199901L");\
94 builtin_define ("_XOPEN_SOURCE=600"); \
8433a25e
RO
95 builtin_define ("_LARGEFILE_SOURCE=1"); \
96 builtin_define ("_LARGEFILE64_SOURCE=1"); \
97 builtin_define ("__EXTENSIONS__"); \
98 } \
6508bdd5 99 TARGET_SUB_OS_CPP_BUILTINS(); \
8433a25e
RO
100 } while (0)
101
12eb1a9c 102/* It's safe to pass -s always, even if -g is not used. */
8433a25e
RO
103#undef ASM_SPEC
104#define ASM_SPEC "\
51769cc0 105%{v:-V} %{Qy:} %{!Qn:-Qy} %{Ym,*} -s \
24a4dd31 106%{fpic|fpie|fPIC|fPIE:-K PIC} \
8433a25e
RO
107%(asm_cpu) \
108"
109
7ecfa34f
RO
110#undef LIB_SPEC
111#define LIB_SPEC \
112 "%{!symbolic:\
113 %{pthreads|pthread:" \
114 LIB_THREAD_LDFLAGS_SPEC " -lpthread " LIB_TLS_SPEC "} \
115 %{fprofile-generate*:" \
116 LIB_THREAD_LDFLAGS_SPEC " " LIB_TLS_SPEC "} \
117 %{p|pg:-ldl} -lc}"
118
72b7f7ea
JM
119#ifndef CROSS_DIRECTORY_STRUCTURE
120#undef MD_EXEC_PREFIX
121#define MD_EXEC_PREFIX "/usr/ccs/bin/"
122
123#undef MD_STARTFILE_PREFIX
124#define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
125#endif
126
7ecfa34f
RO
127#undef STARTFILE_ARCH32_SPEC
128#define STARTFILE_ARCH32_SPEC "%{ansi:values-Xc.o%s} \
129 %{!ansi:values-Xa.o%s}"
8433a25e 130
7ecfa34f
RO
131#undef STARTFILE_ARCH_SPEC
132#define STARTFILE_ARCH_SPEC STARTFILE_ARCH32_SPEC
8433a25e
RO
133
134/* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us. */
135#undef STARTFILE_SPEC
136#define STARTFILE_SPEC "%{!shared: \
137 %{!symbolic: \
138 %{p:mcrt1.o%s} \
139 %{!p: \
140 %{pg:gcrt1.o%s gmon.o%s} \
141 %{!pg:crt1.o%s}}}} \
142 crti.o%s %(startfile_arch) \
143 crtbegin.o%s"
144
7ecfa34f
RO
145#undef ENDFILE_SPEC
146#define ENDFILE_SPEC \
147 "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
148 crtend.o%s crtn.o%s"
8433a25e 149
61aaea23
MM
150#undef LINK_ARCH32_SPEC_BASE
151#define LINK_ARCH32_SPEC_BASE \
8433a25e
RO
152 "%{G:-G} \
153 %{YP,*} \
154 %{R*} \
7ecfa34f
RO
155 %{!YP,*:%{p|pg:-Y P,%R/usr/ccs/lib/libp:%R/usr/lib/libp:%R/usr/ccs/lib:%R/lib:%R/usr/lib} \
156 %{!p:%{!pg:-Y P,%R/usr/ccs/lib:%R/lib:%R/usr/lib}}}"
8433a25e 157
61aaea23
MM
158#undef LINK_ARCH32_SPEC
159#define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE
160
8433a25e
RO
161#undef LINK_ARCH_SPEC
162#define LINK_ARCH_SPEC LINK_ARCH32_SPEC
163
7ecfa34f
RO
164#ifndef USE_GLD
165/* With Sun ld, -rdynamic is a no-op. */
166#define RDYNAMIC_SPEC ""
167#else
168/* GNU ld needs --export-dynamic to implement -rdynamic. */
169#define RDYNAMIC_SPEC "--export-dynamic"
170#endif
171
8433a25e
RO
172#undef LINK_SPEC
173#define LINK_SPEC \
174 "%{h*} %{v:-V} \
fcf52686 175 %{!shared:%{!static:%{rdynamic: " RDYNAMIC_SPEC "}}} \
8433a25e
RO
176 %{static:-dn -Bstatic} \
177 %{shared:-G -dy %{!mimpure-text:-z text}} \
178 %{symbolic:-Bsymbolic -G -dy -z text} \
179 %(link_arch) \
180 %{Qy:} %{!Qn:-Qy}"
181
7ecfa34f
RO
182#ifdef USE_GLD
183/* Solaris 11 build 135+ implements dl_iterate_phdr. GNU ld needs
184 --eh-frame-hdr to create the required .eh_frame_hdr sections. */
185#if defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR)
186#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
187#endif /* HAVE_LD_EH_FRAME && TARGET_DL_ITERATE_PHDR */
188#endif
6e70657a 189
0d72f628
RO
190#ifndef USE_GLD
191/* The default MFLIB_SPEC is GNU ld specific. */
192#define MFLIB_SPEC ""
193#endif
194
3e794bfe
RO
195/* collect2.c can only parse GNU nm -n output. Solaris nm needs -png to
196 produce the same format. */
197#define NM_FLAGS "-png"
7ecfa34f
RO
198\f
199/* The system headers under Solaris 2 are C++-aware since 2.0. */
200#define NO_IMPLICIT_EXTERN_C
3e794bfe 201
8433a25e 202#define STDC_0_IN_SYSTEM_HEADERS 1
a2bec818 203
07a43492 204/* Support Solaris-specific format checking for cmn_err. */
a2bec818
DJ
205#define TARGET_N_FORMAT_TYPES 1
206#define TARGET_FORMAT_TYPES solaris_format_types
07a43492
DJ
207
208/* #pragma init and #pragma fini are implemented on top of init and
209 fini attributes. */
210#define SOLARIS_ATTRIBUTE_TABLE \
62d784f7
KT
211 { "init", 0, 0, true, false, false, NULL, false }, \
212 { "fini", 0, 0, true, false, false, NULL, false }
07a43492 213
7ecfa34f
RO
214/* Solaris-specific #pragmas are implemented on top of attributes. Hook in
215 the bits from config/sol2.c. */
216#define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes
217#define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE
218
219/* Allow macro expansion in #pragma pack. */
220#define HANDLE_PRAGMA_PACK_WITH_EXPANSION
221
2ca48caa
RO
222/* Solaris/x86 as and gas support unquoted section names. */
223#define SECTION_NAME_FORMAT "%s"
a0c21029 224
07a43492
DJ
225/* This is how to declare the size of a function. For Solaris, we output
226 any .init or .fini entries here. */
227#undef ASM_DECLARE_FUNCTION_SIZE
228#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
229 do \
230 { \
231 if (!flag_inhibit_size_directive) \
232 ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
233 solaris_output_init_fini (FILE, DECL); \
234 } \
235 while (0)
236
7ecfa34f 237/* Solaris as has a bug: a .common directive in .tbss or .tdata section
f1c26cad
RO
238 behaves as .tls_common rather than normal non-TLS .common. */
239#undef ASM_OUTPUT_ALIGNED_COMMON
240#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
241 do \
242 { \
243 if (TARGET_SUN_TLS \
244 && in_section \
adb75db0 245 && ((in_section->common.flags & SECTION_TLS) == SECTION_TLS)) \
f1c26cad
RO
246 switch_to_section (bss_section); \
247 fprintf ((FILE), "%s", COMMON_ASM_OP); \
248 assemble_name ((FILE), (NAME)); \
249 fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
250 (SIZE), (ALIGN) / BITS_PER_UNIT); \
251 } \
252 while (0)
253
f0c01ffd
RO
254#ifndef USE_GAS
255#undef TARGET_ASM_ASSEMBLE_VISIBILITY
256#define TARGET_ASM_ASSEMBLE_VISIBILITY solaris_assemble_visibility
b8f9bca0
JM
257
258#define AS_NEEDS_DASH_FOR_PIPED_INPUT
259
7ecfa34f
RO
260/* The Solaris assembler cannot grok .stabd directives. */
261#undef NO_DBX_BNSYM_ENSYM
262#define NO_DBX_BNSYM_ENSYM 1
f0c01ffd
RO
263#endif
264
7ecfa34f
RO
265#ifndef USE_GLD
266/* The Solaris linker doesn't understand constructor priorities. */
267#undef SUPPORTS_INIT_PRIORITY
268#define SUPPORTS_INIT_PRIORITY 0
269#endif
b5b3e36a 270
7ecfa34f
RO
271/* Solaris has an implementation of __enable_execute_stack. */
272#define HAVE_ENABLE_EXECUTE_STACK
273
274/* Static stack checking is supported by means of probes. */
275#define STACK_CHECK_STATIC_BUILTIN 1
9c0c4ec7
JM
276
277#define TARGET_POSIX_IO
7ecfa34f
RO
278
279extern GTY(()) tree solaris_pending_aligns;
280extern GTY(()) tree solaris_pending_inits;
281extern GTY(()) tree solaris_pending_finis;
This page took 2.095797 seconds and 5 git commands to generate.