From c2ce8e079cbd1eec478b9f1c5d3ad9f9ac62ac39 Mon Sep 17 00:00:00 2001 From: dougkwan Date: Thu, 8 Apr 2010 08:41:50 +0000 Subject: [PATCH] 2010-04-07 Doug Kwan * configure.ac: Recognize gold and do not use its version number to test ld features. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158106 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/configure | 21 +++++++++++++++++++-- gcc/configure.ac | 19 +++++++++++++++++-- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fc4a4a9f0d2..4eae83ac74a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-04-08 Doug Kwan + + * configure.ac: Recognize gold and do not use its version number + to test ld features. + * configure: Regenerate. + 2010-04-08 Maxim Kuvyrkov PR middle-end/40815 diff --git a/gcc/configure b/gcc/configure index 2e022ed3ae5..c3ff39c7d32 100755 --- a/gcc/configure +++ b/gcc/configure @@ -20609,6 +20609,19 @@ cat >>confdefs.h <<_ACEOF _ACEOF +# Check to see if we are using gold instead of ld +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using gold" >&5 +$as_echo_n "checking whether we are using gold... " >&6; } +ld_is_gold=no +if test x$gcc_cv_ld != x; then + if $gcc_cv_ld --version 2>/dev/null | sed 1q \ + | grep "GNU gold" > /dev/null; then + ld_is_gold=yes + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_is_gold" >&5 +$as_echo "$ld_is_gold" >&6; } + ORIGINAL_LD_FOR_TARGET=$gcc_cv_ld case "$ORIGINAL_LD_FOR_TARGET" in @@ -21188,7 +21201,9 @@ $as_echo "$gcc_cv_as_hidden" >&6; } if test $in_tree_ld != yes ; then ld_ver=`$gcc_cv_ld --version 2>/dev/null | sed 1q` - if echo "$ld_ver" | grep GNU > /dev/null; then + if test x"$ld_is_gold" = xyes; then + gcc_cv_ld_hidden=yes + elif echo "$ld_ver" | grep GNU > /dev/null; then ld_vers=`echo $ld_ver | sed -n \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p'` ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'` @@ -21785,7 +21800,9 @@ fi $as_echo "$gcc_cv_as_comdat_group_percent" >&6; } fi -if test $in_tree_ld = yes ; then +if test x"$ld_is_gold" = xyes; then + comdat_group=yes +elif test $in_tree_ld = yes ; then comdat_group=no if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \ && test $in_tree_ld_is_elf = yes; then diff --git a/gcc/configure.ac b/gcc/configure.ac index ac4ca7064d8..ea1a0405e90 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1934,6 +1934,17 @@ AC_ARG_WITH(plugin-ld, AC_SUBST(ORIGINAL_PLUGIN_LD_FOR_TARGET) AC_DEFINE_UNQUOTED(PLUGIN_LD, "$PLUGIN_LD", [Specify plugin linker]) +# Check to see if we are using gold instead of ld +AC_MSG_CHECKING(whether we are using gold) +ld_is_gold=no +if test x$gcc_cv_ld != x; then + if $gcc_cv_ld --version 2>/dev/null | sed 1q \ + | grep "GNU gold" > /dev/null; then + ld_is_gold=yes + fi +fi +AC_MSG_RESULT($ld_is_gold) + ORIGINAL_LD_FOR_TARGET=$gcc_cv_ld AC_SUBST(ORIGINAL_LD_FOR_TARGET) case "$ORIGINAL_LD_FOR_TARGET" in @@ -2122,7 +2133,9 @@ foobar:]) changequote(,)dnl if test $in_tree_ld != yes ; then ld_ver=`$gcc_cv_ld --version 2>/dev/null | sed 1q` - if echo "$ld_ver" | grep GNU > /dev/null; then + if test x"$ld_is_gold" = xyes; then + gcc_cv_ld_hidden=yes + elif echo "$ld_ver" | grep GNU > /dev/null; then ld_vers=`echo $ld_ver | sed -n \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p'` ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'` @@ -2441,7 +2454,9 @@ else [elf,2,16,0], [--fatal-warnings], [.section .text,"axG",%progbits,.foo,comdat]) fi -if test $in_tree_ld = yes ; then +if test x"$ld_is_gold" = xyes; then + comdat_group=yes +elif test $in_tree_ld = yes ; then comdat_group=no if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \ && test $in_tree_ld_is_elf = yes; then -- 2.11.0