comparison gcc/config/sol2.h @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents b7f97abdc517
children 04ced10e8804
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
1 /* Operating system specific defines to be used when targeting GCC for any 1 /* Operating system specific defines to be used when targeting GCC for any
2 Solaris 2 system. 2 Solaris 2 system.
3 Copyright 2002, 2003, 2004, 2007, 2008, 2009, 2010 3 Copyright 2002, 2003, 2004, 2007, 2008, 2009, 2010, 2011
4 Free Software Foundation, Inc. 4 Free Software Foundation, Inc.
5 5
6 This file is part of GCC. 6 This file is part of GCC.
7 7
8 GCC is free software; you can redistribute it and/or modify 8 GCC is free software; you can redistribute it and/or modify
97 /* For C++ we need to add some additional macro \ 97 /* For C++ we need to add some additional macro \
98 definitions required by the C++ standard \ 98 definitions required by the C++ standard \
99 library. */ \ 99 library. */ \
100 if (c_dialect_cxx ()) \ 100 if (c_dialect_cxx ()) \
101 { \ 101 { \
102 builtin_define ("_XOPEN_SOURCE=500"); \ 102 builtin_define ("__STDC_VERSION__=199901L");\
103 builtin_define ("_XOPEN_SOURCE=600"); \
103 builtin_define ("_LARGEFILE_SOURCE=1"); \ 104 builtin_define ("_LARGEFILE_SOURCE=1"); \
104 builtin_define ("_LARGEFILE64_SOURCE=1"); \ 105 builtin_define ("_LARGEFILE64_SOURCE=1"); \
105 builtin_define ("__EXTENSIONS__"); \ 106 builtin_define ("__EXTENSIONS__"); \
106 } \ 107 } \
107 TARGET_SUB_OS_CPP_BUILTINS(); \ 108 TARGET_SUB_OS_CPP_BUILTINS(); \
108 } while (0) 109 } while (0)
109 110
110 /* The system headers under Solaris 2 are C++-aware since 2.0. */ 111 /* The system headers under Solaris 2 are C++-aware since 2.0. */
111 #define NO_IMPLICIT_EXTERN_C 112 #define NO_IMPLICIT_EXTERN_C
112 113
113 /* The sun bundled assembler doesn't accept -Yd, (and neither does gas). 114 /* It's safe to pass -s always, even if -g is not used. */
114 It's safe to pass -s always, even if -g is not used. */
115 #undef ASM_SPEC 115 #undef ASM_SPEC
116 #define ASM_SPEC "\ 116 #define ASM_SPEC "\
117 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s \ 117 %{v:-V} %{Qy:} %{!Qn:-Qy} %{Ym,*} -s \
118 %{fpic|fpie|fPIC|fPIE:-K PIC} \ 118 %{fpic|fpie|fPIC|fPIE:-K PIC} \
119 %(asm_cpu) \ 119 %(asm_cpu) \
120 " 120 "
121
122 #ifndef CROSS_DIRECTORY_STRUCTURE
123 #undef MD_EXEC_PREFIX
124 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
125
126 #undef MD_STARTFILE_PREFIX
127 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
128 #endif
121 129
122 /* We don't use the standard LIB_SPEC only because we don't yet support c++. */ 130 /* We don't use the standard LIB_SPEC only because we don't yet support c++. */
123 #undef LIB_SPEC 131 #undef LIB_SPEC
124 #define LIB_SPEC \ 132 #define LIB_SPEC \
125 "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \ 133 "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \
126 %{!shared:\ 134 %{!symbolic:\
127 %{!symbolic:\ 135 %{pthreads|pthread:" \
128 %{pthreads|pthread:-lpthread} \ 136 LIB_THREAD_LDFLAGS_SPEC " -lpthread " LIB_TLS_SPEC "} \
129 %{!pthreads:%{!pthread:%{threads:-lthread}}} \ 137 %{!pthreads:%{!pthread:%{threads:" \
130 %{p|pg:-ldl} -lc}}" 138 LIB_THREAD_LDFLAGS_SPEC " -lthread}}} \
139 %{p|pg:-ldl} -lc}"
131 140
132 #undef ENDFILE_SPEC 141 #undef ENDFILE_SPEC
133 #define ENDFILE_SPEC "crtend.o%s crtn.o%s" 142 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
134 143
135 /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us. */ 144 /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us. */
167 #define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE 176 #define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE
168 177
169 #undef LINK_ARCH_SPEC 178 #undef LINK_ARCH_SPEC
170 #define LINK_ARCH_SPEC LINK_ARCH32_SPEC 179 #define LINK_ARCH_SPEC LINK_ARCH32_SPEC
171 180
172 /* This should be the same as in svr4.h, except with -R added. */
173 #undef LINK_SPEC 181 #undef LINK_SPEC
174 #define LINK_SPEC \ 182 #define LINK_SPEC \
175 "%{h*} %{v:-V} \ 183 "%{h*} %{v:-V} \
176 %{b} \
177 %{!shared:%{!static:%{rdynamic: " RDYNAMIC_SPEC "}}} \ 184 %{!shared:%{!static:%{rdynamic: " RDYNAMIC_SPEC "}}} \
178 %{static:-dn -Bstatic} \ 185 %{static:-dn -Bstatic} \
179 %{shared:-G -dy %{!mimpure-text:-z text}} \ 186 %{shared:-G -dy %{!mimpure-text:-z text}} \
180 %{symbolic:-Bsymbolic -G -dy -z text} \ 187 %{symbolic:-Bsymbolic -G -dy -z text} \
181 %(link_arch) \ 188 %(link_arch) \
188 GNU linker does support constructor priorities, so GNU ld 195 GNU linker does support constructor priorities, so GNU ld
189 configuration files for Solaris override this setting.) */ 196 configuration files for Solaris override this setting.) */
190 #undef SUPPORTS_INIT_PRIORITY 197 #undef SUPPORTS_INIT_PRIORITY
191 #define SUPPORTS_INIT_PRIORITY 0 198 #define SUPPORTS_INIT_PRIORITY 0
192 199
193 /* This defines which switch letters take arguments. 200 /* collect2.c can only parse GNU nm -n output. Solaris nm needs -png to
194 It is as in svr4.h but with -R added. */ 201 produce the same format. */
195 #undef SWITCH_TAKES_ARG 202 #define NM_FLAGS "-png"
196 #define SWITCH_TAKES_ARG(CHAR) \
197 (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
198 || (CHAR) == 'R' \
199 || (CHAR) == 'h' \
200 || (CHAR) == 'z')
201 203
202 #define STDC_0_IN_SYSTEM_HEADERS 1 204 #define STDC_0_IN_SYSTEM_HEADERS 1
203 205
204 /* 206 /*
205 * Attempt to turn on access permissions for the stack. 207 * Attempt to turn on access permissions for the stack.
272 ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \ 274 ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
273 solaris_output_init_fini (FILE, DECL); \ 275 solaris_output_init_fini (FILE, DECL); \
274 } \ 276 } \
275 while (0) 277 while (0)
276 278
277 /* Solaris 'as' has a bug: a .common directive in .tbss section 279 /* Solaris 'as' has a bug: a .common directive in .tbss or .tdata section
278 behaves as .tls_common rather than normal non-TLS .common. */ 280 behaves as .tls_common rather than normal non-TLS .common. */
279 #undef ASM_OUTPUT_ALIGNED_COMMON 281 #undef ASM_OUTPUT_ALIGNED_COMMON
280 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ 282 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
281 do \ 283 do \
282 { \ 284 { \
283 if (TARGET_SUN_TLS \ 285 if (TARGET_SUN_TLS \
284 && in_section \ 286 && in_section \
285 && ((in_section->common.flags & (SECTION_TLS | SECTION_BSS)) \ 287 && ((in_section->common.flags & SECTION_TLS) == SECTION_TLS)) \
286 == (SECTION_TLS | SECTION_BSS))) \
287 switch_to_section (bss_section); \ 288 switch_to_section (bss_section); \
288 fprintf ((FILE), "%s", COMMON_ASM_OP); \ 289 fprintf ((FILE), "%s", COMMON_ASM_OP); \
289 assemble_name ((FILE), (NAME)); \ 290 assemble_name ((FILE), (NAME)); \
290 fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ 291 fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
291 (SIZE), (ALIGN) / BITS_PER_UNIT); \ 292 (SIZE), (ALIGN) / BITS_PER_UNIT); \
293 while (0) 294 while (0)
294 295
295 #ifndef USE_GAS 296 #ifndef USE_GAS
296 #undef TARGET_ASM_ASSEMBLE_VISIBILITY 297 #undef TARGET_ASM_ASSEMBLE_VISIBILITY
297 #define TARGET_ASM_ASSEMBLE_VISIBILITY solaris_assemble_visibility 298 #define TARGET_ASM_ASSEMBLE_VISIBILITY solaris_assemble_visibility
299
300 #define AS_NEEDS_DASH_FOR_PIPED_INPUT
301
298 #endif 302 #endif
299 303
300 extern GTY(()) tree solaris_pending_aligns; 304 extern GTY(()) tree solaris_pending_aligns;
301 extern GTY(()) tree solaris_pending_inits; 305 extern GTY(()) tree solaris_pending_inits;
302 extern GTY(()) tree solaris_pending_finis; 306 extern GTY(()) tree solaris_pending_finis;
303 307
304 /* Allow macro expansion in #pragma pack. */ 308 /* Allow macro expansion in #pragma pack. */
305 #define HANDLE_PRAGMA_PACK_WITH_EXPANSION 309 #define HANDLE_PRAGMA_PACK_WITH_EXPANSION
310
311 #define TARGET_POSIX_IO