From dc34721ac3bf7e3c406fba8cfe9d139393345ec5 Mon Sep 17 00:00:00 2001 From: Jing Yu Date: Tue, 8 Jun 2010 14:25:17 -0700 Subject: New gcc sources for toolchain checked in on 06/03/2010. Changes: gcc/ira-conflicts.c Backport a gcc-4.4.3 patch to fix a ra bug http://b/issue?id=2667593. http://gcc.gnu.org/ml/gcc-cvs/2009-05/msg00055.html Owner: jingyu Status: In upstream gcc-4.4.3 r147081. gcc/collect2.c gcc/common.opt gcc/configure.ac gcc/configure gcc/doc/invoke.texi gcc/exec-tool.in gcc/gcc.c gcc/opts.c Add -fuse-ld= option to select linker. This CL merges the gcc part of this up-stream patch. http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00402.html Owner: dougkwan Status: binutils part in upstream, gcc part pending approval. Change-Id: Ibfa819535ebdb7499aae8981687c2dc51295a25a --- gcc-4.2.1/gcc/config/arm/arm-tune.md | 5 ++ gcc-4.4.0/README.google | 20 +++++++ gcc-4.4.0/gcc/collect2.c | 95 +++++++++++++++++++++++++++++-- gcc-4.4.0/gcc/common.opt | 3 + gcc-4.4.0/gcc/configure | 22 ++++++- gcc-4.4.0/gcc/configure.ac | 14 +++++ gcc-4.4.0/gcc/doc/invoke.texi | 12 +++- gcc-4.4.0/gcc/exec-tool.in | 107 +++++++++++++++++++++++++++-------- gcc-4.4.0/gcc/gcc.c | 6 +- gcc-4.4.0/gcc/ira-conflicts.c | 2 +- gcc-4.4.0/gcc/opts.c | 4 ++ 11 files changed, 257 insertions(+), 33 deletions(-) create mode 100644 gcc-4.2.1/gcc/config/arm/arm-tune.md diff --git a/gcc-4.2.1/gcc/config/arm/arm-tune.md b/gcc-4.2.1/gcc/config/arm/arm-tune.md new file mode 100644 index 000000000..950cd9129 --- /dev/null +++ b/gcc-4.2.1/gcc/config/arm/arm-tune.md @@ -0,0 +1,5 @@ +;; -*- buffer-read-only: t -*- +;; Generated automatically by gentune.sh from arm-cores.def +(define_attr "tune" + "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore" + (const (symbol_ref "arm_tune"))) diff --git a/gcc-4.4.0/README.google b/gcc-4.4.0/README.google index 82bc08ae5..3343bb5ae 100644 --- a/gcc-4.4.0/README.google +++ b/gcc-4.4.0/README.google @@ -2271,3 +2271,23 @@ gcc/config/arm/eabi.h security problem. http://b/issue?id=2623907. Owner: jingyu Status: google local + +gcc/ira-conflicts.c + Backport a gcc-4.4.3 patch to fix a ra bug http://b/issue?id=2667593. + http://gcc.gnu.org/ml/gcc-cvs/2009-05/msg00055.html + Owner: jingyu + Status: In upstream gcc-4.4.3 r147081. + +gcc/collect2.c +gcc/common.opt +gcc/configure.ac +gcc/configure +gcc/doc/invoke.texi +gcc/exec-tool.in +gcc/gcc.c +gcc/opts.c + Add -fuse-ld= option to select linker. This CL merges the gcc part of + this up-stream patch. + http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00402.html + Owner: dougkwan + Status: binutils part in upstream, gcc part pending approval. diff --git a/gcc-4.4.0/gcc/collect2.c b/gcc-4.4.0/gcc/collect2.c index 3f62dfe40..b7058154a 100644 --- a/gcc-4.4.0/gcc/collect2.c +++ b/gcc-4.4.0/gcc/collect2.c @@ -766,6 +766,8 @@ int main (int argc, char **argv) { static const char *const ld_suffix = "ld"; + static const char *const gold_suffix = "ld.gold"; + static const char *const bfd_ld_suffix = "ld.bfd"; static const char *const real_ld_suffix = "real-ld"; static const char *const collect_ld_suffix = "collect-ld"; static const char *const nm_suffix = "nm"; @@ -784,6 +786,10 @@ main (int argc, char **argv) const char *const full_ld_suffix = concat(target_machine, "-", ld_suffix, NULL); + const char *const full_gold_suffix = + concat(target_machine, "-", gold_suffix, NULL); + const char *const full_bfd_ld_suffix = + concat(target_machine, "-", bfd_ld_suffix, NULL); const char *const full_nm_suffix = concat (target_machine, "-", nm_suffix, NULL); const char *const full_gnm_suffix = @@ -798,6 +804,8 @@ main (int argc, char **argv) concat (target_machine, "-", gstrip_suffix, NULL); #else const char *const full_ld_suffix = ld_suffix; + const char *const full_gold_suffix = gold_suffix; + const char *const full_bfd_ld_suffix = bfd_ld_suffix; const char *const full_nm_suffix = nm_suffix; const char *const full_gnm_suffix = gnm_suffix; #ifdef LDD_SUFFIX @@ -818,6 +826,13 @@ main (int argc, char **argv) const char **c_ptr; char **ld1_argv; const char **ld1; + enum linker_select + { + DEF_LINKER, + GOLD_LINKER, + BFD_LINKER + } selected_linker = DEF_LINKER; + char **ld2_argv; const char **ld2; char **object_lst; @@ -875,6 +890,10 @@ main (int argc, char **argv) { if (! strcmp (argv[i], "-debug")) debug = 1; + else if (! strcmp (argv[i], "-use-gold")) + selected_linker = GOLD_LINKER; + else if (! strcmp (argv[i], "-use-ld")) + selected_linker = BFD_LINKER; } vflag = debug; } @@ -954,12 +973,80 @@ main (int argc, char **argv) ld_file_name = find_a_file (&cpath, collect_ld_suffix); /* Search the compiler directories for `ld'. We have protection against recursive calls in find_a_file. */ - if (ld_file_name == 0) - ld_file_name = find_a_file (&cpath, ld_suffix); + if (ld_file_name == NULL) + switch (selected_linker) + { + default: + case DEF_LINKER: + ld_file_name = find_a_file (&cpath, ld_suffix); + break; + case GOLD_LINKER: + ld_file_name = find_a_file (&cpath, gold_suffix); + break; + case BFD_LINKER: + ld_file_name = find_a_file (&cpath, bfd_ld_suffix); + break; + } /* Search the ordinary system bin directories for `ld' (if native linking) or `TARGET-ld' (if cross). */ - if (ld_file_name == 0) - ld_file_name = find_a_file (&path, full_ld_suffix); + if (ld_file_name == NULL) + switch (selected_linker) + { + default: + case DEF_LINKER: + ld_file_name = find_a_file (&path, full_ld_suffix); + break; + case GOLD_LINKER: + ld_file_name = find_a_file (&path, full_gold_suffix); + break; + case BFD_LINKER: + ld_file_name = find_a_file (&path, full_bfd_ld_suffix); + break; + } + + if ((vflag || debug) && ld_file_name == NULL) + { + struct prefix_list * p; + const char * s; + + notice ("collect2: warning: unable to find linker.\n"); + +#ifdef DEFAULT_LINKER + notice (" Searched for this absolute executable:\n"); + notice (" %s\n", DEFAULT_LINKER); +#endif + + notice (" Searched in these paths:\n"); + for (p = cpath.plist; p != NULL; p = p->next) + notice (" %s\n", p->prefix); + notice (" For these executables:\n"); + notice (" %s\n", real_ld_suffix); + notice (" %s\n", collect_ld_suffix); + switch (selected_linker) + { + default: + case DEF_LINKER: s = ld_suffix; break; + case GOLD_LINKER: s = gold_suffix; break; + case BFD_LINKER: s = bfd_ld_suffix; break; + } + notice (" %s\n", s); + + notice (" And searched in these paths:\n"); + for (p = path.plist; p != NULL; p = p->next) + notice (" %s\n", p->prefix); + notice (" For these executables:\n"); +#ifdef REAL_LD_FILE_NAME + notice (" %s\n", REAL_LD_FILE_NAME); +#endif + switch (selected_linker) + { + default: + case DEF_LINKER: s = full_ld_suffix; break; + case GOLD_LINKER: s = full_gold_suffix; break; + case BFD_LINKER: s = full_bfd_ld_suffix; break; + } + notice (" %s\n", s); + } #ifdef REAL_NM_FILE_NAME nm_file_name = find_a_file (&path, REAL_NM_FILE_NAME); diff --git a/gcc-4.4.0/gcc/common.opt b/gcc-4.4.0/gcc/common.opt index 7fe65fe39..973247991 100644 --- a/gcc-4.4.0/gcc/common.opt +++ b/gcc-4.4.0/gcc/common.opt @@ -1403,6 +1403,9 @@ funwind-tables Common Report Var(flag_unwind_tables) Optimization Just generate unwind tables for exception handling +fuse-ld= +Common Joined Undocumented + fvar-tracking Common Report Var(flag_var_tracking) VarExists Optimization Perform variable tracking diff --git a/gcc-4.4.0/gcc/configure b/gcc-4.4.0/gcc/configure index 170d4011f..de99123ff 100755 --- a/gcc-4.4.0/gcc/configure +++ b/gcc-4.4.0/gcc/configure @@ -458,7 +458,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared NATIVE_SYSTEM_HEADER_DIR RUNTIME_ROOT_PREFIX_DEFINE TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN OBJDUMP ac_ct_OBJDUMP ac_ct_AR STRIP ac_ct_STRIP lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump gcc_cv_readelf libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs fortran_target_objs target_cpu_default GMPLIBS GMPINC PPLLIBS PPLINC CLOOGLIBS CLOOGINC pluginlibs enable_plugin LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared NATIVE_SYSTEM_HEADER_DIR RUNTIME_ROOT_PREFIX_DEFINE TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN OBJDUMP ac_ct_OBJDUMP ac_ct_AR STRIP ac_ct_STRIP lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET ORIGINAL_GOLD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump gcc_cv_readelf libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs fortran_target_objs target_cpu_default GMPLIBS GMPINC PPLLIBS PPLINC CLOOGLIBS CLOOGINC pluginlibs enable_plugin LIBOBJS LTLIBOBJS' ac_subst_files='language_hooks' ac_pwd=`pwd` @@ -20892,6 +20892,22 @@ fi fi +gcc_cv_ld_gold_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gold + +if test "${gcc_cv_gold+set}" = set; then + : +else + +if test -f $gcc_cv_ld_gold_srcdir/configure.ac \ + && test -f ../gold/Makefile \ + && test x$build = x$host; then + gcc_cv_gold=../gold/ld-new$build_exeext +else + gcc_cv_gold='' +fi +fi + + # Check to see if we are using gold instead of ld echo "$as_me:$LINENO: checking whether we are using gold" >&5 echo $ECHO_N "checking whether we are using gold... $ECHO_C" >&6 @@ -20913,6 +20929,9 @@ case "$ORIGINAL_LD_FOR_TARGET" in ;; esac +ORIGINAL_GOLD_FOR_TARGET=$gcc_cv_gold + + echo "$as_me:$LINENO: checking what linker to use" >&5 echo $ECHO_N "checking what linker to use... $ECHO_C" >&6 if test "$gcc_cv_ld" = ../ld/ld-new$build_exeext; then @@ -25993,6 +26012,7 @@ s,@gcc_cv_as@,$gcc_cv_as,;t t s,@ORIGINAL_AS_FOR_TARGET@,$ORIGINAL_AS_FOR_TARGET,;t t s,@gcc_cv_ld@,$gcc_cv_ld,;t t s,@ORIGINAL_LD_FOR_TARGET@,$ORIGINAL_LD_FOR_TARGET,;t t +s,@ORIGINAL_GOLD_FOR_TARGET@,$ORIGINAL_GOLD_FOR_TARGET,;t t s,@gcc_cv_nm@,$gcc_cv_nm,;t t s,@ORIGINAL_NM_FOR_TARGET@,$ORIGINAL_NM_FOR_TARGET,;t t s,@gcc_cv_objdump@,$gcc_cv_objdump,;t t diff --git a/gcc-4.4.0/gcc/configure.ac b/gcc-4.4.0/gcc/configure.ac index a2204be06..79926d1bb 100644 --- a/gcc-4.4.0/gcc/configure.ac +++ b/gcc-4.4.0/gcc/configure.ac @@ -1969,6 +1969,17 @@ else AC_PATH_PROG(gcc_cv_ld, $LD_FOR_TARGET) fi]) +gcc_cv_ld_gold_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gold + +AS_VAR_SET_IF(gcc_cv_gold,, [ +if test -f $gcc_cv_ld_gold_srcdir/configure.ac \ + && test -f ../gold/Makefile \ + && test x$build = x$host; then + gcc_cv_gold=../gold/ld-new$build_exeext +else + gcc_cv_gold='' +fi]) + # Check to see if we are using gold instead of ld AC_MSG_CHECKING(whether we are using gold) ld_is_gold=no @@ -1987,6 +1998,9 @@ case "$ORIGINAL_LD_FOR_TARGET" in *) AC_CONFIG_FILES(collect-ld:exec-tool.in, [chmod +x collect-ld]) ;; esac +ORIGINAL_GOLD_FOR_TARGET=$gcc_cv_gold +AC_SUBST(ORIGINAL_GOLD_FOR_TARGET) + AC_MSG_CHECKING(what linker to use) if test "$gcc_cv_ld" = ../ld/ld-new$build_exeext; then # Single tree build which includes ld. We want to prefer it diff --git a/gcc-4.4.0/gcc/doc/invoke.texi b/gcc-4.4.0/gcc/doc/invoke.texi index 3c834f542..4be05d4de 100644 --- a/gcc-4.4.0/gcc/doc/invoke.texi +++ b/gcc-4.4.0/gcc/doc/invoke.texi @@ -380,7 +380,7 @@ Objective-C and Objective-C++ Dialects}. -funit-at-a-time -funroll-all-loops -funroll-loops @gol -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol --fwhole-program @gol +-fwhole-program -fuse-ld @gol --param @var{name}=@var{value} -O -O0 -O1 -O2 -O3 -Os} @@ -6779,6 +6779,16 @@ compilation unit, not for the single source file itself. This option is not supported for Fortran programs. +@item -fuse-ld=gold +Use the @command{ld.gold} linker instead of the default linker. +This option is only necessary if GCC has been configured with +@option{--enable-gold=both} or @option{--enable-gold=both/ld}. + +@item -fuse-ld=bfd +Use the @command{ld.bfd} linker instead of the default linker. +This option is only necessary if GCC has been configured with +@option{--enable-gold=both/gold}. + @item -fcprop-registers @opindex fcprop-registers After register allocation and post-register allocation instruction splitting, diff --git a/gcc-4.4.0/gcc/exec-tool.in b/gcc-4.4.0/gcc/exec-tool.in index f58516340..65670e6a9 100644 --- a/gcc-4.4.0/gcc/exec-tool.in +++ b/gcc-4.4.0/gcc/exec-tool.in @@ -1,6 +1,6 @@ #! /bin/sh -# Copyright (C) 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2007, 2008, 2010 Free Software Foundation, Inc. # This file is part of GCC. # GCC is free software; you can redistribute it and/or modify @@ -21,10 +21,12 @@ ORIGINAL_AS_FOR_TARGET="@ORIGINAL_AS_FOR_TARGET@" ORIGINAL_LD_FOR_TARGET="@ORIGINAL_LD_FOR_TARGET@" +ORIGINAL_GOLD_FOR_TARGET="@ORIGINAL_GOLD_FOR_TARGET@" ORIGINAL_NM_FOR_TARGET="@ORIGINAL_NM_FOR_TARGET@" exeext=@host_exeext@ fast_install=@enable_fast_install@ objdir=@objdir@ +version="1.1" invoked=`basename "$0"` case "$invoked" in @@ -33,48 +35,103 @@ case "$invoked" in prog=as-new$exeext dir=gas ;; - collect-ld) - original=$ORIGINAL_LD_FOR_TARGET - prog=ld-new$exeext - dir=ld - ;; nm) original=$ORIGINAL_NM_FOR_TARGET prog=nm-new$exeext dir=binutils ;; + collect-ld) + prog=ld-new$exeext + # Look for the a command line option + # specifying the linker to be used. + case " $* " in + *\ -use-gold\ *) + original=$ORIGINAL_GOLD_FOR_TARGET + dir=gold + ;; + *\ -use-ld\ * | *\ -use-ld.bfd\ *) + original=$ORIGINAL_LD_FOR_TARGET + dir=ld + ;; + *) + original=$ORIGINAL_LD_FOR_TARGET + dir=ld + ;; + esac + + # If the selected linker has not been configured then + # try using the others, in the order LD, GOLD. + if test x"$original" = x; then + if test x"$ORIGINAL_LD_FOR_TARGET" != x; then + original=$ORIGINAL_LD_FOR_TARGET + dir=ld + elif test x"$ORIGINAL_GOLD_FOR_TARGET" != x; then + original=$ORIGINAL_GOLD_FOR_TARGET + dir=gold + # Otherwise do nothing - the case statement below + # will issue an error message for us. + fi + fi + ;; esac case "$original" in ../*) - # compute absolute path of the location of this script + # Compute absolute path to the location of this script. tdir=`dirname "$0"` scriptdir=`cd "$tdir" && pwd` if test -x $scriptdir/../$dir/$prog; then - test "$fast_install" = yes || exec $scriptdir/../$dir/$prog ${1+"$@"} - - # if libtool did everything it needs to do, there's a fast path - lt_prog=$scriptdir/../$dir/$objdir/lt-$prog - test -x $lt_prog && exec $lt_prog ${1+"$@"} - - # libtool has not relinked ld-new yet, but we cannot just use the - # previous stage (because then the relinking would just never happen!). - # So we take extra care to use prev-ld/ld-new *on recursive calls*. - test x"$LT_RCU" = x"1" && exec $scriptdir/../prev-$dir/$prog ${1+"$@"} - - LT_RCU=1; export LT_RCU - $scriptdir/../$dir/$prog ${1+"$@"} - result=$? - exit $result + if test "$fast_install" = yes; then + # If libtool did everything it needs to do, there's a fast path. + lt_prog=$scriptdir/../$dir/$objdir/lt-$prog + if test -x $lt_prog; then + original=$lt_prog + else + # Libtool has not relinked ld-new yet, but we cannot just use the + # previous stage (because then the relinking would just never happen!). + # So we take extra care to use prev-ld/ld-new *on recursive calls*. + if test x"$LT_RCU" = x"1"; then + original=$scriptdir/../prev-$dir/$prog + else + LT_RCU=1; export LT_RCU + case " $* " in + *\ -v\ *) + echo "$invoked $version" + echo $scriptdir/../$dir/$prog $* + ;; + esac + $scriptdir/../$dir/$prog ${1+"$@"} + result=$? + exit $result + fi + fi + else + original=$scriptdir/../$dir/$prog + fi else - exec $scriptdir/../prev-$dir/$prog ${1+"$@"} + original=$scriptdir/../prev-$dir/$prog fi ;; - *) - exec "$original" ${1+"$@"} + "") + echo "$invoked: executable not configured" + exit 1 ;; esac +# If -v has been used then display our version number +# and then echo the command we are about to invoke. +case " $* " in + *\ -v\ *) + echo "$invoked $version" + echo $original $* + ;; +esac +if test -x $original; then + exec "$original" ${1+"$@"} +else + echo "$invoked: unable to locate executable: $original" + exit 1 +fi diff --git a/gcc-4.4.0/gcc/gcc.c b/gcc-4.4.0/gcc/gcc.c index 29143d838..e097e5c1c 100644 --- a/gcc-4.4.0/gcc/gcc.c +++ b/gcc-4.4.0/gcc/gcc.c @@ -737,7 +737,11 @@ proper position among the other output files. */ #ifndef LINK_COMMAND_SPEC #define LINK_COMMAND_SPEC "\ %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ - %(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\ + %(linker) %l " LINK_PIE_SPEC \ + "%{fuse-ld=gold:%{fuse-ld=bfd:%e-fuse-ld=gold and -fuse-ld=bfd may not be used together}} \ + %{fuse-ld=gold:-use-gold} \ + %{fuse-ld=bfd:-use-ld}" \ + "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\ %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\ %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)} %(mflib)\ diff --git a/gcc-4.4.0/gcc/ira-conflicts.c b/gcc-4.4.0/gcc/ira-conflicts.c index 05870ab4b..0d8555095 100644 --- a/gcc-4.4.0/gcc/ira-conflicts.c +++ b/gcc-4.4.0/gcc/ira-conflicts.c @@ -806,7 +806,7 @@ ira_build_conflicts (void) if ((! flag_caller_saves && ALLOCNO_CALLS_CROSSED_NUM (a) != 0) /* For debugging purposes don't put user defined variables in callee-clobbered registers. */ - || (optimize <= 1 + || (optimize == 0 && (attrs = REG_ATTRS (regno_reg_rtx [ALLOCNO_REGNO (a)])) != NULL && (decl = attrs->decl) != NULL && VAR_OR_FUNCTION_DECL_P (decl) diff --git a/gcc-4.4.0/gcc/opts.c b/gcc-4.4.0/gcc/opts.c index f20b65568..1979b2676 100644 --- a/gcc-4.4.0/gcc/opts.c +++ b/gcc-4.4.0/gcc/opts.c @@ -2179,6 +2179,10 @@ common_handle_option (size_t scode, const char *arg, int value, /* These are no-ops, preserved for backward compatibility. */ break; + case OPT_fuse_ld_: + /* No-op. Used by the driver and passed to us because it starts with f. */ + break; + default: /* If the flag was handled in a standard way, assume the lack of processing here is intentional. */ -- cgit v1.2.3