Mercurial > hg > CbC > CbC_gcc
annotate gcc/config/rs6000/linux64.h @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | f6334be47118 |
children | 84e7813d76e9 |
rev | line source |
---|---|
0 | 1 /* Definitions of target machine for GNU compiler, |
2 for 64 bit PowerPC linux. | |
111 | 3 Copyright (C) 2000-2017 Free Software Foundation, Inc. |
0 | 4 |
5 This file is part of GCC. | |
6 | |
7 GCC is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published | |
9 by the Free Software Foundation; either version 3, or (at your | |
10 option) any later version. | |
11 | |
12 GCC is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | |
15 License for more details. | |
16 | |
17 Under Section 7 of GPL version 3, you are granted additional | |
18 permissions described in the GCC Runtime Library Exception, version | |
19 3.1, as published by the Free Software Foundation. | |
20 | |
21 You should have received a copy of the GNU General Public License and | |
22 a copy of the GCC Runtime Library Exception along with this program; | |
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
24 <http://www.gnu.org/licenses/>. */ | |
25 | |
26 #ifndef RS6000_BI_ARCH | |
27 | |
28 #undef TARGET_64BIT | |
29 #define TARGET_64BIT 1 | |
30 | |
31 #define DEFAULT_ARCH64_P 1 | |
32 #define RS6000_BI_ARCH_P 0 | |
33 | |
34 #else | |
35 | |
36 #define DEFAULT_ARCH64_P (TARGET_DEFAULT & MASK_64BIT) | |
37 #define RS6000_BI_ARCH_P 1 | |
38 | |
39 #endif | |
40 | |
41 #ifdef IN_LIBGCC2 | |
42 #undef TARGET_64BIT | |
43 #ifdef __powerpc64__ | |
44 #define TARGET_64BIT 1 | |
45 #else | |
46 #define TARGET_64BIT 0 | |
47 #endif | |
48 #endif | |
49 | |
50 #undef TARGET_AIX | |
51 #define TARGET_AIX TARGET_64BIT | |
52 | |
53 #ifdef HAVE_LD_NO_DOT_SYMS | |
54 /* New ABI uses a local sym for the function entry point. */ | |
55 extern int dot_symbols; | |
56 #undef DOT_SYMBOLS | |
57 #define DOT_SYMBOLS dot_symbols | |
58 #endif | |
59 | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
60 #define TARGET_PROFILE_KERNEL profile_kernel |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
61 |
111 | 62 #undef TARGET_KEEP_LEAF_WHEN_PROFILED |
63 #define TARGET_KEEP_LEAF_WHEN_PROFILED rs6000_keep_leaf_when_profiled | |
64 | |
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
|
65 #define TARGET_USES_LINUX64_OPT 1 |
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
|
66 #ifdef HAVE_LD_LARGE_TOC |
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
|
67 #undef TARGET_CMODEL |
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
|
68 #define TARGET_CMODEL rs6000_current_cmodel |
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
|
69 #define SET_CMODEL(opt) rs6000_current_cmodel = opt |
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
|
70 #else |
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
|
71 #define SET_CMODEL(opt) do {} while (0) |
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
|
72 #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
|
73 |
0 | 74 #undef PROCESSOR_DEFAULT |
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
|
75 #define PROCESSOR_DEFAULT PROCESSOR_POWER7 |
0 | 76 #undef PROCESSOR_DEFAULT64 |
111 | 77 #define PROCESSOR_DEFAULT64 PROCESSOR_POWER8 |
0 | 78 |
79 /* We don't need to generate entries in .fixup, except when | |
80 -mrelocatable or -mrelocatable-lib is given. */ | |
81 #undef RELOCATABLE_NEEDS_FIXUP | |
82 #define RELOCATABLE_NEEDS_FIXUP \ | |
111 | 83 (rs6000_isa_flags & rs6000_isa_flags_explicit & OPTION_MASK_RELOCATABLE) |
0 | 84 |
85 #undef RS6000_ABI_NAME | |
86 #define RS6000_ABI_NAME "linux" | |
87 | |
111 | 88 #define INVALID_64BIT "%<-m%s%> not supported in this configuration" |
0 | 89 #define INVALID_32BIT INVALID_64BIT |
90 | |
111 | 91 #ifdef LINUX64_DEFAULT_ABI_ELFv2 |
92 #define ELFv2_ABI_CHECK (rs6000_elf_abi != 1) | |
93 #else | |
94 #define ELFv2_ABI_CHECK (rs6000_elf_abi == 2) | |
95 #endif | |
96 | |
0 | 97 #undef SUBSUBTARGET_OVERRIDE_OPTIONS |
98 #define SUBSUBTARGET_OVERRIDE_OPTIONS \ | |
99 do \ | |
100 { \ | |
111 | 101 if (!global_options_set.x_rs6000_alignment_flags) \ |
0 | 102 rs6000_alignment_flags = MASK_ALIGN_NATURAL; \ |
111 | 103 if (rs6000_isa_flags & OPTION_MASK_64BIT) \ |
0 | 104 { \ |
105 if (DEFAULT_ABI != ABI_AIX) \ | |
106 { \ | |
107 rs6000_current_abi = ABI_AIX; \ | |
108 error (INVALID_64BIT, "call"); \ | |
109 } \ | |
110 dot_symbols = !strcmp (rs6000_abi_name, "aixdesc"); \ | |
111 | 111 if (ELFv2_ABI_CHECK) \ |
0 | 112 { \ |
111 | 113 rs6000_current_abi = ABI_ELFv2; \ |
114 if (dot_symbols) \ | |
115 error ("-mcall-aixdesc incompatible with -mabi=elfv2"); \ | |
116 } \ | |
117 if (rs6000_isa_flags & OPTION_MASK_RELOCATABLE) \ | |
118 { \ | |
119 rs6000_isa_flags &= ~OPTION_MASK_RELOCATABLE; \ | |
0 | 120 error (INVALID_64BIT, "relocatable"); \ |
121 } \ | |
111 | 122 if (rs6000_isa_flags & OPTION_MASK_EABI) \ |
0 | 123 { \ |
111 | 124 rs6000_isa_flags &= ~OPTION_MASK_EABI; \ |
0 | 125 error (INVALID_64BIT, "eabi"); \ |
126 } \ | |
127 if (TARGET_PROTOTYPE) \ | |
128 { \ | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
129 target_prototype = 0; \ |
0 | 130 error (INVALID_64BIT, "prototype"); \ |
131 } \ | |
111 | 132 if ((rs6000_isa_flags & OPTION_MASK_POWERPC64) == 0) \ |
0 | 133 { \ |
111 | 134 rs6000_isa_flags |= OPTION_MASK_POWERPC64; \ |
0 | 135 error ("-m64 requires a PowerPC64 cpu"); \ |
136 } \ | |
111 | 137 if ((rs6000_isa_flags_explicit \ |
138 & OPTION_MASK_MINIMAL_TOC) != 0) \ | |
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
|
139 { \ |
111 | 140 if (global_options_set.x_rs6000_current_cmodel \ |
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
|
141 && rs6000_current_cmodel != CMODEL_SMALL) \ |
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
|
142 error ("-mcmodel incompatible with other toc options"); \ |
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
|
143 SET_CMODEL (CMODEL_SMALL); \ |
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
|
144 } \ |
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
|
145 else \ |
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
|
146 { \ |
111 | 147 if (!global_options_set.x_rs6000_current_cmodel) \ |
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
|
148 SET_CMODEL (CMODEL_MEDIUM); \ |
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
|
149 if (rs6000_current_cmodel != CMODEL_SMALL) \ |
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
|
150 { \ |
111 | 151 if (!global_options_set.x_TARGET_NO_FP_IN_TOC) \ |
152 TARGET_NO_FP_IN_TOC \ | |
153 = rs6000_current_cmodel == CMODEL_MEDIUM; \ | |
154 if (!global_options_set.x_TARGET_NO_SUM_IN_TOC) \ | |
155 TARGET_NO_SUM_IN_TOC = 0; \ | |
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
|
156 } \ |
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
|
157 } \ |
0 | 158 } \ |
159 else \ | |
160 { \ | |
161 if (!RS6000_BI_ARCH_P) \ | |
162 error (INVALID_32BIT, "32"); \ | |
163 if (TARGET_PROFILE_KERNEL) \ | |
164 { \ | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
165 TARGET_PROFILE_KERNEL = 0; \ |
0 | 166 error (INVALID_32BIT, "profile-kernel"); \ |
167 } \ | |
111 | 168 if (global_options_set.x_rs6000_current_cmodel) \ |
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
|
169 { \ |
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
|
170 SET_CMODEL (CMODEL_SMALL); \ |
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 error (INVALID_32BIT, "cmodel"); \ |
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
|
172 } \ |
0 | 173 } \ |
174 } \ | |
175 while (0) | |
176 | |
177 #undef ASM_DEFAULT_SPEC | |
178 #undef ASM_SPEC | |
179 #undef LINK_OS_LINUX_SPEC | |
111 | 180 #undef LINK_SECURE_PLT_SPEC |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
181 |
0 | 182 #ifndef RS6000_BI_ARCH |
183 #define ASM_DEFAULT_SPEC "-mppc64" | |
184 #define ASM_SPEC "%(asm_spec64) %(asm_spec_common)" | |
185 #define LINK_OS_LINUX_SPEC "%(link_os_linux_spec64)" | |
111 | 186 #define LINK_SECURE_PLT_SPEC "" |
0 | 187 #else |
188 #if DEFAULT_ARCH64_P | |
189 #define ASM_DEFAULT_SPEC "-mppc%{!m32:64}" | |
190 #define ASM_SPEC "%{m32:%(asm_spec32)}%{!m32:%(asm_spec64)} %(asm_spec_common)" | |
191 #define LINK_OS_LINUX_SPEC "%{m32:%(link_os_linux_spec32)}%{!m32:%(link_os_linux_spec64)}" | |
111 | 192 #define LINK_SECURE_PLT_SPEC "%{m32: " LINK_SECURE_PLT_DEFAULT_SPEC "}" |
0 | 193 #else |
194 #define ASM_DEFAULT_SPEC "-mppc%{m64:64}" | |
195 #define ASM_SPEC "%{!m64:%(asm_spec32)}%{m64:%(asm_spec64)} %(asm_spec_common)" | |
196 #define LINK_OS_LINUX_SPEC "%{!m64:%(link_os_linux_spec32)}%{m64:%(link_os_linux_spec64)}" | |
111 | 197 #define LINK_SECURE_PLT_SPEC "%{!m64: " LINK_SECURE_PLT_DEFAULT_SPEC "}" |
0 | 198 #endif |
199 #endif | |
200 | |
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
|
201 #define ASM_SPEC32 "-a32 \ |
111 | 202 %{mrelocatable} %{mrelocatable-lib} %{" FPIE_OR_FPIC_SPEC ":-K PIC} \ |
203 %{memb|msdata=eabi: -memb}" | |
0 | 204 |
205 #define ASM_SPEC64 "-a64" | |
206 | |
207 #define ASM_SPEC_COMMON "%(asm_cpu) \ | |
111 | 208 %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}" \ |
209 ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN) | |
0 | 210 |
211 #undef SUBSUBTARGET_EXTRA_SPECS | |
212 #define SUBSUBTARGET_EXTRA_SPECS \ | |
213 { "asm_spec_common", ASM_SPEC_COMMON }, \ | |
214 { "asm_spec32", ASM_SPEC32 }, \ | |
215 { "asm_spec64", ASM_SPEC64 }, \ | |
216 { "link_os_linux_spec32", LINK_OS_LINUX_SPEC32 }, \ | |
111 | 217 { "link_os_linux_spec64", LINK_OS_LINUX_SPEC64 }, \ |
218 { "link_os_extra_spec32", LINK_OS_EXTRA_SPEC32 }, \ | |
219 { "link_os_extra_spec64", LINK_OS_EXTRA_SPEC64 }, \ | |
220 { "link_os_new_dtags", LINK_OS_NEW_DTAGS_SPEC }, \ | |
221 { "include_extra", INCLUDE_EXTRA_SPEC }, \ | |
222 { "dynamic_linker_prefix", DYNAMIC_LINKER_PREFIX }, | |
223 | |
224 /* Optional specs used for overriding the system include directory, default | |
225 -rpath links, and prefix for the dynamic linker. Normally, there are not | |
226 defined, but if the user configure with the --with-advance-toolchain=<xxx> | |
227 option, the advance-toolchain.h file will override these. */ | |
228 #ifndef INCLUDE_EXTRA_SPEC | |
229 #define INCLUDE_EXTRA_SPEC "" | |
230 #endif | |
231 | |
232 #ifndef LINK_OS_EXTRA_SPEC32 | |
233 #define LINK_OS_EXTRA_SPEC32 "" | |
234 #endif | |
235 | |
236 #ifndef LINK_OS_EXTRA_SPEC64 | |
237 #define LINK_OS_EXTRA_SPEC64 "" | |
238 #endif | |
239 | |
240 #ifndef LINK_OS_NEW_DTAGS_SPEC | |
241 #define LINK_OS_NEW_DTAGS_SPEC "" | |
242 #endif | |
243 | |
244 #ifndef DYNAMIC_LINKER_PREFIX | |
245 #define DYNAMIC_LINKER_PREFIX "" | |
246 #endif | |
0 | 247 |
248 #undef MULTILIB_DEFAULTS | |
249 #if DEFAULT_ARCH64_P | |
250 #define MULTILIB_DEFAULTS { "m64" } | |
251 #else | |
252 #define MULTILIB_DEFAULTS { "m32" } | |
253 #endif | |
254 | |
111 | 255 /* Split stack is only supported for 64 bit, and requires glibc >= 2.18. */ |
256 #if TARGET_GLIBC_MAJOR * 1000 + TARGET_GLIBC_MINOR >= 2018 | |
257 # ifndef RS6000_BI_ARCH | |
258 # define TARGET_CAN_SPLIT_STACK | |
259 # else | |
260 # if DEFAULT_ARCH64_P | |
261 /* Supported, and the default is -m64 */ | |
262 # define TARGET_CAN_SPLIT_STACK_64BIT 1 | |
263 # else | |
264 /* Supported, and the default is -m32 */ | |
265 # define TARGET_CAN_SPLIT_STACK_64BIT 0 | |
266 # endif | |
267 # endif | |
268 #endif | |
0 | 269 |
111 | 270 #ifndef RS6000_BI_ARCH |
0 | 271 |
272 /* 64-bit PowerPC Linux always has a TOC. */ | |
273 #undef TARGET_TOC | |
274 #define TARGET_TOC 1 | |
275 | |
276 /* Some things from sysv4.h we don't do when 64 bit. */ | |
111 | 277 #undef OPTION_RELOCATABLE |
278 #define OPTION_RELOCATABLE 0 | |
279 #undef OPTION_EABI | |
280 #define OPTION_EABI 0 | |
281 #undef OPTION_PROTOTYPE | |
282 #define OPTION_PROTOTYPE 0 | |
0 | 283 #undef RELOCATABLE_NEEDS_FIXUP |
284 #define RELOCATABLE_NEEDS_FIXUP 0 | |
285 | |
286 #endif | |
287 | |
288 /* We use glibc _mcount for profiling. */ | |
289 #define NO_PROFILE_COUNTERS 1 | |
290 #define PROFILE_HOOK(LABEL) \ | |
291 do { if (TARGET_64BIT) output_profile_hook (LABEL); } while (0) | |
292 | |
293 /* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */ | |
294 #undef ADJUST_FIELD_ALIGN | |
111 | 295 #define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \ |
296 (rs6000_special_adjust_field_align_p ((TYPE), (COMPUTED)) \ | |
0 | 297 ? 128 \ |
298 : (TARGET_64BIT \ | |
299 && TARGET_ALIGN_NATURAL == 0 \ | |
111 | 300 && TYPE_MODE (strip_array_types (TYPE)) == DFmode) \ |
0 | 301 ? MIN ((COMPUTED), 32) \ |
302 : (COMPUTED)) | |
303 | |
304 /* PowerPC64 Linux increases natural record alignment to doubleword if | |
305 the first field is an FP double, only if in power alignment mode. */ | |
306 #undef ROUND_TYPE_ALIGN | |
307 #define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \ | |
308 ((TARGET_64BIT \ | |
309 && (TREE_CODE (STRUCT) == RECORD_TYPE \ | |
310 || TREE_CODE (STRUCT) == UNION_TYPE \ | |
311 || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \ | |
312 && TARGET_ALIGN_NATURAL == 0) \ | |
313 ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \ | |
314 : MAX ((COMPUTED), (SPECIFIED))) | |
315 | |
316 /* Use the default for compiling target libs. */ | |
317 #ifdef IN_TARGET_LIBS | |
318 #undef TARGET_ALIGN_NATURAL | |
319 #define TARGET_ALIGN_NATURAL 1 | |
320 #endif | |
321 | |
322 /* Indicate that jump tables go in the text section. */ | |
323 #undef JUMP_TABLES_IN_TEXT_SECTION | |
324 #define JUMP_TABLES_IN_TEXT_SECTION TARGET_64BIT | |
325 | |
326 /* The linux ppc64 ABI isn't explicit on whether aggregates smaller | |
327 than a doubleword should be padded upward or downward. You could | |
328 reasonably assume that they follow the normal rules for structure | |
329 layout treating the parameter area as any other block of memory, | |
330 then map the reg param area to registers. i.e. pad upward. | |
331 Setting both of the following defines results in this behavior. | |
332 Setting just the first one will result in aggregates that fit in a | |
333 doubleword being padded downward, and others being padded upward. | |
334 Not a bad idea as this results in struct { int x; } being passed | |
335 the same way as an int. */ | |
336 #define AGGREGATE_PADDING_FIXED TARGET_64BIT | |
337 #define AGGREGATES_PAD_UPWARD_ALWAYS 0 | |
338 | |
339 /* Specify padding for the last element of a block move between | |
340 registers and memory. FIRST is nonzero if this is the only | |
341 element. */ | |
342 #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \ | |
111 | 343 (!(FIRST) ? PAD_UPWARD : targetm.calls.function_arg_padding (MODE, TYPE)) |
0 | 344 |
345 /* Linux doesn't support saving and restoring 64-bit regs in a 32-bit | |
346 process. */ | |
347 #define OS_MISSING_POWERPC64 !TARGET_64BIT | |
348 | |
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
|
349 #ifdef SINGLE_LIBC |
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
|
350 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) |
111 | 351 #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) |
352 #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) | |
353 #undef OPTION_MUSL | |
354 #define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) | |
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
|
355 #else |
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
|
356 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) |
111 | 357 #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) |
358 #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) | |
359 #undef OPTION_MUSL | |
360 #define OPTION_MUSL (linux_libc == LIBC_MUSL) | |
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
|
361 #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
|
362 |
111 | 363 /* Determine what functions are present at the runtime; |
364 this includes full c99 runtime and sincos. */ | |
365 #undef TARGET_LIBC_HAS_FUNCTION | |
366 #define TARGET_LIBC_HAS_FUNCTION linux_libc_has_function | |
0 | 367 |
368 #undef TARGET_OS_CPP_BUILTINS | |
369 #define TARGET_OS_CPP_BUILTINS() \ | |
370 do \ | |
371 { \ | |
372 if (TARGET_64BIT) \ | |
373 { \ | |
374 builtin_define ("__PPC__"); \ | |
375 builtin_define ("__PPC64__"); \ | |
376 builtin_define ("__powerpc__"); \ | |
377 builtin_define ("__powerpc64__"); \ | |
111 | 378 if (!DOT_SYMBOLS) \ |
379 builtin_define ("_CALL_LINUX"); \ | |
0 | 380 builtin_assert ("cpu=powerpc64"); \ |
381 builtin_assert ("machine=powerpc64"); \ | |
382 } \ | |
383 else \ | |
384 { \ | |
385 builtin_define_std ("PPC"); \ | |
386 builtin_define_std ("powerpc"); \ | |
387 builtin_assert ("cpu=powerpc"); \ | |
388 builtin_assert ("machine=powerpc"); \ | |
389 TARGET_OS_SYSV_CPP_BUILTINS (); \ | |
390 } \ | |
391 } \ | |
392 while (0) | |
393 | |
394 #undef CPP_OS_DEFAULT_SPEC | |
111 | 395 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux) %(include_extra)" |
0 | 396 |
397 #undef LINK_SHLIB_SPEC | |
111 | 398 #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}} \ |
399 %{static-pie:-static -pie --no-dynamic-linker -z text}" | |
0 | 400 |
401 #undef LIB_DEFAULT_SPEC | |
402 #define LIB_DEFAULT_SPEC "%(lib_linux)" | |
403 | |
404 #undef STARTFILE_DEFAULT_SPEC | |
405 #define STARTFILE_DEFAULT_SPEC "%(startfile_linux)" | |
406 | |
407 #undef ENDFILE_DEFAULT_SPEC | |
408 #define ENDFILE_DEFAULT_SPEC "%(endfile_linux)" | |
409 | |
410 #undef LINK_START_DEFAULT_SPEC | |
411 #define LINK_START_DEFAULT_SPEC "%(link_start_linux)" | |
412 | |
413 #undef LINK_OS_DEFAULT_SPEC | |
414 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)" | |
415 | |
111 | 416 #define GLIBC_DYNAMIC_LINKER32 "%(dynamic_linker_prefix)/lib/ld.so.1" |
417 | |
418 #ifdef LINUX64_DEFAULT_ABI_ELFv2 | |
419 #define GLIBC_DYNAMIC_LINKER64 \ | |
420 "%{mabi=elfv1:%(dynamic_linker_prefix)/lib64/ld64.so.1;" \ | |
421 ":%(dynamic_linker_prefix)/lib64/ld64.so.2}" | |
422 #else | |
423 #define GLIBC_DYNAMIC_LINKER64 \ | |
424 "%{mabi=elfv2:%(dynamic_linker_prefix)/lib64/ld64.so.2;" \ | |
425 ":%(dynamic_linker_prefix)/lib64/ld64.so.1}" | |
426 #endif | |
427 | |
428 #define MUSL_DYNAMIC_LINKER32 \ | |
429 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" | |
430 #define MUSL_DYNAMIC_LINKER64 \ | |
431 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" | |
432 | |
0 | 433 #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" |
434 #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" | |
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
|
435 #if DEFAULT_LIBC == LIBC_UCLIBC |
111 | 436 #define CHOOSE_DYNAMIC_LINKER(G, U, M) \ |
437 "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" | |
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
|
438 #elif DEFAULT_LIBC == LIBC_GLIBC |
111 | 439 #define CHOOSE_DYNAMIC_LINKER(G, U, M) \ |
440 "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" | |
441 #elif DEFAULT_LIBC == LIBC_MUSL | |
442 #define CHOOSE_DYNAMIC_LINKER(G, U, M) \ | |
443 "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" | |
0 | 444 #else |
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
|
445 #error "Unsupported DEFAULT_LIBC" |
0 | 446 #endif |
111 | 447 #define GNU_USER_DYNAMIC_LINKER32 \ |
448 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \ | |
449 MUSL_DYNAMIC_LINKER32) | |
450 #define GNU_USER_DYNAMIC_LINKER64 \ | |
451 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \ | |
452 MUSL_DYNAMIC_LINKER64) | |
0 | 453 |
111 | 454 #undef DEFAULT_ASM_ENDIAN |
455 #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN) | |
456 #define DEFAULT_ASM_ENDIAN " -mlittle" | |
457 #define LINK_OS_LINUX_EMUL32 ENDIAN_SELECT(" -m elf32ppclinux", \ | |
458 " -m elf32lppclinux", \ | |
459 " -m elf32lppclinux") | |
460 #define LINK_OS_LINUX_EMUL64 ENDIAN_SELECT(" -m elf64ppc", \ | |
461 " -m elf64lppc", \ | |
462 " -m elf64lppc") | |
463 #else | |
464 #define DEFAULT_ASM_ENDIAN " -mbig" | |
465 #define LINK_OS_LINUX_EMUL32 ENDIAN_SELECT(" -m elf32ppclinux", \ | |
466 " -m elf32lppclinux", \ | |
467 " -m elf32ppclinux") | |
468 #define LINK_OS_LINUX_EMUL64 ENDIAN_SELECT(" -m elf64ppc", \ | |
469 " -m elf64lppc", \ | |
470 " -m elf64ppc") | |
471 #endif | |
0 | 472 |
111 | 473 #define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \ |
474 %{!static-pie: \ | |
475 %{rdynamic:-export-dynamic} \ | |
476 -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}} \ | |
477 %(link_os_extra_spec32)" | |
478 | |
479 #define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \ | |
480 %{!static-pie: \ | |
481 %{rdynamic:-export-dynamic} \ | |
482 -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \ | |
483 %(link_os_extra_spec64)" | |
0 | 484 |
485 #undef TOC_SECTION_ASM_OP | |
486 #define TOC_SECTION_ASM_OP \ | |
487 (TARGET_64BIT \ | |
488 ? "\t.section\t\".toc\",\"aw\"" \ | |
489 : "\t.section\t\".got\",\"aw\"") | |
490 | |
491 #undef MINIMAL_TOC_SECTION_ASM_OP | |
492 #define MINIMAL_TOC_SECTION_ASM_OP \ | |
493 (TARGET_64BIT \ | |
494 ? "\t.section\t\".toc1\",\"aw\"" \ | |
111 | 495 : (flag_pic \ |
0 | 496 ? "\t.section\t\".got2\",\"aw\"" \ |
497 : "\t.section\t\".got1\",\"aw\"")) | |
498 | |
499 /* Must be at least as big as our pointer type. */ | |
500 #undef SIZE_TYPE | |
501 #define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int") | |
502 | |
503 #undef PTRDIFF_TYPE | |
504 #define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int") | |
505 | |
506 #undef WCHAR_TYPE | |
507 #define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int") | |
508 #undef WCHAR_TYPE_SIZE | |
509 #define WCHAR_TYPE_SIZE 32 | |
510 | |
511 #undef RS6000_MCOUNT | |
512 #define RS6000_MCOUNT "_mcount" | |
513 | |
514 #ifdef __powerpc64__ | |
515 /* _init and _fini functions are built from bits spread across many | |
516 object files, each potentially with a different TOC pointer. For | |
517 that reason, place a nop after the call so that the linker can | |
518 restore the TOC pointer if a TOC adjusting call stub is needed. */ | |
519 #if DOT_SYMBOLS | |
520 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ | |
521 asm (SECTION_OP "\n" \ | |
522 " bl ." #FUNC "\n" \ | |
523 " nop\n" \ | |
524 " .previous"); | |
525 #else | |
526 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ | |
527 asm (SECTION_OP "\n" \ | |
528 " bl " #FUNC "\n" \ | |
529 " nop\n" \ | |
530 " .previous"); | |
531 #endif | |
532 #endif | |
533 | |
534 /* FP save and restore routines. */ | |
535 #undef SAVE_FP_PREFIX | |
536 #define SAVE_FP_PREFIX (TARGET_64BIT ? "._savef" : "_savefpr_") | |
537 #undef SAVE_FP_SUFFIX | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
538 #define SAVE_FP_SUFFIX "" |
0 | 539 #undef RESTORE_FP_PREFIX |
540 #define RESTORE_FP_PREFIX (TARGET_64BIT ? "._restf" : "_restfpr_") | |
541 #undef RESTORE_FP_SUFFIX | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
542 #define RESTORE_FP_SUFFIX "" |
0 | 543 |
544 /* Dwarf2 debugging. */ | |
545 #undef PREFERRED_DEBUGGING_TYPE | |
546 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG | |
547 | |
548 /* This is how to declare the size of a function. */ | |
549 #undef ASM_DECLARE_FUNCTION_SIZE | |
550 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ | |
551 do \ | |
552 { \ | |
553 if (!flag_inhibit_size_directive) \ | |
554 { \ | |
555 fputs ("\t.size\t", (FILE)); \ | |
556 if (TARGET_64BIT && DOT_SYMBOLS) \ | |
557 putc ('.', (FILE)); \ | |
558 assemble_name ((FILE), (FNAME)); \ | |
559 fputs (",.-", (FILE)); \ | |
560 rs6000_output_function_entry (FILE, FNAME); \ | |
561 putc ('\n', (FILE)); \ | |
562 } \ | |
563 } \ | |
564 while (0) | |
565 | |
566 /* Return nonzero if this entry is to be written into the constant | |
567 pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF | |
568 or a CONST containing one of them. If -mfp-in-toc (the default), | |
569 we also do this for floating-point constants. We actually can only | |
570 do this if the FP formats of the target and host machines are the | |
571 same, but we can't check that since not every file that uses | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
572 the macros includes real.h. We also do this when we can write the |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
573 entry into the TOC and the entry is not larger than a TOC entry. */ |
0 | 574 |
575 #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P | |
576 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \ | |
577 (TARGET_TOC \ | |
578 && (GET_CODE (X) == SYMBOL_REF \ | |
579 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \ | |
580 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \ | |
581 || GET_CODE (X) == LABEL_REF \ | |
582 || (GET_CODE (X) == CONST_INT \ | |
583 && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \ | |
584 || (GET_CODE (X) == CONST_DOUBLE \ | |
585 && ((TARGET_64BIT \ | |
586 && (TARGET_MINIMAL_TOC \ | |
587 || (SCALAR_FLOAT_MODE_P (GET_MODE (X)) \ | |
588 && ! TARGET_NO_FP_IN_TOC))) \ | |
589 || (!TARGET_64BIT \ | |
590 && !TARGET_NO_FP_IN_TOC \ | |
591 && SCALAR_FLOAT_MODE_P (GET_MODE (X)) \ | |
592 && BITS_PER_WORD == HOST_BITS_PER_INT))))) | |
593 | |
594 /* Select a format to encode pointers in exception handling data. CODE | |
595 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is | |
596 true if the symbol may be affected by dynamic relocations. */ | |
597 #undef ASM_PREFERRED_EH_DATA_FORMAT | |
598 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ | |
111 | 599 (TARGET_64BIT || flag_pic \ |
0 | 600 ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel \ |
601 | (TARGET_64BIT ? DW_EH_PE_udata8 : DW_EH_PE_sdata4)) \ | |
602 : DW_EH_PE_absptr) | |
603 | |
604 /* For backward compatibility, we must continue to use the AIX | |
605 structure return convention. */ | |
606 #undef DRAFT_V4_STRUCT_RET | |
607 #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT) | |
608 | |
609 #ifdef TARGET_LIBC_PROVIDES_SSP | |
610 /* ppc32 glibc provides __stack_chk_guard in -0x7008(2), | |
611 ppc64 glibc provides it at -0x7010(13). */ | |
612 #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? -0x7010 : -0x7008) | |
613 #endif | |
614 | |
615 #define POWERPC_LINUX | |
616 | |
617 /* ppc{32,64} linux has 128-bit long double support in glibc 2.4 and later. */ | |
618 #ifdef TARGET_DEFAULT_LONG_DOUBLE_128 | |
619 #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128 | |
620 #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
|
621 |
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
|
622 /* Static stack checking is supported by means of probes. */ |
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
|
623 #define STACK_CHECK_STATIC_BUILTIN 1 |
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
|
624 |
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
|
625 /* The default value isn't sufficient in 64-bit mode. */ |
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
|
626 #define STACK_CHECK_PROTECT (TARGET_64BIT ? 16 * 1024 : 12 * 1024) |
111 | 627 |
628 /* Software floating point support for exceptions and rounding modes | |
629 depends on the C library in use. */ | |
630 #undef TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P | |
631 #define TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P \ | |
632 rs6000_linux_float_exceptions_rounding_supported_p | |
633 | |
634 /* Support for TARGET_ATOMIC_ASSIGN_EXPAND_FENV without FPRs depends | |
635 on glibc 2.19 or greater. */ | |
636 #if TARGET_GLIBC_MAJOR > 2 \ | |
637 || (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR >= 19) | |
638 #define RS6000_GLIBC_ATOMIC_FENV 1 | |
639 #endif | |
640 | |
641 /* The IEEE 128-bit emulator is only built on Linux systems. Flag that we | |
642 should enable the type handling for KFmode on VSX systems even if we are not | |
643 enabling the __float128 keyword. */ | |
644 #undef TARGET_FLOAT128_ENABLE_TYPE | |
645 #define TARGET_FLOAT128_ENABLE_TYPE 1 |