]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/rs6000/linux64.h
linux64.h (TARGET_OS_CPP_BUILTINS): Define _CALL_LINUX.
[thirdparty/gcc.git] / gcc / config / rs6000 / linux64.h
1 /* Definitions of target machine for GNU compiler,
2 for 64 bit PowerPC linux.
3 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
4 2009, 2010, 2011 Free Software Foundation, Inc.
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published
10 by the Free Software Foundation; either version 3, or (at your
11 option) any later version.
12
13 GCC is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 License for more details.
17
18 Under Section 7 of GPL version 3, you are granted additional
19 permissions described in the GCC Runtime Library Exception, version
20 3.1, as published by the Free Software Foundation.
21
22 You should have received a copy of the GNU General Public License and
23 a copy of the GCC Runtime Library Exception along with this program;
24 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
25 <http://www.gnu.org/licenses/>. */
26
27 #ifndef RS6000_BI_ARCH
28
29 #undef DEFAULT_ABI
30 #define DEFAULT_ABI ABI_AIX
31
32 #undef TARGET_64BIT
33 #define TARGET_64BIT 1
34
35 #define DEFAULT_ARCH64_P 1
36 #define RS6000_BI_ARCH_P 0
37
38 #else
39
40 #define DEFAULT_ARCH64_P (TARGET_DEFAULT & MASK_64BIT)
41 #define RS6000_BI_ARCH_P 1
42
43 #endif
44
45 #ifdef IN_LIBGCC2
46 #undef TARGET_64BIT
47 #ifdef __powerpc64__
48 #define TARGET_64BIT 1
49 #else
50 #define TARGET_64BIT 0
51 #endif
52 #endif
53
54 #undef TARGET_AIX
55 #define TARGET_AIX TARGET_64BIT
56
57 #ifdef HAVE_LD_NO_DOT_SYMS
58 /* New ABI uses a local sym for the function entry point. */
59 extern int dot_symbols;
60 #undef DOT_SYMBOLS
61 #define DOT_SYMBOLS dot_symbols
62 #endif
63
64 #define TARGET_PROFILE_KERNEL profile_kernel
65
66 #define TARGET_USES_LINUX64_OPT 1
67 #ifdef HAVE_LD_LARGE_TOC
68 #undef TARGET_CMODEL
69 #define TARGET_CMODEL rs6000_current_cmodel
70 #define SET_CMODEL(opt) rs6000_current_cmodel = opt
71 #else
72 #define SET_CMODEL(opt) do {} while (0)
73 #endif
74
75 #undef PROCESSOR_DEFAULT
76 #define PROCESSOR_DEFAULT PROCESSOR_POWER7
77 #undef PROCESSOR_DEFAULT64
78 #define PROCESSOR_DEFAULT64 PROCESSOR_POWER7
79
80 /* We don't need to generate entries in .fixup, except when
81 -mrelocatable or -mrelocatable-lib is given. */
82 #undef RELOCATABLE_NEEDS_FIXUP
83 #define RELOCATABLE_NEEDS_FIXUP \
84 (rs6000_isa_flags & rs6000_isa_flags_explicit & OPTION_MASK_RELOCATABLE)
85
86 #undef RS6000_ABI_NAME
87 #define RS6000_ABI_NAME "linux"
88
89 #define INVALID_64BIT "-m%s not supported in this configuration"
90 #define INVALID_32BIT INVALID_64BIT
91
92 #undef SUBSUBTARGET_OVERRIDE_OPTIONS
93 #define SUBSUBTARGET_OVERRIDE_OPTIONS \
94 do \
95 { \
96 if (!global_options_set.x_rs6000_alignment_flags) \
97 rs6000_alignment_flags = MASK_ALIGN_NATURAL; \
98 if (TARGET_64BIT) \
99 { \
100 if (DEFAULT_ABI != ABI_AIX) \
101 { \
102 rs6000_current_abi = ABI_AIX; \
103 error (INVALID_64BIT, "call"); \
104 } \
105 dot_symbols = !strcmp (rs6000_abi_name, "aixdesc"); \
106 if (rs6000_isa_flags & OPTION_MASK_RELOCATABLE) \
107 { \
108 rs6000_isa_flags &= ~OPTION_MASK_RELOCATABLE; \
109 error (INVALID_64BIT, "relocatable"); \
110 } \
111 if (rs6000_isa_flags & OPTION_MASK_EABI) \
112 { \
113 rs6000_isa_flags &= ~OPTION_MASK_EABI; \
114 error (INVALID_64BIT, "eabi"); \
115 } \
116 if (TARGET_PROTOTYPE) \
117 { \
118 target_prototype = 0; \
119 error (INVALID_64BIT, "prototype"); \
120 } \
121 if ((rs6000_isa_flags & OPTION_MASK_POWERPC64) == 0) \
122 { \
123 rs6000_isa_flags |= OPTION_MASK_POWERPC64; \
124 error ("-m64 requires a PowerPC64 cpu"); \
125 } \
126 if ((rs6000_isa_flags_explicit \
127 & OPTION_MASK_MINIMAL_TOC) != 0) \
128 { \
129 if (global_options_set.x_rs6000_current_cmodel \
130 && rs6000_current_cmodel != CMODEL_SMALL) \
131 error ("-mcmodel incompatible with other toc options"); \
132 SET_CMODEL (CMODEL_SMALL); \
133 } \
134 else \
135 { \
136 if (!global_options_set.x_rs6000_current_cmodel) \
137 SET_CMODEL (CMODEL_MEDIUM); \
138 if (rs6000_current_cmodel != CMODEL_SMALL) \
139 { \
140 TARGET_NO_FP_IN_TOC = 0; \
141 TARGET_NO_SUM_IN_TOC = 0; \
142 } \
143 } \
144 } \
145 else \
146 { \
147 if (!RS6000_BI_ARCH_P) \
148 error (INVALID_32BIT, "32"); \
149 if (TARGET_PROFILE_KERNEL) \
150 { \
151 TARGET_PROFILE_KERNEL = 0; \
152 error (INVALID_32BIT, "profile-kernel"); \
153 } \
154 if (global_options_set.x_rs6000_current_cmodel) \
155 { \
156 SET_CMODEL (CMODEL_SMALL); \
157 error (INVALID_32BIT, "cmodel"); \
158 } \
159 } \
160 } \
161 while (0)
162
163 #undef ASM_DEFAULT_SPEC
164 #undef ASM_SPEC
165 #undef LINK_OS_LINUX_SPEC
166
167 #ifndef RS6000_BI_ARCH
168 #define ASM_DEFAULT_SPEC "-mppc64"
169 #define ASM_SPEC "%(asm_spec64) %(asm_spec_common)"
170 #define LINK_OS_LINUX_SPEC "%(link_os_linux_spec64)"
171 #else
172 #if DEFAULT_ARCH64_P
173 #define ASM_DEFAULT_SPEC "-mppc%{!m32:64}"
174 #define ASM_SPEC "%{m32:%(asm_spec32)}%{!m32:%(asm_spec64)} %(asm_spec_common)"
175 #define LINK_OS_LINUX_SPEC "%{m32:%(link_os_linux_spec32)}%{!m32:%(link_os_linux_spec64)}"
176 #else
177 #define ASM_DEFAULT_SPEC "-mppc%{m64:64}"
178 #define ASM_SPEC "%{!m64:%(asm_spec32)}%{m64:%(asm_spec64)} %(asm_spec_common)"
179 #define LINK_OS_LINUX_SPEC "%{!m64:%(link_os_linux_spec32)}%{m64:%(link_os_linux_spec64)}"
180 #endif
181 #endif
182
183 #define ASM_SPEC32 "-a32 \
184 %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
185 %{memb} %{!memb: %{msdata=eabi: -memb}} \
186 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
187 %{mcall-freebsd: -mbig} \
188 %{mcall-i960-old: -mlittle} \
189 %{mcall-linux: -mbig} \
190 %{mcall-netbsd: -mbig} \
191 }}}}"
192
193 #define ASM_SPEC64 "-a64"
194
195 #define ASM_SPEC_COMMON "%(asm_cpu) \
196 %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
197 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}"
198
199 #undef SUBSUBTARGET_EXTRA_SPECS
200 #define SUBSUBTARGET_EXTRA_SPECS \
201 { "asm_spec_common", ASM_SPEC_COMMON }, \
202 { "asm_spec32", ASM_SPEC32 }, \
203 { "asm_spec64", ASM_SPEC64 }, \
204 { "link_os_linux_spec32", LINK_OS_LINUX_SPEC32 }, \
205 { "link_os_linux_spec64", LINK_OS_LINUX_SPEC64 },
206
207 #undef MULTILIB_DEFAULTS
208 #if DEFAULT_ARCH64_P
209 #define MULTILIB_DEFAULTS { "m64" }
210 #else
211 #define MULTILIB_DEFAULTS { "m32" }
212 #endif
213
214 #ifndef RS6000_BI_ARCH
215
216 /* 64-bit PowerPC Linux is always big-endian. */
217 #undef OPTION_LITTLE_ENDIAN
218 #define OPTION_LITTLE_ENDIAN 0
219
220 /* 64-bit PowerPC Linux always has a TOC. */
221 #undef TARGET_TOC
222 #define TARGET_TOC 1
223
224 /* Some things from sysv4.h we don't do when 64 bit. */
225 #undef OPTION_RELOCATABLE
226 #define OPTION_RELOCATABLE 0
227 #undef OPTION_EABI
228 #define OPTION_EABI 0
229 #undef OPTION_PROTOTYPE
230 #define OPTION_PROTOTYPE 0
231 #undef RELOCATABLE_NEEDS_FIXUP
232 #define RELOCATABLE_NEEDS_FIXUP 0
233
234 #endif
235
236 /* We use glibc _mcount for profiling. */
237 #define NO_PROFILE_COUNTERS 1
238 #define PROFILE_HOOK(LABEL) \
239 do { if (TARGET_64BIT) output_profile_hook (LABEL); } while (0)
240
241 /* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */
242 #undef ADJUST_FIELD_ALIGN
243 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
244 ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
245 ? 128 \
246 : (TARGET_64BIT \
247 && TARGET_ALIGN_NATURAL == 0 \
248 && TYPE_MODE (strip_array_types (TREE_TYPE (FIELD))) == DFmode) \
249 ? MIN ((COMPUTED), 32) \
250 : (COMPUTED))
251
252 /* PowerPC64 Linux increases natural record alignment to doubleword if
253 the first field is an FP double, only if in power alignment mode. */
254 #undef ROUND_TYPE_ALIGN
255 #define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
256 ((TARGET_64BIT \
257 && (TREE_CODE (STRUCT) == RECORD_TYPE \
258 || TREE_CODE (STRUCT) == UNION_TYPE \
259 || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
260 && TARGET_ALIGN_NATURAL == 0) \
261 ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
262 : MAX ((COMPUTED), (SPECIFIED)))
263
264 /* Use the default for compiling target libs. */
265 #ifdef IN_TARGET_LIBS
266 #undef TARGET_ALIGN_NATURAL
267 #define TARGET_ALIGN_NATURAL 1
268 #endif
269
270 /* Indicate that jump tables go in the text section. */
271 #undef JUMP_TABLES_IN_TEXT_SECTION
272 #define JUMP_TABLES_IN_TEXT_SECTION TARGET_64BIT
273
274 /* The linux ppc64 ABI isn't explicit on whether aggregates smaller
275 than a doubleword should be padded upward or downward. You could
276 reasonably assume that they follow the normal rules for structure
277 layout treating the parameter area as any other block of memory,
278 then map the reg param area to registers. i.e. pad upward.
279 Setting both of the following defines results in this behavior.
280 Setting just the first one will result in aggregates that fit in a
281 doubleword being padded downward, and others being padded upward.
282 Not a bad idea as this results in struct { int x; } being passed
283 the same way as an int. */
284 #define AGGREGATE_PADDING_FIXED TARGET_64BIT
285 #define AGGREGATES_PAD_UPWARD_ALWAYS 0
286
287 /* Specify padding for the last element of a block move between
288 registers and memory. FIRST is nonzero if this is the only
289 element. */
290 #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
291 (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE))
292
293 /* Linux doesn't support saving and restoring 64-bit regs in a 32-bit
294 process. */
295 #define OS_MISSING_POWERPC64 !TARGET_64BIT
296
297 #ifdef SINGLE_LIBC
298 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
299 #else
300 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
301 #endif
302
303 /* glibc has float and long double forms of math functions. */
304 #undef TARGET_C99_FUNCTIONS
305 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
306
307 /* Whether we have sincos that follows the GNU extension. */
308 #undef TARGET_HAS_SINCOS
309 #define TARGET_HAS_SINCOS (OPTION_GLIBC)
310
311 #undef TARGET_OS_CPP_BUILTINS
312 #define TARGET_OS_CPP_BUILTINS() \
313 do \
314 { \
315 if (TARGET_64BIT) \
316 { \
317 builtin_define ("__PPC__"); \
318 builtin_define ("__PPC64__"); \
319 builtin_define ("__powerpc__"); \
320 builtin_define ("__powerpc64__"); \
321 if (!DOT_SYMBOLS) \
322 builtin_define ("_CALL_LINUX"); \
323 builtin_assert ("cpu=powerpc64"); \
324 builtin_assert ("machine=powerpc64"); \
325 } \
326 else \
327 { \
328 builtin_define_std ("PPC"); \
329 builtin_define_std ("powerpc"); \
330 builtin_assert ("cpu=powerpc"); \
331 builtin_assert ("machine=powerpc"); \
332 TARGET_OS_SYSV_CPP_BUILTINS (); \
333 } \
334 } \
335 while (0)
336
337 #undef CPP_OS_DEFAULT_SPEC
338 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
339
340 /* The GNU C++ standard library currently requires _GNU_SOURCE being
341 defined on glibc-based systems. This temporary hack accomplishes this,
342 it should go away as soon as libstdc++-v3 has a real fix. */
343 #undef CPLUSPLUS_CPP_SPEC
344 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
345
346 #undef LINK_SHLIB_SPEC
347 #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
348
349 #undef LIB_DEFAULT_SPEC
350 #define LIB_DEFAULT_SPEC "%(lib_linux)"
351
352 #undef STARTFILE_DEFAULT_SPEC
353 #define STARTFILE_DEFAULT_SPEC "%(startfile_linux)"
354
355 #undef ENDFILE_DEFAULT_SPEC
356 #define ENDFILE_DEFAULT_SPEC "%(endfile_linux)"
357
358 #undef LINK_START_DEFAULT_SPEC
359 #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
360
361 #undef LINK_OS_DEFAULT_SPEC
362 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
363
364 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
365 #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
366 #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
367 #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
368 #if DEFAULT_LIBC == LIBC_UCLIBC
369 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
370 #elif DEFAULT_LIBC == LIBC_GLIBC
371 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
372 #else
373 #error "Unsupported DEFAULT_LIBC"
374 #endif
375 #define GNU_USER_DYNAMIC_LINKER32 \
376 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
377 #define GNU_USER_DYNAMIC_LINKER64 \
378 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
379
380
381 #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
382 %{rdynamic:-export-dynamic} \
383 -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}"
384
385 #define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \
386 %{rdynamic:-export-dynamic} \
387 -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}"
388
389 #undef TOC_SECTION_ASM_OP
390 #define TOC_SECTION_ASM_OP \
391 (TARGET_64BIT \
392 ? "\t.section\t\".toc\",\"aw\"" \
393 : "\t.section\t\".got\",\"aw\"")
394
395 #undef MINIMAL_TOC_SECTION_ASM_OP
396 #define MINIMAL_TOC_SECTION_ASM_OP \
397 (TARGET_64BIT \
398 ? "\t.section\t\".toc1\",\"aw\"" \
399 : ((TARGET_RELOCATABLE || flag_pic) \
400 ? "\t.section\t\".got2\",\"aw\"" \
401 : "\t.section\t\".got1\",\"aw\""))
402
403 /* Must be at least as big as our pointer type. */
404 #undef SIZE_TYPE
405 #define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
406
407 #undef PTRDIFF_TYPE
408 #define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
409
410 #undef WCHAR_TYPE
411 #define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")
412 #undef WCHAR_TYPE_SIZE
413 #define WCHAR_TYPE_SIZE 32
414
415 /* Override rs6000.h definition. */
416 #undef ASM_APP_ON
417 #define ASM_APP_ON "#APP\n"
418
419 /* Override rs6000.h definition. */
420 #undef ASM_APP_OFF
421 #define ASM_APP_OFF "#NO_APP\n"
422
423 #undef RS6000_MCOUNT
424 #define RS6000_MCOUNT "_mcount"
425
426 #ifdef __powerpc64__
427 /* _init and _fini functions are built from bits spread across many
428 object files, each potentially with a different TOC pointer. For
429 that reason, place a nop after the call so that the linker can
430 restore the TOC pointer if a TOC adjusting call stub is needed. */
431 #if DOT_SYMBOLS
432 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
433 asm (SECTION_OP "\n" \
434 " bl ." #FUNC "\n" \
435 " nop\n" \
436 " .previous");
437 #else
438 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
439 asm (SECTION_OP "\n" \
440 " bl " #FUNC "\n" \
441 " nop\n" \
442 " .previous");
443 #endif
444 #endif
445
446 /* FP save and restore routines. */
447 #undef SAVE_FP_PREFIX
448 #define SAVE_FP_PREFIX (TARGET_64BIT ? "._savef" : "_savefpr_")
449 #undef SAVE_FP_SUFFIX
450 #define SAVE_FP_SUFFIX ""
451 #undef RESTORE_FP_PREFIX
452 #define RESTORE_FP_PREFIX (TARGET_64BIT ? "._restf" : "_restfpr_")
453 #undef RESTORE_FP_SUFFIX
454 #define RESTORE_FP_SUFFIX ""
455
456 /* Dwarf2 debugging. */
457 #undef PREFERRED_DEBUGGING_TYPE
458 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
459
460 /* This is how to declare the size of a function. */
461 #undef ASM_DECLARE_FUNCTION_SIZE
462 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
463 do \
464 { \
465 if (!flag_inhibit_size_directive) \
466 { \
467 fputs ("\t.size\t", (FILE)); \
468 if (TARGET_64BIT && DOT_SYMBOLS) \
469 putc ('.', (FILE)); \
470 assemble_name ((FILE), (FNAME)); \
471 fputs (",.-", (FILE)); \
472 rs6000_output_function_entry (FILE, FNAME); \
473 putc ('\n', (FILE)); \
474 } \
475 } \
476 while (0)
477
478 /* Return nonzero if this entry is to be written into the constant
479 pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF
480 or a CONST containing one of them. If -mfp-in-toc (the default),
481 we also do this for floating-point constants. We actually can only
482 do this if the FP formats of the target and host machines are the
483 same, but we can't check that since not every file that uses
484 the macros includes real.h. We also do this when we can write the
485 entry into the TOC and the entry is not larger than a TOC entry. */
486
487 #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
488 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \
489 (TARGET_TOC \
490 && (GET_CODE (X) == SYMBOL_REF \
491 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
492 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
493 || GET_CODE (X) == LABEL_REF \
494 || (GET_CODE (X) == CONST_INT \
495 && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \
496 || (GET_CODE (X) == CONST_DOUBLE \
497 && ((TARGET_64BIT \
498 && (TARGET_MINIMAL_TOC \
499 || (SCALAR_FLOAT_MODE_P (GET_MODE (X)) \
500 && ! TARGET_NO_FP_IN_TOC))) \
501 || (!TARGET_64BIT \
502 && !TARGET_NO_FP_IN_TOC \
503 && !TARGET_RELOCATABLE \
504 && SCALAR_FLOAT_MODE_P (GET_MODE (X)) \
505 && BITS_PER_WORD == HOST_BITS_PER_INT)))))
506
507 /* Select a format to encode pointers in exception handling data. CODE
508 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
509 true if the symbol may be affected by dynamic relocations. */
510 #undef ASM_PREFERRED_EH_DATA_FORMAT
511 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
512 ((TARGET_64BIT || flag_pic || TARGET_RELOCATABLE) \
513 ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel \
514 | (TARGET_64BIT ? DW_EH_PE_udata8 : DW_EH_PE_sdata4)) \
515 : DW_EH_PE_absptr)
516
517 /* For backward compatibility, we must continue to use the AIX
518 structure return convention. */
519 #undef DRAFT_V4_STRUCT_RET
520 #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT)
521
522 #define TARGET_POSIX_IO
523
524 #define LINK_GCC_C_SEQUENCE_SPEC \
525 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
526
527 /* Use --as-needed -lgcc_s for eh support. */
528 #ifdef HAVE_LD_AS_NEEDED
529 #define USE_LD_AS_NEEDED 1
530 #endif
531
532 #ifdef TARGET_LIBC_PROVIDES_SSP
533 /* ppc32 glibc provides __stack_chk_guard in -0x7008(2),
534 ppc64 glibc provides it at -0x7010(13). */
535 #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? -0x7010 : -0x7008)
536 #endif
537
538 #define POWERPC_LINUX
539
540 /* ppc{32,64} linux has 128-bit long double support in glibc 2.4 and later. */
541 #ifdef TARGET_DEFAULT_LONG_DOUBLE_128
542 #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
543 #endif
544
545 /* Static stack checking is supported by means of probes. */
546 #define STACK_CHECK_STATIC_BUILTIN 1
547
548 /* The default value isn't sufficient in 64-bit mode. */
549 #define STACK_CHECK_PROTECT (TARGET_64BIT ? 16 * 1024 : 12 * 1024)