Module Name: src Committed By: mrg Date: Tue Mar 4 08:43:13 UTC 2014
Modified Files: src/external/gpl3/gcc/dist/gcc: config.gcc src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h Log Message: include dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h netbsd.h and netbsd-elf.h on powerpc64-netbsd. port netbsd64.h forward from GCC changes. (it's a pity that a vast portion of linux64.h isn't in some common header that netbsd64.h and freebsd64.h could also used. there's 100s of lines of copypasta here, oh well.) To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/external/gpl3/gcc/dist/gcc/config.gcc cvs rdiff -u -r1.5 -r1.6 \ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/gpl3/gcc/dist/gcc/config.gcc diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.20 src/external/gpl3/gcc/dist/gcc/config.gcc:1.21 --- src/external/gpl3/gcc/dist/gcc/config.gcc:1.20 Sat Mar 1 09:04:12 2014 +++ src/external/gpl3/gcc/dist/gcc/config.gcc Tue Mar 4 08:43:12 2014 @@ -2114,13 +2114,15 @@ powerpc*-*-freebsd*) esac ;; powerpc*-*-netbsd*) + tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h" + tm_file="${tm_file} netbsd.h netbsd-elf.h" case ${target} in powerpc64*) tm_file="rs6000/biarch64.h ${tm_file} rs6000/default64.h rs6000/netbsd64.h" tmake_file="${tmake_file} rs6000/t-netbsd64" ;; *) - tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h" + tm_file="${tm_file} rs6000/netbsd.h" tmake_file="${tmake_file} rs6000/t-netbsd" ;; esac Index: src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.5 src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.6 --- src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.5 Sat Mar 1 09:44:50 2014 +++ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h Tue Mar 4 08:43:12 2014 @@ -59,6 +59,15 @@ extern int dot_symbols; #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_POWER4 #undef PROCESSOR_DEFAULT64 @@ -80,7 +89,7 @@ extern int dot_symbols; #define SUBSUBTARGET_OVERRIDE_OPTIONS \ do \ { \ - if (!rs6000_explicit_options.alignment) \ + if (!global_options_set.x_rs6000_alignment_flags) \ rs6000_alignment_flags = MASK_ALIGN_NATURAL; \ if (TARGET_64BIT) \ { \ @@ -90,14 +99,14 @@ extern int dot_symbols; error (INVALID_64BIT, "call"); \ } \ dot_symbols = !strcmp (rs6000_abi_name, "aixdesc"); \ - if (target_flags & MASK_RELOCATABLE) \ + if (rs6000_isa_flags & OPTION_MASK_RELOCATABLE) \ { \ - target_flags &= ~MASK_RELOCATABLE; \ + rs6000_isa_flags &= ~OPTION_MASK_RELOCATABLE; \ error (INVALID_64BIT, "relocatable"); \ } \ - if (target_flags & MASK_EABI) \ + if (rs6000_isa_flags & OPTION_MASK_EABI) \ { \ - target_flags &= ~MASK_EABI; \ + rs6000_isa_flags &= ~OPTION_MASK_EABI; \ error (INVALID_64BIT, "eabi"); \ } \ if (TARGET_PROTOTYPE) \ @@ -105,11 +114,28 @@ extern int dot_symbols; target_prototype = 0; \ error (INVALID_64BIT, "prototype"); \ } \ - if ((target_flags & MASK_POWERPC64) == 0) \ + if ((rs6000_isa_flags & OPTION_MASK_POWERPC64) == 0) \ { \ - target_flags |= MASK_POWERPC64; \ + rs6000_isa_flags |= OPTION_MASK_POWERPC64; \ error ("-m64 requires a PowerPC64 cpu"); \ } \ + if ((rs6000_isa_flags_explicit \ + & OPTION_MASK_MINIMAL_TOC) != 0) \ + { \ + if (global_options_set.x_rs6000_current_cmodel \ + && rs6000_current_cmodel != CMODEL_SMALL) \ + error ("-mcmodel incompatible with other toc options"); \ + SET_CMODEL (CMODEL_SMALL); \ + } \ + { \ + if (!global_options_set.x_rs6000_current_cmodel) \ + SET_CMODEL (CMODEL_MEDIUM); \ + if (rs6000_current_cmodel != CMODEL_SMALL) \ + { \ + TARGET_NO_FP_IN_TOC = 0; \ + TARGET_NO_SUM_IN_TOC = 0; \ + } \ + } \ } \ else \ { \ @@ -120,16 +146,23 @@ extern int dot_symbols; TARGET_PROFILE_KERNEL = 0; \ error (INVALID_32BIT, "profile-kernel"); \ } \ + if (global_options_set.x_rs6000_current_cmodel) \ + { \ + SET_CMODEL (CMODEL_SMALL); \ + error (INVALID_32BIT, "cmodel"); \ + } \ } \ } \ while (0) #ifdef RS6000_BI_ARCH +#if 0 #undef OVERRIDE_OPTIONS #define OVERRIDE_OPTIONS \ rs6000_override_options (((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \ ? (char *) 0 : TARGET_CPU_DEFAULT) +#endif #endif @@ -153,30 +186,22 @@ extern int dot_symbols; #endif #endif -#define ASM_SPEC32 "-a32 %{n} %{T} %{Ym,*} %{Yd,*} \ -%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \ -%{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \ -%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ - %{mcall-freebsd: -mbig} \ - %{mcall-i960-old: -mlittle} \ - %{mcall-linux: -mbig} \ - %{mcall-gnu: -mbig} \ - %{mcall-netbsd: -mbig} \ -}}}}" +#define ASM_SPEC32 "-a32 \ +%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \ +%{memb|msdata=eabi: -memb}" #define ASM_SPEC64 "-a64" #define ASM_SPEC_COMMON "%(asm_cpu) \ -%{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \ -%{v:-V} %{Qy:} %{!Qn:-Qy} %{Wa,*:%*} \ -%{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}" +%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}" \ + ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN) #undef SUBSUBTARGET_EXTRA_SPECS #define SUBSUBTARGET_EXTRA_SPECS \ { "asm_spec_common", ASM_SPEC_COMMON }, \ { "asm_spec32", ASM_SPEC32 }, \ { "asm_spec64", ASM_SPEC64 }, \ - { "link_os_netbsd_spec32", LINK_OS_NETBSD_SPEC32 }, \ + { "link_os_netbsd_spec32", LINK_OS_NETBSD_SPEC32 }, \ { "link_os_netbsd_spec64", LINK_OS_NETBSD_SPEC64 }, #undef MULTILIB_DEFAULTS @@ -260,10 +285,6 @@ extern int dot_symbols; #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \ (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE)) -/* Override svr4.h */ -#undef MD_EXEC_PREFIX -#undef MD_STARTFILE_PREFIX - /* NetBSD doesn't support saving and restoring 64-bit regs in a 32-bit process. XXXMRG? */ #define OS_MISSING_POWERPC64 !TARGET_64BIT @@ -328,9 +349,6 @@ extern int dot_symbols; #undef ENDFILE_DEFAULT_SPEC #define ENDFILE_DEFAULT_SPEC "%(endfile_netbsd)" -#undef CRTSAVRES_DEFAULT_SPEC -#define CRTSAVRES_DEFAULT_SPEC "" - #undef LINK_START_DEFAULT_SPEC #define LINK_START_DEFAULT_SPEC "%(link_start_netbsd)" @@ -468,68 +486,6 @@ extern int dot_symbols; && SCALAR_FLOAT_MODE_P (GET_MODE (X)) \ && BITS_PER_WORD == HOST_BITS_PER_INT))))) -/* This ABI cannot use DBX_LINES_FUNCTION_RELATIVE, nor can it use - dbxout_stab_value_internal_label_diff, because we must - use the function code label, not the function descriptor label. */ -#define DBX_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \ -do \ - { \ - char temp[256]; \ - const char *s; \ - ASM_GENERATE_INTERNAL_LABEL (temp, "LM", COUNTER); \ - dbxout_begin_stabn_sline (LINE); \ - assemble_name (FILE, temp); \ - putc ('-', FILE); \ - s = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); \ - rs6000_output_function_entry (FILE, s); \ - putc ('\n', FILE); \ - targetm.asm_out.internal_label (FILE, "LM", COUNTER); \ - COUNTER += 1; \ - } \ -while (0) - -/* Similarly, we want the function code label here. Cannot use - dbxout_stab_value_label_diff, as we have to use - rs6000_output_function_entry. FIXME. */ -#define DBX_OUTPUT_BRAC(FILE, NAME, BRAC) \ - do \ - { \ - const char *s; \ - dbxout_begin_stabn (BRAC); \ - s = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); \ - /* dbxout_block passes this macro the function name as NAME, \ - assuming that it is the function code start label. In our \ - case, the function name is the OPD entry. dbxout_block is \ - broken, hack around it here. */ \ - if (NAME == s) \ - putc ('0', FILE); \ - else \ - { \ - assemble_name (FILE, NAME); \ - putc ('-', FILE); \ - rs6000_output_function_entry (FILE, s); \ - } \ - putc ('\n', FILE); \ - } \ - while (0) - -#define DBX_OUTPUT_LBRAC(FILE, NAME) DBX_OUTPUT_BRAC (FILE, NAME, N_LBRAC) -#define DBX_OUTPUT_RBRAC(FILE, NAME) DBX_OUTPUT_BRAC (FILE, NAME, N_RBRAC) - -/* Another case where we want the dot name. */ -#define DBX_OUTPUT_NFUN(FILE, LSCOPE, DECL) \ - do \ - { \ - const char *s; \ - dbxout_begin_empty_stabs (N_FUN); \ - assemble_name (FILE, LSCOPE); \ - putc ('-', FILE); \ - s = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); \ - rs6000_output_function_entry (FILE, s); \ - putc ('\n', FILE); \ - } \ - while (0) - /* Select a format to encode pointers in exception handling data. CODE is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is true if the symbol may be affected by dynamic relocations. */ @@ -545,8 +501,6 @@ while (0) #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 \