Mercurial > hg > CbC > CbC_gcc
diff 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 |
line wrap: on
line diff
--- a/gcc/config/rs6000/linux64.h Tue May 25 18:58:51 2010 +0900 +++ b/gcc/config/rs6000/linux64.h Tue Mar 22 17:18:12 2011 +0900 @@ -1,7 +1,7 @@ /* Definitions of target machine for GNU compiler, for 64 bit PowerPC linux. Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, - 2009, 2010 Free Software Foundation, Inc. + 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of GCC. @@ -63,10 +63,19 @@ #define TARGET_PROFILE_KERNEL profile_kernel +#define TARGET_USES_LINUX64_OPT 1 +#ifdef HAVE_LD_LARGE_TOC +#undef TARGET_CMODEL +#define TARGET_CMODEL rs6000_current_cmodel +#define SET_CMODEL(opt) rs6000_current_cmodel = opt +#else +#define SET_CMODEL(opt) do {} while (0) +#endif + #undef PROCESSOR_DEFAULT -#define PROCESSOR_DEFAULT PROCESSOR_POWER6 +#define PROCESSOR_DEFAULT PROCESSOR_POWER7 #undef PROCESSOR_DEFAULT64 -#define PROCESSOR_DEFAULT64 PROCESSOR_POWER6 +#define PROCESSOR_DEFAULT64 PROCESSOR_POWER7 /* We don't need to generate entries in .fixup, except when -mrelocatable or -mrelocatable-lib is given. */ @@ -114,6 +123,23 @@ target_flags |= MASK_POWERPC64; \ error ("-m64 requires a PowerPC64 cpu"); \ } \ + if ((target_flags_explicit & MASK_MINIMAL_TOC) != 0) \ + { \ + if (rs6000_explicit_options.cmodel \ + && rs6000_current_cmodel != CMODEL_SMALL) \ + error ("-mcmodel incompatible with other toc options"); \ + SET_CMODEL (CMODEL_SMALL); \ + } \ + else \ + { \ + if (!rs6000_explicit_options.cmodel) \ + SET_CMODEL (CMODEL_MEDIUM); \ + if (rs6000_current_cmodel != CMODEL_SMALL) \ + { \ + TARGET_NO_FP_IN_TOC = 0; \ + TARGET_NO_SUM_IN_TOC = 0; \ + } \ + } \ } \ else \ { \ @@ -124,16 +150,21 @@ TARGET_PROFILE_KERNEL = 0; \ error (INVALID_32BIT, "profile-kernel"); \ } \ + if (rs6000_explicit_options.cmodel) \ + { \ + SET_CMODEL (CMODEL_SMALL); \ + error (INVALID_32BIT, "cmodel"); \ + } \ } \ } \ while (0) #ifdef RS6000_BI_ARCH -#undef OVERRIDE_OPTIONS -#define OVERRIDE_OPTIONS \ - rs6000_override_options (((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \ - ? (char *) 0 : TARGET_CPU_DEFAULT) +#undef OPTION_TARGET_CPU_DEFAULT +#define OPTION_TARGET_CPU_DEFAULT \ + (((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \ + ? (char *) 0 : TARGET_CPU_DEFAULT) #endif @@ -161,7 +192,7 @@ #endif #endif -#define ASM_SPEC32 "-a32 %{n} %{T} %{Ym,*} %{Yd,*} \ +#define ASM_SPEC32 "-a32 \ %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \ %{memb} %{!memb: %{msdata=eabi: -memb}} \ %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ @@ -176,7 +207,6 @@ #define ASM_SPEC_COMMON "%(asm_cpu) \ %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \ -%{v:-V} %{Qy:} %{!Qn:-Qy} %{Wa,*:%*} \ %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}" #undef SUBSUBTARGET_EXTRA_SPECS @@ -273,22 +303,16 @@ #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \ (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE)) -/* __throw will restore its own return address to be the same as the - return address of the function that the throw is being made to. - This is unfortunate, because we want to check the original - return address to see if we need to restore the TOC. - So we have to squirrel it away with this. */ -#define SETUP_FRAME_ADDRESSES() \ - do { if (TARGET_64BIT) rs6000_aix_emit_builtin_unwind_init (); } while (0) - -/* Override svr4.h */ -#undef MD_EXEC_PREFIX -#undef MD_STARTFILE_PREFIX - /* Linux doesn't support saving and restoring 64-bit regs in a 32-bit process. */ #define OS_MISSING_POWERPC64 !TARGET_64BIT +#ifdef SINGLE_LIBC +#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) +#else +#define OPTION_GLIBC (linux_libc == LIBC_GLIBC) +#endif + /* glibc has float and long double forms of math functions. */ #undef TARGET_C99_FUNCTIONS #define TARGET_C99_FUNCTIONS (OPTION_GLIBC) @@ -352,10 +376,12 @@ #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1" #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" -#if UCLIBC_DEFAULT -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}" +#if DEFAULT_LIBC == LIBC_UCLIBC +#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" +#elif DEFAULT_LIBC == LIBC_GLIBC +#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" #else -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}" +#error "Unsupported DEFAULT_LIBC" #endif #define LINUX_DYNAMIC_LINKER32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) @@ -365,11 +391,11 @@ #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER32 "}}}" + -dynamic-linker " LINUX_DYNAMIC_LINKER32 "}}" #define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}}}" + -dynamic-linker " LINUX_DYNAMIC_LINKER64 "}}" #undef TOC_SECTION_ASM_OP #define TOC_SECTION_ASM_OP \ @@ -511,8 +537,6 @@ #undef DRAFT_V4_STRUCT_RET #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT) -#define TARGET_ASM_FILE_END rs6000_elf_end_indicate_exec_stack - #define TARGET_POSIX_IO #define LINK_GCC_C_SEQUENCE_SPEC \ @@ -537,3 +561,9 @@ #ifdef TARGET_DEFAULT_LONG_DOUBLE_128 #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128 #endif + +/* Static stack checking is supported by means of probes. */ +#define STACK_CHECK_STATIC_BUILTIN 1 + +/* The default value isn't sufficient in 64-bit mode. */ +#define STACK_CHECK_PROTECT (TARGET_64BIT ? 16 * 1024 : 12 * 1024)