comparison gcc/config/sol2.h @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
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 (C) 2002-2017 Free Software Foundation, Inc. 3 Copyright (C) 2002-2018 Free Software Foundation, Inc.
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify 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 8 it under the terms of the GNU General Public License as published by
111 break; \ 111 break; \
112 } \ 112 } \
113 builtin_define ("_XOPEN_SOURCE=600"); \ 113 builtin_define ("_XOPEN_SOURCE=600"); \
114 builtin_define ("_LARGEFILE_SOURCE=1"); \ 114 builtin_define ("_LARGEFILE_SOURCE=1"); \
115 builtin_define ("_LARGEFILE64_SOURCE=1"); \ 115 builtin_define ("_LARGEFILE64_SOURCE=1"); \
116 builtin_define ("_FILE_OFFSET_BITS=64"); \
116 builtin_define ("__EXTENSIONS__"); \ 117 builtin_define ("__EXTENSIONS__"); \
117 } \ 118 } \
118 TARGET_SUB_OS_CPP_BUILTINS(); \ 119 TARGET_SUB_OS_CPP_BUILTINS(); \
119 } while (0) 120 } while (0)
120 121
167 168
168 /* Enable constructor priorities if the configured linker supports it. */ 169 /* Enable constructor priorities if the configured linker supports it. */
169 #undef SUPPORTS_INIT_PRIORITY 170 #undef SUPPORTS_INIT_PRIORITY
170 #define SUPPORTS_INIT_PRIORITY HAVE_INITFINI_ARRAY_SUPPORT 171 #define SUPPORTS_INIT_PRIORITY HAVE_INITFINI_ARRAY_SUPPORT
171 172
173 /* Solaris libc and libm implement multiple behaviours for various
174 interfaces that have changed over the years in different versions of the
175 C standard. The behaviour is controlled by linking corresponding
176 values-*.o objects. Each of these objects contain alternate definitions
177 of one or more variables that the libraries use to select which
178 conflicting behaviour they should exhibit. There are two sets of these
179 objects, values-X*.o and values-xpg*.o.
180
181 The values-X[ac].o objects set the variable _lib_version. The Studio C
182 compilers use values-Xc.o with either -Xc or (since Studio 12.6)
183 -pedantic to select strictly conformant ISO C behaviour, otherwise
184 values-Xa.o. Since -pedantic is a diagnostic option only in GCC, we
185 need to specifiy the -std=c* options and -std=iso9899:199409. We
186 traditionally include -ansi, which affects C and C++, and also -std=c++*
187 for consistency.
188
189 The values-xpg[46].o objects define either or both __xpg[46] variables,
190 selecting XPG4 mode (__xpg4) and conforming C99/SUSv3 behavior (__xpg6).
191
192 Since GCC 5, gcc defaults to -std=gnu11 or higher, so we link
193 values-xpg6.o to get C99 semantics. Besides, most of the runtime
194 libraries always require C99 semantics.
195
196 Since only one instance of _lib_version and __xpg[46] takes effekt (the
197 first in ld.so.1's search path), we only link the values-*.o files into
198 executable programs. */
172 #undef STARTFILE_ARCH_SPEC 199 #undef STARTFILE_ARCH_SPEC
173 #define STARTFILE_ARCH_SPEC "%{ansi:values-Xc.o%s} \ 200 #define STARTFILE_ARCH_SPEC \
174 %{!ansi:values-Xa.o%s}" 201 "%{!shared:%{!symbolic: \
202 %{ansi|std=c*|std=iso9899\\:199409:values-Xc.o%s; :values-Xa.o%s} \
203 %{std=c90|std=gnu90:values-xpg4.o%s; :values-xpg6.o%s}}}"
175 204
176 #if defined(HAVE_LD_PIE) && defined(HAVE_SOLARIS_CRTS) 205 #if defined(HAVE_LD_PIE) && defined(HAVE_SOLARIS_CRTS)
177 #define STARTFILE_CRTBEGIN_SPEC "%{static:crtbegin.o%s; \ 206 #define STARTFILE_CRTBEGIN_SPEC "%{static:crtbegin.o%s; \
178 shared|" PIE_SPEC ":crtbeginS.o%s; \ 207 shared|" PIE_SPEC ":crtbeginS.o%s; \
179 :crtbegin.o%s}" 208 :crtbegin.o%s}"
203 #endif /* !ENABLE_VTABLE_VERIFY */ 232 #endif /* !ENABLE_VTABLE_VERIFY */
204 233
205 /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us. */ 234 /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us. */
206 #undef STARTFILE_SPEC 235 #undef STARTFILE_SPEC
207 #ifdef HAVE_SOLARIS_CRTS 236 #ifdef HAVE_SOLARIS_CRTS
208 /* Since Solaris 11.x and Solaris 12, the OS delivers crt1.o, crti.o, and 237 /* Since Solaris 11.4, the OS delivers crt1.o, crti.o, and crtn.o, with a hook
209 crtn.o, with a hook for compiler-dependent stuff like profile handling. */ 238 for compiler-dependent stuff like profile handling. */
210 #define STARTFILE_SPEC "%{!shared:%{!symbolic: \ 239 #define STARTFILE_SPEC "%{!shared:%{!symbolic: \
211 crt1.o%s \ 240 crt1.o%s \
212 %{p:%e-p is not supported; \ 241 %{p:%e-p is not supported; \
213 pg:crtpg.o%s gmon.o%s; \ 242 pg:crtpg.o%s gmon.o%s; \
214 :crtp.o%s}}} \ 243 :crtp.o%s}}} \
392 421
393 /* collect2.c can only parse GNU nm -n output. Solaris nm needs -png to 422 /* collect2.c can only parse GNU nm -n output. Solaris nm needs -png to
394 produce the same format. */ 423 produce the same format. */
395 #define NM_FLAGS "-png" 424 #define NM_FLAGS "-png"
396 425
397 /* The system headers under Solaris 2 are C++-aware since 2.0. */
398 #define NO_IMPLICIT_EXTERN_C
399
400 #define STDC_0_IN_SYSTEM_HEADERS 1 426 #define STDC_0_IN_SYSTEM_HEADERS 1
401 427
402 /* Support Solaris-specific format checking for cmn_err. */ 428 /* Support Solaris-specific format checking for cmn_err. */
403 #define TARGET_N_FORMAT_TYPES 1 429 #define TARGET_N_FORMAT_TYPES 1
404 #define TARGET_FORMAT_TYPES solaris_format_types 430 #define TARGET_FORMAT_TYPES solaris_format_types
405 431
406 /* #pragma init and #pragma fini are implemented on top of init and 432 /* #pragma init and #pragma fini are implemented on top of init and
407 fini attributes. */ 433 fini attributes. */
408 #define SOLARIS_ATTRIBUTE_TABLE \ 434 #define SOLARIS_ATTRIBUTE_TABLE \
409 { "init", 0, 0, true, false, false, NULL, false }, \ 435 { "init", 0, 0, true, false, false, false, NULL, NULL }, \
410 { "fini", 0, 0, true, false, false, NULL, false } 436 { "fini", 0, 0, true, false, false, false, NULL, NULL }
411 437
412 /* Solaris-specific #pragmas are implemented on top of attributes. Hook in 438 /* Solaris-specific #pragmas are implemented on top of attributes. Hook in
413 the bits from config/sol2.c. */ 439 the bits from config/sol2.c. */
414 #define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes 440 #define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes
415 #define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE 441 #define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE