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