annotate gcc/config/sol2.h @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 /* Operating system specific defines to be used when targeting GCC for any
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 Solaris 2 system.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3 Copyright (C) 2002-2020 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 GCC is free software; you can redistribute it and/or modify
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 it under the terms of the GNU General Public License as published by
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 the Free Software Foundation; either version 3, or (at your option)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 any later version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 GCC is distributed in the hope that it will be useful,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 GNU General Public License for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 <http://www.gnu.org/licenses/>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20
111
kono
parents: 67
diff changeset
21 /* We are compiling for Solaris 2 now. */
kono
parents: 67
diff changeset
22 #define TARGET_SOLARIS 1
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23
111
kono
parents: 67
diff changeset
24 /* wchar_t is called differently in <wchar.h> for 32 and 64-bit
kono
parents: 67
diff changeset
25 compilations. This is called for by SCD 2.4.1, p. 6-83, Figure 6-65
kono
parents: 67
diff changeset
26 (32-bit) and p. 6P-10, Figure 6.38 (64-bit). */
kono
parents: 67
diff changeset
27
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 #undef WCHAR_TYPE
111
kono
parents: 67
diff changeset
29 #define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 #undef WCHAR_TYPE_SIZE
111
kono
parents: 67
diff changeset
32 #define WCHAR_TYPE_SIZE 32
kono
parents: 67
diff changeset
33
kono
parents: 67
diff changeset
34 /* Same for wint_t. See SCD 2.4.1, p. 6-83, Figure 6-66 (32-bit). There's
kono
parents: 67
diff changeset
35 no corresponding 64-bit definition, but this is what Solaris 8
kono
parents: 67
diff changeset
36 <iso/wchar_iso.h> uses. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37
111
kono
parents: 67
diff changeset
38 #undef WINT_TYPE
kono
parents: 67
diff changeset
39 #define WINT_TYPE (TARGET_64BIT ? "int" : "long int")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40
111
kono
parents: 67
diff changeset
41 #undef WINT_TYPE_SIZE
kono
parents: 67
diff changeset
42 #define WINT_TYPE_SIZE 32
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
44 #define SIG_ATOMIC_TYPE "int"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
45
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
46 /* ??? This definition of int8_t follows the system header but does
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
47 not conform to C99. Likewise int_fast8_t, int_least8_t. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
48 #define INT8_TYPE "char"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
49 #define INT16_TYPE "short int"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
50 #define INT32_TYPE "int"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
51 #define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
52 #define UINT8_TYPE "unsigned char"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
53 #define UINT16_TYPE "short unsigned int"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
54 #define UINT32_TYPE "unsigned int"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
55 #define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
56
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
57 #define INT_LEAST8_TYPE "char"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
58 #define INT_LEAST16_TYPE "short int"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
59 #define INT_LEAST32_TYPE "int"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
60 #define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
61 #define UINT_LEAST8_TYPE "unsigned char"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
62 #define UINT_LEAST16_TYPE "short unsigned int"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
63 #define UINT_LEAST32_TYPE "unsigned int"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
64 #define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
65
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
66 #define INT_FAST8_TYPE "char"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
67 #define INT_FAST16_TYPE "int"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
68 #define INT_FAST32_TYPE "int"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
69 #define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
70 #define UINT_FAST8_TYPE "unsigned char"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
71 #define UINT_FAST16_TYPE "unsigned int"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
72 #define UINT_FAST32_TYPE "unsigned int"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
73 #define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
74
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
75 #define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
76 #define UINTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 #undef CPP_SUBTARGET_SPEC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 #define CPP_SUBTARGET_SPEC "\
111
kono
parents: 67
diff changeset
80 %{pthreads|pthread:-D_REENTRANT -D_PTHREADS}"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 /* Names to predefine in the preprocessor for this target machine. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 #define TARGET_SUB_OS_CPP_BUILTINS()
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 #define TARGET_OS_CPP_BUILTINS() \
111
kono
parents: 67
diff changeset
85 do { \
kono
parents: 67
diff changeset
86 builtin_define_std ("unix"); \
kono
parents: 67
diff changeset
87 builtin_define_std ("sun"); \
kono
parents: 67
diff changeset
88 builtin_define ("__svr4__"); \
kono
parents: 67
diff changeset
89 builtin_define ("__SVR4"); \
kono
parents: 67
diff changeset
90 builtin_assert ("system=unix"); \
kono
parents: 67
diff changeset
91 builtin_assert ("system=svr4"); \
kono
parents: 67
diff changeset
92 /* For C++ we need to add some additional macro \
kono
parents: 67
diff changeset
93 definitions required by the C++ standard \
kono
parents: 67
diff changeset
94 library. */ \
kono
parents: 67
diff changeset
95 if (c_dialect_cxx ()) \
kono
parents: 67
diff changeset
96 { \
kono
parents: 67
diff changeset
97 switch (cxx_dialect) \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 { \
111
kono
parents: 67
diff changeset
99 case cxx98: \
kono
parents: 67
diff changeset
100 case cxx11: \
kono
parents: 67
diff changeset
101 case cxx14: \
kono
parents: 67
diff changeset
102 /* C++11 and C++14 are based on C99. \
kono
parents: 67
diff changeset
103 libstdc++ makes use of C99 features \
kono
parents: 67
diff changeset
104 even for C++98. */ \
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
105 builtin_define ("__STDC_VERSION__=199901L");\
111
kono
parents: 67
diff changeset
106 break; \
kono
parents: 67
diff changeset
107 \
kono
parents: 67
diff changeset
108 default: \
kono
parents: 67
diff changeset
109 /* C++17 is based on C11. */ \
kono
parents: 67
diff changeset
110 builtin_define ("__STDC_VERSION__=201112L");\
kono
parents: 67
diff changeset
111 break; \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 } \
111
kono
parents: 67
diff changeset
113 builtin_define ("_XOPEN_SOURCE=600"); \
kono
parents: 67
diff changeset
114 builtin_define ("_LARGEFILE_SOURCE=1"); \
kono
parents: 67
diff changeset
115 builtin_define ("_LARGEFILE64_SOURCE=1"); \
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
116 builtin_define ("_FILE_OFFSET_BITS=64"); \
111
kono
parents: 67
diff changeset
117 builtin_define ("__EXTENSIONS__"); \
kono
parents: 67
diff changeset
118 } \
kono
parents: 67
diff changeset
119 TARGET_SUB_OS_CPP_BUILTINS(); \
kono
parents: 67
diff changeset
120 } while (0)
kono
parents: 67
diff changeset
121
kono
parents: 67
diff changeset
122 #define SUBTARGET_OVERRIDE_OPTIONS \
kono
parents: 67
diff changeset
123 do { \
kono
parents: 67
diff changeset
124 solaris_override_options (); \
kono
parents: 67
diff changeset
125 } while (0)
kono
parents: 67
diff changeset
126
kono
parents: 67
diff changeset
127 #if DEFAULT_ARCH32_P
kono
parents: 67
diff changeset
128 #define MULTILIB_DEFAULTS { "m32" }
kono
parents: 67
diff changeset
129 #else
kono
parents: 67
diff changeset
130 #define MULTILIB_DEFAULTS { "m64" }
kono
parents: 67
diff changeset
131 #endif
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
132
111
kono
parents: 67
diff changeset
133 #if DEFAULT_ARCH32_P
kono
parents: 67
diff changeset
134 #define DEF_ARCH32_SPEC(__str) "%{!m64:" __str "}"
kono
parents: 67
diff changeset
135 #define DEF_ARCH64_SPEC(__str) "%{m64:" __str "}"
kono
parents: 67
diff changeset
136 #else
kono
parents: 67
diff changeset
137 #define DEF_ARCH32_SPEC(__str) "%{m32:" __str "}"
kono
parents: 67
diff changeset
138 #define DEF_ARCH64_SPEC(__str) "%{!m32:" __str "}"
kono
parents: 67
diff changeset
139 #endif
kono
parents: 67
diff changeset
140
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
141 /* Solaris needs -fasynchronous-unwind-tables to generate unwind info. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
142 #define ASAN_CC1_SPEC "%{%:sanitize(address):-fasynchronous-unwind-tables}"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
143
111
kono
parents: 67
diff changeset
144 /* It's safe to pass -s always, even if -g is not used. Those options are
kono
parents: 67
diff changeset
145 handled by both Sun as and GNU as. */
kono
parents: 67
diff changeset
146 #define ASM_SPEC_BASE \
kono
parents: 67
diff changeset
147 "%{v:-V} %{Qy:} %{!Qn:-Qy} %{Ym,*} -s %(asm_cpu)"
kono
parents: 67
diff changeset
148
kono
parents: 67
diff changeset
149 #define ASM_PIC_SPEC " %{" FPIE_OR_FPIC_SPEC ":-K PIC}"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
150
111
kono
parents: 67
diff changeset
151 #undef ASM_CPU_DEFAULT_SPEC
kono
parents: 67
diff changeset
152 #define ASM_CPU_DEFAULT_SPEC \
kono
parents: 67
diff changeset
153 (DEFAULT_ARCH32_P ? "\
kono
parents: 67
diff changeset
154 %{m64:" ASM_CPU64_DEFAULT_SPEC "} \
kono
parents: 67
diff changeset
155 %{!m64:" ASM_CPU32_DEFAULT_SPEC "} \
kono
parents: 67
diff changeset
156 " : "\
kono
parents: 67
diff changeset
157 %{m32:" ASM_CPU32_DEFAULT_SPEC "} \
kono
parents: 67
diff changeset
158 %{!m32:" ASM_CPU64_DEFAULT_SPEC "} \
kono
parents: 67
diff changeset
159 ")
kono
parents: 67
diff changeset
160
kono
parents: 67
diff changeset
161 #undef LIB_SPEC
kono
parents: 67
diff changeset
162 #define LIB_SPEC \
kono
parents: 67
diff changeset
163 "%{!symbolic:\
kono
parents: 67
diff changeset
164 %{pthreads|pthread:-lpthread} \
kono
parents: 67
diff changeset
165 %{p|pg:-ldl} -lc}"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
166
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
167 #ifndef CROSS_DIRECTORY_STRUCTURE
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
168 #undef MD_EXEC_PREFIX
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
169 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
111
kono
parents: 67
diff changeset
170 #endif
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
171
111
kono
parents: 67
diff changeset
172 /* Enable constructor priorities if the configured linker supports it. */
kono
parents: 67
diff changeset
173 #undef SUPPORTS_INIT_PRIORITY
kono
parents: 67
diff changeset
174 #define SUPPORTS_INIT_PRIORITY HAVE_INITFINI_ARRAY_SUPPORT
kono
parents: 67
diff changeset
175
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
176 /* Solaris libc and libm implement multiple behaviours for various
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
177 interfaces that have changed over the years in different versions of the
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
178 C standard. The behaviour is controlled by linking corresponding
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
179 values-*.o objects. Each of these objects contain alternate definitions
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
180 of one or more variables that the libraries use to select which
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
181 conflicting behaviour they should exhibit. There are two sets of these
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
182 objects, values-X*.o and values-xpg*.o.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
183
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
184 The values-X[ac].o objects set the variable _lib_version. The Studio C
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
185 compilers use values-Xc.o with either -Xc or (since Studio 12.6)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
186 -pedantic to select strictly conformant ISO C behaviour, otherwise
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
187 values-Xa.o. Since -pedantic is a diagnostic option only in GCC, we
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
188 need to specifiy the -std=c* options and -std=iso9899:199409. We
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
189 traditionally include -ansi, which affects C and C++, and also -std=c++*
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
190 for consistency.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
191
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
192 The values-xpg[46].o objects define either or both __xpg[46] variables,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
193 selecting XPG4 mode (__xpg4) and conforming C99/SUSv3 behavior (__xpg6).
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
194
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
195 Since GCC 5, gcc defaults to -std=gnu11 or higher, so we link
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
196 values-xpg6.o to get C99 semantics. Besides, most of the runtime
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
197 libraries always require C99 semantics.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
198
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
199 Since only one instance of _lib_version and __xpg[46] takes effekt (the
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
200 first in ld.so.1's search path), we only link the values-*.o files into
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
201 executable programs. */
111
kono
parents: 67
diff changeset
202 #undef STARTFILE_ARCH_SPEC
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
203 #define STARTFILE_ARCH_SPEC \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
204 "%{!shared:%{!symbolic: \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
205 %{ansi|std=c*|std=iso9899\\:199409:values-Xc.o%s; :values-Xa.o%s} \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
206 %{std=c90|std=gnu90:values-xpg4.o%s; :values-xpg6.o%s}}}"
111
kono
parents: 67
diff changeset
207
kono
parents: 67
diff changeset
208 #if defined(HAVE_LD_PIE) && defined(HAVE_SOLARIS_CRTS)
kono
parents: 67
diff changeset
209 #define STARTFILE_CRTBEGIN_SPEC "%{static:crtbegin.o%s; \
kono
parents: 67
diff changeset
210 shared|" PIE_SPEC ":crtbeginS.o%s; \
kono
parents: 67
diff changeset
211 :crtbegin.o%s}"
kono
parents: 67
diff changeset
212 #else
kono
parents: 67
diff changeset
213 #define STARTFILE_CRTBEGIN_SPEC "crtbegin.o%s"
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
214 #endif
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
215
111
kono
parents: 67
diff changeset
216 #if ENABLE_VTABLE_VERIFY
kono
parents: 67
diff changeset
217 #if SUPPORTS_INIT_PRIORITY
kono
parents: 67
diff changeset
218 #define STARTFILE_VTV_SPEC \
kono
parents: 67
diff changeset
219 "%{fvtable-verify=none:%s; \
kono
parents: 67
diff changeset
220 fvtable-verify=preinit:vtv_start_preinit.o%s; \
kono
parents: 67
diff changeset
221 fvtable-verify=std:vtv_start.o%s}"
kono
parents: 67
diff changeset
222 #define ENDFILE_VTV_SPEC \
kono
parents: 67
diff changeset
223 "%{fvtable-verify=none:%s; \
kono
parents: 67
diff changeset
224 fvtable-verify=preinit:vtv_end_preinit.o%s; \
kono
parents: 67
diff changeset
225 fvtable-verify=std:vtv_end.o%s}"
kono
parents: 67
diff changeset
226 #else /* !SUPPORTS_INIT_PRIORITY */
kono
parents: 67
diff changeset
227 #define STARTFILE_VTV_SPEC \
kono
parents: 67
diff changeset
228 "%{fvtable-verify=*: \
kono
parents: 67
diff changeset
229 %e-fvtable-verify=%* is not supported in this configuration}"
kono
parents: 67
diff changeset
230 #define ENDFILE_VTV_SPEC ""
kono
parents: 67
diff changeset
231 #endif /* !SUPPORTS_INIT_PRIORITY */
kono
parents: 67
diff changeset
232 #else /* !ENABLE_VTABLE_VERIFY */
kono
parents: 67
diff changeset
233 #define STARTFILE_VTV_SPEC ""
kono
parents: 67
diff changeset
234 #define ENDFILE_VTV_SPEC ""
kono
parents: 67
diff changeset
235 #endif /* !ENABLE_VTABLE_VERIFY */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
236
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
237 /* Link -lasan early on the command line. For -static-libasan, don't link
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
238 it for -shared link, the executable should be compiled with -static-libasan
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
239 in that case, and for executable link with --{,no-}whole-archive around
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
240 it to force everything into the executable. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
241
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
242 #ifndef USE_GNU_LD
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
243 #define LD_WHOLE_ARCHIVE_OPTION "-z allextract"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
244 #define LD_NO_WHOLE_ARCHIVE_OPTION "-z defaultextract"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
245 #else
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
246 #define LD_WHOLE_ARCHIVE_OPTION "--whole-archive"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
247 #define LD_NO_WHOLE_ARCHIVE_OPTION "--no-whole-archive"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
248 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
249
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
250 /* Allow rejecting -fsanitize=address, e.g. for specific multilibs. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
251 #ifndef ASAN_REJECT_SPEC
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
252 #define ASAN_REJECT_SPEC ""
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
253 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
254
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
255 #define LIBASAN_EARLY_SPEC ASAN_REJECT_SPEC \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
256 " %{!shared:libasan_preinit%O%s} \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
257 %{static-libasan:%{!shared: -Bstatic "\
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
258 LD_WHOLE_ARCHIVE_OPTION " -lasan " LD_NO_WHOLE_ARCHIVE_OPTION \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
259 "-Bdynamic}}%{!static-libasan:-lasan}"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
260
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
261 /* Error out on -fsanitize=thread|leak. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
262 #define LIBTSAN_EARLY_SPEC "\
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
263 %e-fsanitize=thread is not supported in this configuration"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
264 #define LIBLSAN_EARLY_SPEC "\
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
265 %e-fsanitize=leak is not supported in this configuration"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
266
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 #undef STARTFILE_SPEC
111
kono
parents: 67
diff changeset
269 #ifdef HAVE_SOLARIS_CRTS
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
270 /* Since Solaris 11.4, the OS delivers crt1.o, crti.o, and crtn.o, with a hook
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
271 for compiler-dependent stuff like profile handling. */
111
kono
parents: 67
diff changeset
272 #define STARTFILE_SPEC "%{!shared:%{!symbolic: \
kono
parents: 67
diff changeset
273 crt1.o%s \
kono
parents: 67
diff changeset
274 %{p:%e-p is not supported; \
kono
parents: 67
diff changeset
275 pg:crtpg.o%s gmon.o%s; \
kono
parents: 67
diff changeset
276 :crtp.o%s}}} \
kono
parents: 67
diff changeset
277 crti.o%s %(startfile_arch) %(startfile_crtbegin) \
kono
parents: 67
diff changeset
278 %(startfile_vtv)"
kono
parents: 67
diff changeset
279 #else
kono
parents: 67
diff changeset
280 #define STARTFILE_SPEC "%{!shared:%{!symbolic: \
kono
parents: 67
diff changeset
281 %{p:mcrt1.o%s; \
kono
parents: 67
diff changeset
282 pg:gcrt1.o%s gmon.o%s; \
kono
parents: 67
diff changeset
283 :crt1.o%s}}} \
kono
parents: 67
diff changeset
284 crti.o%s %(startfile_arch) %(startfile_crtbegin) \
kono
parents: 67
diff changeset
285 %(startfile_vtv)"
kono
parents: 67
diff changeset
286 #endif
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
287
111
kono
parents: 67
diff changeset
288 #if defined(HAVE_LD_PIE) && defined(HAVE_SOLARIS_CRTS)
kono
parents: 67
diff changeset
289 #define ENDFILE_CRTEND_SPEC "%{static:crtend.o%s; \
kono
parents: 67
diff changeset
290 shared|" PIE_SPEC ":crtendS.o%s; \
kono
parents: 67
diff changeset
291 :crtend.o%s}"
kono
parents: 67
diff changeset
292 #else
kono
parents: 67
diff changeset
293 #define ENDFILE_CRTEND_SPEC "crtend.o%s"
kono
parents: 67
diff changeset
294 #endif
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
295
111
kono
parents: 67
diff changeset
296 #undef ENDFILE_SPEC
kono
parents: 67
diff changeset
297 #define ENDFILE_SPEC \
kono
parents: 67
diff changeset
298 "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
kono
parents: 67
diff changeset
299 %(endfile_arch) %(endfile_vtv) %(endfile_crtend) crtn.o%s"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
300
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
301 #undef LINK_ARCH32_SPEC_BASE
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
302 #define LINK_ARCH32_SPEC_BASE \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
303 "%{G:-G} \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
304 %{YP,*} \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
305 %{R*} \
111
kono
parents: 67
diff changeset
306 %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp%R/lib:%R/usr/lib} \
kono
parents: 67
diff changeset
307 %{!p:%{!pg:-Y P,%R/lib:%R/usr/lib}}}"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
308
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
309 #undef LINK_ARCH32_SPEC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
310 #define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
311
111
kono
parents: 67
diff changeset
312 /* This should be the same as LINK_ARCH32_SPEC_BASE, except with
kono
parents: 67
diff changeset
313 ARCH64_SUBDIR appended to the paths. */
kono
parents: 67
diff changeset
314 #undef LINK_ARCH64_SPEC_BASE
kono
parents: 67
diff changeset
315 #define LINK_ARCH64_SPEC_BASE \
kono
parents: 67
diff changeset
316 "%{G:-G} \
kono
parents: 67
diff changeset
317 %{YP,*} \
kono
parents: 67
diff changeset
318 %{R*} \
kono
parents: 67
diff changeset
319 %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "} \
kono
parents: 67
diff changeset
320 %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "}}}"
kono
parents: 67
diff changeset
321
kono
parents: 67
diff changeset
322 #undef LINK_ARCH64_SPEC
kono
parents: 67
diff changeset
323 #ifndef USE_GLD
kono
parents: 67
diff changeset
324 /* FIXME: Used to be SPARC-only. Not SPARC-specfic but for the model name! */
kono
parents: 67
diff changeset
325 #define LINK_ARCH64_SPEC \
kono
parents: 67
diff changeset
326 "%{mcmodel=medlow:-M /usr/lib/ld/" ARCH64_SUBDIR "/map.below4G} " \
kono
parents: 67
diff changeset
327 LINK_ARCH64_SPEC_BASE
kono
parents: 67
diff changeset
328 #else
kono
parents: 67
diff changeset
329 #define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE
kono
parents: 67
diff changeset
330 #endif
kono
parents: 67
diff changeset
331
kono
parents: 67
diff changeset
332 #ifdef USE_GLD
kono
parents: 67
diff changeset
333 #if DEFAULT_ARCH32_P
kono
parents: 67
diff changeset
334 #define ARCH_DEFAULT_EMULATION ARCH32_EMULATION
kono
parents: 67
diff changeset
335 #else
kono
parents: 67
diff changeset
336 #define ARCH_DEFAULT_EMULATION ARCH64_EMULATION
kono
parents: 67
diff changeset
337 #endif
kono
parents: 67
diff changeset
338 #define TARGET_LD_EMULATION "%{m32:-m " ARCH32_EMULATION "}" \
kono
parents: 67
diff changeset
339 "%{m64:-m " ARCH64_EMULATION "}" \
kono
parents: 67
diff changeset
340 "%{!m32:%{!m64:-m " ARCH_DEFAULT_EMULATION "}} "
kono
parents: 67
diff changeset
341 #else
kono
parents: 67
diff changeset
342 #define TARGET_LD_EMULATION ""
kono
parents: 67
diff changeset
343 #endif
kono
parents: 67
diff changeset
344
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
345 #undef LINK_ARCH_SPEC
111
kono
parents: 67
diff changeset
346 #if DISABLE_MULTILIB
kono
parents: 67
diff changeset
347 #if DEFAULT_ARCH32_P
kono
parents: 67
diff changeset
348 #define LINK_ARCH_SPEC TARGET_LD_EMULATION " \
kono
parents: 67
diff changeset
349 %{m32:%(link_arch32)} \
kono
parents: 67
diff changeset
350 %{m64:%edoes not support multilib} \
kono
parents: 67
diff changeset
351 %{!m32:%{!m64:%(link_arch_default)}} \
kono
parents: 67
diff changeset
352 "
kono
parents: 67
diff changeset
353 #else
kono
parents: 67
diff changeset
354 #define LINK_ARCH_SPEC TARGET_LD_EMULATION " \
kono
parents: 67
diff changeset
355 %{m32:%edoes not support multilib} \
kono
parents: 67
diff changeset
356 %{m64:%(link_arch64)} \
kono
parents: 67
diff changeset
357 %{!m32:%{!m64:%(link_arch_default)}} \
kono
parents: 67
diff changeset
358 "
kono
parents: 67
diff changeset
359 #endif
kono
parents: 67
diff changeset
360 #else
kono
parents: 67
diff changeset
361 #define LINK_ARCH_SPEC TARGET_LD_EMULATION " \
kono
parents: 67
diff changeset
362 %{m32:%(link_arch32)} \
kono
parents: 67
diff changeset
363 %{m64:%(link_arch64)} \
kono
parents: 67
diff changeset
364 %{!m32:%{!m64:%(link_arch_default)}}"
kono
parents: 67
diff changeset
365 #endif
kono
parents: 67
diff changeset
366
kono
parents: 67
diff changeset
367 #define LINK_ARCH_DEFAULT_SPEC \
kono
parents: 67
diff changeset
368 (DEFAULT_ARCH32_P ? LINK_ARCH32_SPEC : LINK_ARCH64_SPEC)
kono
parents: 67
diff changeset
369
kono
parents: 67
diff changeset
370 #undef SUBTARGET_EXTRA_SPECS
kono
parents: 67
diff changeset
371 #define SUBTARGET_EXTRA_SPECS \
kono
parents: 67
diff changeset
372 { "startfile_arch", STARTFILE_ARCH_SPEC }, \
kono
parents: 67
diff changeset
373 { "startfile_crtbegin", STARTFILE_CRTBEGIN_SPEC }, \
kono
parents: 67
diff changeset
374 { "startfile_vtv", STARTFILE_VTV_SPEC }, \
kono
parents: 67
diff changeset
375 { "link_arch32", LINK_ARCH32_SPEC }, \
kono
parents: 67
diff changeset
376 { "link_arch64", LINK_ARCH64_SPEC }, \
kono
parents: 67
diff changeset
377 { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
kono
parents: 67
diff changeset
378 { "link_arch", LINK_ARCH_SPEC }, \
kono
parents: 67
diff changeset
379 { "endfile_arch", ENDFILE_ARCH_SPEC }, \
kono
parents: 67
diff changeset
380 { "endfile_crtend", ENDFILE_CRTEND_SPEC }, \
kono
parents: 67
diff changeset
381 { "endfile_vtv", ENDFILE_VTV_SPEC }, \
kono
parents: 67
diff changeset
382 SUBTARGET_CPU_EXTRA_SPECS
kono
parents: 67
diff changeset
383
kono
parents: 67
diff changeset
384 /* C++11 programs need -lrt for nanosleep. */
kono
parents: 67
diff changeset
385 #define TIME_LIBRARY "rt"
kono
parents: 67
diff changeset
386
kono
parents: 67
diff changeset
387 #ifndef USE_GLD
kono
parents: 67
diff changeset
388 /* With Sun ld, -rdynamic is a no-op. */
kono
parents: 67
diff changeset
389 #define RDYNAMIC_SPEC ""
kono
parents: 67
diff changeset
390 #else
kono
parents: 67
diff changeset
391 /* GNU ld needs --export-dynamic to implement -rdynamic. */
kono
parents: 67
diff changeset
392 #define RDYNAMIC_SPEC "--export-dynamic"
kono
parents: 67
diff changeset
393 #endif
kono
parents: 67
diff changeset
394
kono
parents: 67
diff changeset
395 #ifndef USE_GLD
kono
parents: 67
diff changeset
396 /* Prefer native form with Solaris ld. */
kono
parents: 67
diff changeset
397 #define SYSROOT_SPEC "-z sysroot=%R"
kono
parents: 67
diff changeset
398 #endif
kono
parents: 67
diff changeset
399
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
400 #if !defined(USE_GLD) && defined(ENABLE_SHARED_LIBGCC)
111
kono
parents: 67
diff changeset
401 /* With Sun ld, use mapfile to enforce direct binding to libgcc_s unwinder. */
kono
parents: 67
diff changeset
402 #define LINK_LIBGCC_MAPFILE_SPEC \
kono
parents: 67
diff changeset
403 "%{shared|shared-libgcc:-M %slibgcc-unwind.map}"
kono
parents: 67
diff changeset
404 #else
kono
parents: 67
diff changeset
405 /* GNU ld doesn't support direct binding. */
kono
parents: 67
diff changeset
406 #define LINK_LIBGCC_MAPFILE_SPEC ""
kono
parents: 67
diff changeset
407 #endif
kono
parents: 67
diff changeset
408
kono
parents: 67
diff changeset
409 /* Clear hardware capabilities, either explicitly or with OpenMP:
kono
parents: 67
diff changeset
410 #pragma openmp declare simd creates clones for SSE2, AVX, and AVX2. */
kono
parents: 67
diff changeset
411 #ifdef HAVE_LD_CLEARCAP
kono
parents: 67
diff changeset
412 #define LINK_CLEARCAP_SPEC " %{mclear-hwcap|fopenmp*:-M %sclearcap.map}"
kono
parents: 67
diff changeset
413 #else
kono
parents: 67
diff changeset
414 #define LINK_CLEARCAP_SPEC ""
kono
parents: 67
diff changeset
415 #endif
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
416
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
417 #undef LINK_SPEC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
418 #define LINK_SPEC \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
419 "%{h*} %{v:-V} \
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
420 %{!shared:%{!static:%{rdynamic: " RDYNAMIC_SPEC "}}} \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
421 %{static:-dn -Bstatic} \
111
kono
parents: 67
diff changeset
422 %{shared:-G -dy %{!mimpure-text:-z text}} " \
kono
parents: 67
diff changeset
423 LINK_LIBGCC_MAPFILE_SPEC LINK_CLEARCAP_SPEC " \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
424 %{symbolic:-Bsymbolic -G -dy -z text} \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
425 %(link_arch) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
426 %{Qy:} %{!Qn:-Qy}"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
427
111
kono
parents: 67
diff changeset
428 /* Use --as-needed/-z ignore -lgcc_s for eh support. */
kono
parents: 67
diff changeset
429 #ifdef HAVE_LD_AS_NEEDED
kono
parents: 67
diff changeset
430 #define USE_LD_AS_NEEDED 1
kono
parents: 67
diff changeset
431 #endif
kono
parents: 67
diff changeset
432
kono
parents: 67
diff changeset
433 #ifdef USE_GLD
kono
parents: 67
diff changeset
434 /* Solaris 11 build 135+ implements dl_iterate_phdr. GNU ld needs
kono
parents: 67
diff changeset
435 --eh-frame-hdr to create the required .eh_frame_hdr sections. */
kono
parents: 67
diff changeset
436 #if defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR)
kono
parents: 67
diff changeset
437 #define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
kono
parents: 67
diff changeset
438 #endif /* HAVE_LD_EH_FRAME && TARGET_DL_ITERATE_PHDR */
kono
parents: 67
diff changeset
439 #endif
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
440
111
kono
parents: 67
diff changeset
441 #if defined(HAVE_LD_PIE) && defined(HAVE_SOLARIS_CRTS)
kono
parents: 67
diff changeset
442 #ifdef USE_GLD
kono
parents: 67
diff changeset
443 /* Assert -z text by default to match Solaris ld. */
kono
parents: 67
diff changeset
444 #define LD_PIE_SPEC "-pie %{!mimpure-text:-z text}"
kono
parents: 67
diff changeset
445 #else
kono
parents: 67
diff changeset
446 /* Solaris ld needs -z type=pie instead of -pie. */
kono
parents: 67
diff changeset
447 #define LD_PIE_SPEC "-z type=pie %{mimpure-text:-z textoff}"
kono
parents: 67
diff changeset
448 #endif
kono
parents: 67
diff changeset
449 #else
kono
parents: 67
diff changeset
450 /* Error out if some part of PIE support is missing. */
kono
parents: 67
diff changeset
451 #define LINK_PIE_SPEC \
kono
parents: 67
diff changeset
452 "%{no-pie:} %{pie:%e-pie is not supported in this configuration} "
kono
parents: 67
diff changeset
453 #endif
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
454
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
455 /* collect2.c can only parse GNU nm -n output. Solaris nm needs -png to
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
456 produce the same format. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
457 #define NM_FLAGS "-png"
111
kono
parents: 67
diff changeset
458
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
459 #define STDC_0_IN_SYSTEM_HEADERS 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
460
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
461 /* Support Solaris-specific format checking for cmn_err. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
462 #define TARGET_N_FORMAT_TYPES 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
463 #define TARGET_FORMAT_TYPES solaris_format_types
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
464
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
465 /* #pragma init and #pragma fini are implemented on top of init and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
466 fini attributes. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
467 #define SOLARIS_ATTRIBUTE_TABLE \
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
468 { "init", 0, 0, true, false, false, false, NULL, NULL }, \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
469 { "fini", 0, 0, true, false, false, false, NULL, NULL }
111
kono
parents: 67
diff changeset
470
kono
parents: 67
diff changeset
471 /* Solaris-specific #pragmas are implemented on top of attributes. Hook in
kono
parents: 67
diff changeset
472 the bits from config/sol2.c. */
kono
parents: 67
diff changeset
473 #define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes
kono
parents: 67
diff changeset
474 #define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
475
111
kono
parents: 67
diff changeset
476 /* Allow macro expansion in #pragma pack. */
kono
parents: 67
diff changeset
477 #define HANDLE_PRAGMA_PACK_WITH_EXPANSION
kono
parents: 67
diff changeset
478
kono
parents: 67
diff changeset
479 #define TARGET_CXX_DECL_MANGLING_CONTEXT solaris_cxx_decl_mangling_context
kono
parents: 67
diff changeset
480
kono
parents: 67
diff changeset
481 /* Solaris/x86 as and gas support unquoted section names. */
kono
parents: 67
diff changeset
482 #ifndef SECTION_NAME_FORMAT
kono
parents: 67
diff changeset
483 #define SECTION_NAME_FORMAT "%s"
kono
parents: 67
diff changeset
484 #endif
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
485
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
486 /* This is how to declare the size of a function. For Solaris, we output
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
487 any .init or .fini entries here. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
488 #undef ASM_DECLARE_FUNCTION_SIZE
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
489 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
490 do \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
491 { \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
492 if (!flag_inhibit_size_directive) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
493 ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
494 solaris_output_init_fini (FILE, DECL); \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
495 } \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
496 while (0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
497
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
498 #ifndef USE_GAS
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
499 #undef TARGET_ASM_ASSEMBLE_VISIBILITY
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
500 #define TARGET_ASM_ASSEMBLE_VISIBILITY solaris_assemble_visibility
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
501
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
502 #define AS_NEEDS_DASH_FOR_PIPED_INPUT
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
503
111
kono
parents: 67
diff changeset
504 /* The Solaris assembler cannot grok .stabd directives. */
kono
parents: 67
diff changeset
505 #undef NO_DBX_BNSYM_ENSYM
kono
parents: 67
diff changeset
506 #define NO_DBX_BNSYM_ENSYM 1
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
507 #endif
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
508
111
kono
parents: 67
diff changeset
509 /* Solaris has an implementation of __enable_execute_stack. */
kono
parents: 67
diff changeset
510 #define HAVE_ENABLE_EXECUTE_STACK
kono
parents: 67
diff changeset
511
kono
parents: 67
diff changeset
512 /* Static stack checking is supported by means of probes. */
kono
parents: 67
diff changeset
513 #define STACK_CHECK_STATIC_BUILTIN 1
kono
parents: 67
diff changeset
514
kono
parents: 67
diff changeset
515 #define TARGET_POSIX_IO
kono
parents: 67
diff changeset
516
kono
parents: 67
diff changeset
517 /* Solaris 10 has the float and long double forms of math functions.
kono
parents: 67
diff changeset
518 We redefine this hook so the version from elfos.h header won't be used. */
kono
parents: 67
diff changeset
519 #undef TARGET_LIBC_HAS_FUNCTION
kono
parents: 67
diff changeset
520 #define TARGET_LIBC_HAS_FUNCTION default_libc_has_function
kono
parents: 67
diff changeset
521
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
522 extern GTY(()) tree solaris_pending_aligns;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
523 extern GTY(()) tree solaris_pending_inits;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
524 extern GTY(()) tree solaris_pending_finis;