Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/rs6000/linux64.h @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | b7f97abdc517 |
children | 04ced10e8804 |
comparison
equal
deleted
inserted
replaced
65:65488c3d617d | 67:f6334be47118 |
---|---|
1 /* Definitions of target machine for GNU compiler, | 1 /* Definitions of target machine for GNU compiler, |
2 for 64 bit PowerPC linux. | 2 for 64 bit PowerPC linux. |
3 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, | 3 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
4 2009, 2010 Free Software Foundation, Inc. | 4 2009, 2010, 2011 Free Software Foundation, Inc. |
5 | 5 |
6 This file is part of GCC. | 6 This file is part of GCC. |
7 | 7 |
8 GCC is free software; you can redistribute it and/or modify it | 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 | 9 under the terms of the GNU General Public License as published |
61 #define DOT_SYMBOLS dot_symbols | 61 #define DOT_SYMBOLS dot_symbols |
62 #endif | 62 #endif |
63 | 63 |
64 #define TARGET_PROFILE_KERNEL profile_kernel | 64 #define TARGET_PROFILE_KERNEL profile_kernel |
65 | 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 | |
66 #undef PROCESSOR_DEFAULT | 75 #undef PROCESSOR_DEFAULT |
67 #define PROCESSOR_DEFAULT PROCESSOR_POWER6 | 76 #define PROCESSOR_DEFAULT PROCESSOR_POWER7 |
68 #undef PROCESSOR_DEFAULT64 | 77 #undef PROCESSOR_DEFAULT64 |
69 #define PROCESSOR_DEFAULT64 PROCESSOR_POWER6 | 78 #define PROCESSOR_DEFAULT64 PROCESSOR_POWER7 |
70 | 79 |
71 /* We don't need to generate entries in .fixup, except when | 80 /* We don't need to generate entries in .fixup, except when |
72 -mrelocatable or -mrelocatable-lib is given. */ | 81 -mrelocatable or -mrelocatable-lib is given. */ |
73 #undef RELOCATABLE_NEEDS_FIXUP | 82 #undef RELOCATABLE_NEEDS_FIXUP |
74 #define RELOCATABLE_NEEDS_FIXUP \ | 83 #define RELOCATABLE_NEEDS_FIXUP \ |
112 if ((target_flags & MASK_POWERPC64) == 0) \ | 121 if ((target_flags & MASK_POWERPC64) == 0) \ |
113 { \ | 122 { \ |
114 target_flags |= MASK_POWERPC64; \ | 123 target_flags |= MASK_POWERPC64; \ |
115 error ("-m64 requires a PowerPC64 cpu"); \ | 124 error ("-m64 requires a PowerPC64 cpu"); \ |
116 } \ | 125 } \ |
126 if ((target_flags_explicit & MASK_MINIMAL_TOC) != 0) \ | |
127 { \ | |
128 if (rs6000_explicit_options.cmodel \ | |
129 && rs6000_current_cmodel != CMODEL_SMALL) \ | |
130 error ("-mcmodel incompatible with other toc options"); \ | |
131 SET_CMODEL (CMODEL_SMALL); \ | |
132 } \ | |
133 else \ | |
134 { \ | |
135 if (!rs6000_explicit_options.cmodel) \ | |
136 SET_CMODEL (CMODEL_MEDIUM); \ | |
137 if (rs6000_current_cmodel != CMODEL_SMALL) \ | |
138 { \ | |
139 TARGET_NO_FP_IN_TOC = 0; \ | |
140 TARGET_NO_SUM_IN_TOC = 0; \ | |
141 } \ | |
142 } \ | |
117 } \ | 143 } \ |
118 else \ | 144 else \ |
119 { \ | 145 { \ |
120 if (!RS6000_BI_ARCH_P) \ | 146 if (!RS6000_BI_ARCH_P) \ |
121 error (INVALID_32BIT, "32"); \ | 147 error (INVALID_32BIT, "32"); \ |
122 if (TARGET_PROFILE_KERNEL) \ | 148 if (TARGET_PROFILE_KERNEL) \ |
123 { \ | 149 { \ |
124 TARGET_PROFILE_KERNEL = 0; \ | 150 TARGET_PROFILE_KERNEL = 0; \ |
125 error (INVALID_32BIT, "profile-kernel"); \ | 151 error (INVALID_32BIT, "profile-kernel"); \ |
126 } \ | 152 } \ |
153 if (rs6000_explicit_options.cmodel) \ | |
154 { \ | |
155 SET_CMODEL (CMODEL_SMALL); \ | |
156 error (INVALID_32BIT, "cmodel"); \ | |
157 } \ | |
127 } \ | 158 } \ |
128 } \ | 159 } \ |
129 while (0) | 160 while (0) |
130 | 161 |
131 #ifdef RS6000_BI_ARCH | 162 #ifdef RS6000_BI_ARCH |
132 | 163 |
133 #undef OVERRIDE_OPTIONS | 164 #undef OPTION_TARGET_CPU_DEFAULT |
134 #define OVERRIDE_OPTIONS \ | 165 #define OPTION_TARGET_CPU_DEFAULT \ |
135 rs6000_override_options (((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \ | 166 (((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \ |
136 ? (char *) 0 : TARGET_CPU_DEFAULT) | 167 ? (char *) 0 : TARGET_CPU_DEFAULT) |
137 | 168 |
138 #endif | 169 #endif |
139 | 170 |
140 #undef ASM_DEFAULT_SPEC | 171 #undef ASM_DEFAULT_SPEC |
141 #undef ASM_SPEC | 172 #undef ASM_SPEC |
159 #define ASM_SPEC "%{!m64:%(asm_spec32)}%{m64:%(asm_spec64)} %(asm_spec_common)" | 190 #define ASM_SPEC "%{!m64:%(asm_spec32)}%{m64:%(asm_spec64)} %(asm_spec_common)" |
160 #define LINK_OS_LINUX_SPEC "%{!m64:%(link_os_linux_spec32)}%{m64:%(link_os_linux_spec64)}" | 191 #define LINK_OS_LINUX_SPEC "%{!m64:%(link_os_linux_spec32)}%{m64:%(link_os_linux_spec64)}" |
161 #endif | 192 #endif |
162 #endif | 193 #endif |
163 | 194 |
164 #define ASM_SPEC32 "-a32 %{n} %{T} %{Ym,*} %{Yd,*} \ | 195 #define ASM_SPEC32 "-a32 \ |
165 %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \ | 196 %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \ |
166 %{memb} %{!memb: %{msdata=eabi: -memb}} \ | 197 %{memb} %{!memb: %{msdata=eabi: -memb}} \ |
167 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ | 198 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ |
168 %{mcall-freebsd: -mbig} \ | 199 %{mcall-freebsd: -mbig} \ |
169 %{mcall-i960-old: -mlittle} \ | 200 %{mcall-i960-old: -mlittle} \ |
174 | 205 |
175 #define ASM_SPEC64 "-a64" | 206 #define ASM_SPEC64 "-a64" |
176 | 207 |
177 #define ASM_SPEC_COMMON "%(asm_cpu) \ | 208 #define ASM_SPEC_COMMON "%(asm_cpu) \ |
178 %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \ | 209 %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \ |
179 %{v:-V} %{Qy:} %{!Qn:-Qy} %{Wa,*:%*} \ | |
180 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}" | 210 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}" |
181 | 211 |
182 #undef SUBSUBTARGET_EXTRA_SPECS | 212 #undef SUBSUBTARGET_EXTRA_SPECS |
183 #define SUBSUBTARGET_EXTRA_SPECS \ | 213 #define SUBSUBTARGET_EXTRA_SPECS \ |
184 { "asm_spec_common", ASM_SPEC_COMMON }, \ | 214 { "asm_spec_common", ASM_SPEC_COMMON }, \ |
271 registers and memory. FIRST is nonzero if this is the only | 301 registers and memory. FIRST is nonzero if this is the only |
272 element. */ | 302 element. */ |
273 #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \ | 303 #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \ |
274 (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE)) | 304 (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE)) |
275 | 305 |
276 /* __throw will restore its own return address to be the same as the | |
277 return address of the function that the throw is being made to. | |
278 This is unfortunate, because we want to check the original | |
279 return address to see if we need to restore the TOC. | |
280 So we have to squirrel it away with this. */ | |
281 #define SETUP_FRAME_ADDRESSES() \ | |
282 do { if (TARGET_64BIT) rs6000_aix_emit_builtin_unwind_init (); } while (0) | |
283 | |
284 /* Override svr4.h */ | |
285 #undef MD_EXEC_PREFIX | |
286 #undef MD_STARTFILE_PREFIX | |
287 | |
288 /* Linux doesn't support saving and restoring 64-bit regs in a 32-bit | 306 /* Linux doesn't support saving and restoring 64-bit regs in a 32-bit |
289 process. */ | 307 process. */ |
290 #define OS_MISSING_POWERPC64 !TARGET_64BIT | 308 #define OS_MISSING_POWERPC64 !TARGET_64BIT |
309 | |
310 #ifdef SINGLE_LIBC | |
311 #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) | |
312 #else | |
313 #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) | |
314 #endif | |
291 | 315 |
292 /* glibc has float and long double forms of math functions. */ | 316 /* glibc has float and long double forms of math functions. */ |
293 #undef TARGET_C99_FUNCTIONS | 317 #undef TARGET_C99_FUNCTIONS |
294 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC) | 318 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC) |
295 | 319 |
350 | 374 |
351 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" | 375 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" |
352 #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1" | 376 #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1" |
353 #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" | 377 #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" |
354 #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" | 378 #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" |
355 #if UCLIBC_DEFAULT | 379 #if DEFAULT_LIBC == LIBC_UCLIBC |
356 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}" | 380 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" |
357 #else | 381 #elif DEFAULT_LIBC == LIBC_GLIBC |
358 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}" | 382 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" |
383 #else | |
384 #error "Unsupported DEFAULT_LIBC" | |
359 #endif | 385 #endif |
360 #define LINUX_DYNAMIC_LINKER32 \ | 386 #define LINUX_DYNAMIC_LINKER32 \ |
361 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) | 387 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) |
362 #define LINUX_DYNAMIC_LINKER64 \ | 388 #define LINUX_DYNAMIC_LINKER64 \ |
363 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) | 389 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) |
364 | 390 |
365 | 391 |
366 #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \ | 392 #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \ |
367 %{rdynamic:-export-dynamic} \ | 393 %{rdynamic:-export-dynamic} \ |
368 %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER32 "}}}" | 394 -dynamic-linker " LINUX_DYNAMIC_LINKER32 "}}" |
369 | 395 |
370 #define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \ | 396 #define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \ |
371 %{rdynamic:-export-dynamic} \ | 397 %{rdynamic:-export-dynamic} \ |
372 %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}}}" | 398 -dynamic-linker " LINUX_DYNAMIC_LINKER64 "}}" |
373 | 399 |
374 #undef TOC_SECTION_ASM_OP | 400 #undef TOC_SECTION_ASM_OP |
375 #define TOC_SECTION_ASM_OP \ | 401 #define TOC_SECTION_ASM_OP \ |
376 (TARGET_64BIT \ | 402 (TARGET_64BIT \ |
377 ? "\t.section\t\".toc\",\"aw\"" \ | 403 ? "\t.section\t\".toc\",\"aw\"" \ |
509 /* For backward compatibility, we must continue to use the AIX | 535 /* For backward compatibility, we must continue to use the AIX |
510 structure return convention. */ | 536 structure return convention. */ |
511 #undef DRAFT_V4_STRUCT_RET | 537 #undef DRAFT_V4_STRUCT_RET |
512 #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT) | 538 #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT) |
513 | 539 |
514 #define TARGET_ASM_FILE_END rs6000_elf_end_indicate_exec_stack | |
515 | |
516 #define TARGET_POSIX_IO | 540 #define TARGET_POSIX_IO |
517 | 541 |
518 #define LINK_GCC_C_SEQUENCE_SPEC \ | 542 #define LINK_GCC_C_SEQUENCE_SPEC \ |
519 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" | 543 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" |
520 | 544 |
535 | 559 |
536 /* ppc{32,64} linux has 128-bit long double support in glibc 2.4 and later. */ | 560 /* ppc{32,64} linux has 128-bit long double support in glibc 2.4 and later. */ |
537 #ifdef TARGET_DEFAULT_LONG_DOUBLE_128 | 561 #ifdef TARGET_DEFAULT_LONG_DOUBLE_128 |
538 #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128 | 562 #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128 |
539 #endif | 563 #endif |
564 | |
565 /* Static stack checking is supported by means of probes. */ | |
566 #define STACK_CHECK_STATIC_BUILTIN 1 | |
567 | |
568 /* The default value isn't sufficient in 64-bit mode. */ | |
569 #define STACK_CHECK_PROTECT (TARGET_64BIT ? 16 * 1024 : 12 * 1024) |