From 3afdc8c964434c9469c78f015a68cea8c817261b Mon Sep 17 00:00:00 2001 From: bkoz Date: Fri, 20 Jan 2006 22:24:43 +0000 Subject: [PATCH] 2006-01-20 Benjamin Kosnik * acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Verbose ld version reporting. Disable --gc-sections for old binutils, by version. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110045 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 6 +++ libstdc++-v3/acinclude.m4 | 11 +++- libstdc++-v3/configure | 130 +++++++++++++++++++++++++++++++++++++++------- 3 files changed, 125 insertions(+), 22 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b88a3b6f7c9..4dd507c4055 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2006-01-20 Benjamin Kosnik + + * acinclude.m4 (GLIBCXX_CHECK_LINKER_FEATURES): Verbose ld version + reporting. Disable --gc-sections for old binutils, by version. + * configure: Regenerate. + 2006-01-20 Joseph S. Myers PR libstdc++/25524 diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index d0a5a6be7cf..aa68ac7abf2 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -222,16 +222,23 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [ # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. + AC_MSG_CHECKING([for ld version]) changequote(,) ldver=`$LD --version 2>/dev/null | head -1 | \ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'` changequote([,]) glibcxx_gnu_ld_version=`echo $ldver | \ $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'` + AC_MSG_RESULT($glibcxx_gnu_ld_version) # Set --gc-sections. - if test x"$with_gnu_ld" = x"yes"; then - # GNU ld it is! Joy and bunny rabbits! + glibcxx_gcsections_min_ld=21602 + if test x"$with_gnu_ld" = x"yes" && + test $glibcxx_gnu_ld_version -gt $glibcxx_gcsections_min_ld ; then + + # Sufficiently young GNU ld it is! Joy and bunny rabbits! + # NB: This flag only works reliably after 2.16.1. Configure tests + # for this are difficult, so hard wire a value that should work. # All these tests are for C++, but run with the "C" compiler driver. # Need to do this so that g++ won't try to link in libstdc++/libsupc++. diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 50b93619617..6131b9b67e9 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -8200,16 +8200,25 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. + echo "$as_me:$LINENO: checking for ld version" >&5 +echo $ECHO_N "checking for ld version... $ECHO_C" >&6 ldver=`$LD --version 2>/dev/null | head -1 | \ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'` glibcxx_gnu_ld_version=`echo $ldver | \ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'` + echo "$as_me:$LINENO: result: $glibcxx_gnu_ld_version" >&5 +echo "${ECHO_T}$glibcxx_gnu_ld_version" >&6 # Set --gc-sections. - if test x"$with_gnu_ld" = x"yes"; then - # GNU ld it is! Joy and bunny rabbits! + glibcxx_gcsections_min_ld=21602 + if test x"$with_gnu_ld" = x"yes" && + test $glibcxx_gnu_ld_version -gt $glibcxx_gcsections_min_ld ; then + + # Sufficiently young GNU ld it is! Joy and bunny rabbits! + # NB: This flag only works reliably after 2.16.1. Configure tests + # for this are difficult, so hard wire a value that should work. # All these tests are for C++, but run with the "C" compiler driver. # Need to do this so that g++ won't try to link in libstdc++/libsupc++. @@ -53058,16 +53067,25 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. + echo "$as_me:$LINENO: checking for ld version" >&5 +echo $ECHO_N "checking for ld version... $ECHO_C" >&6 ldver=`$LD --version 2>/dev/null | head -1 | \ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'` glibcxx_gnu_ld_version=`echo $ldver | \ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'` + echo "$as_me:$LINENO: result: $glibcxx_gnu_ld_version" >&5 +echo "${ECHO_T}$glibcxx_gnu_ld_version" >&6 # Set --gc-sections. - if test x"$with_gnu_ld" = x"yes"; then - # GNU ld it is! Joy and bunny rabbits! + glibcxx_gcsections_min_ld=21602 + if test x"$with_gnu_ld" = x"yes" && + test $glibcxx_gnu_ld_version -gt $glibcxx_gcsections_min_ld ; then + + # Sufficiently young GNU ld it is! Joy and bunny rabbits! + # NB: This flag only works reliably after 2.16.1. Configure tests + # for this are difficult, so hard wire a value that should work. # All these tests are for C++, but run with the "C" compiler driver. # Need to do this so that g++ won't try to link in libstdc++/libsupc++. @@ -74409,16 +74427,25 @@ done # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. + echo "$as_me:$LINENO: checking for ld version" >&5 +echo $ECHO_N "checking for ld version... $ECHO_C" >&6 ldver=`$LD --version 2>/dev/null | head -1 | \ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'` glibcxx_gnu_ld_version=`echo $ldver | \ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'` + echo "$as_me:$LINENO: result: $glibcxx_gnu_ld_version" >&5 +echo "${ECHO_T}$glibcxx_gnu_ld_version" >&6 # Set --gc-sections. - if test x"$with_gnu_ld" = x"yes"; then - # GNU ld it is! Joy and bunny rabbits! + glibcxx_gcsections_min_ld=21602 + if test x"$with_gnu_ld" = x"yes" && + test $glibcxx_gnu_ld_version -gt $glibcxx_gcsections_min_ld ; then + + # Sufficiently young GNU ld it is! Joy and bunny rabbits! + # NB: This flag only works reliably after 2.16.1. Configure tests + # for this are difficult, so hard wire a value that should work. # All these tests are for C++, but run with the "C" compiler driver. # Need to do this so that g++ won't try to link in libstdc++/libsupc++. @@ -75923,16 +75950,25 @@ done # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. + echo "$as_me:$LINENO: checking for ld version" >&5 +echo $ECHO_N "checking for ld version... $ECHO_C" >&6 ldver=`$LD --version 2>/dev/null | head -1 | \ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'` glibcxx_gnu_ld_version=`echo $ldver | \ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'` + echo "$as_me:$LINENO: result: $glibcxx_gnu_ld_version" >&5 +echo "${ECHO_T}$glibcxx_gnu_ld_version" >&6 # Set --gc-sections. - if test x"$with_gnu_ld" = x"yes"; then - # GNU ld it is! Joy and bunny rabbits! + glibcxx_gcsections_min_ld=21602 + if test x"$with_gnu_ld" = x"yes" && + test $glibcxx_gnu_ld_version -gt $glibcxx_gcsections_min_ld ; then + + # Sufficiently young GNU ld it is! Joy and bunny rabbits! + # NB: This flag only works reliably after 2.16.1. Configure tests + # for this are difficult, so hard wire a value that should work. # All these tests are for C++, but run with the "C" compiler driver. # Need to do this so that g++ won't try to link in libstdc++/libsupc++. @@ -77313,16 +77349,25 @@ done # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. + echo "$as_me:$LINENO: checking for ld version" >&5 +echo $ECHO_N "checking for ld version... $ECHO_C" >&6 ldver=`$LD --version 2>/dev/null | head -1 | \ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'` glibcxx_gnu_ld_version=`echo $ldver | \ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'` + echo "$as_me:$LINENO: result: $glibcxx_gnu_ld_version" >&5 +echo "${ECHO_T}$glibcxx_gnu_ld_version" >&6 # Set --gc-sections. - if test x"$with_gnu_ld" = x"yes"; then - # GNU ld it is! Joy and bunny rabbits! + glibcxx_gcsections_min_ld=21602 + if test x"$with_gnu_ld" = x"yes" && + test $glibcxx_gnu_ld_version -gt $glibcxx_gcsections_min_ld ; then + + # Sufficiently young GNU ld it is! Joy and bunny rabbits! + # NB: This flag only works reliably after 2.16.1. Configure tests + # for this are difficult, so hard wire a value that should work. # All these tests are for C++, but run with the "C" compiler driver. # Need to do this so that g++ won't try to link in libstdc++/libsupc++. @@ -79490,16 +79535,25 @@ done # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. + echo "$as_me:$LINENO: checking for ld version" >&5 +echo $ECHO_N "checking for ld version... $ECHO_C" >&6 ldver=`$LD --version 2>/dev/null | head -1 | \ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'` glibcxx_gnu_ld_version=`echo $ldver | \ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'` + echo "$as_me:$LINENO: result: $glibcxx_gnu_ld_version" >&5 +echo "${ECHO_T}$glibcxx_gnu_ld_version" >&6 # Set --gc-sections. - if test x"$with_gnu_ld" = x"yes"; then - # GNU ld it is! Joy and bunny rabbits! + glibcxx_gcsections_min_ld=21602 + if test x"$with_gnu_ld" = x"yes" && + test $glibcxx_gnu_ld_version -gt $glibcxx_gcsections_min_ld ; then + + # Sufficiently young GNU ld it is! Joy and bunny rabbits! + # NB: This flag only works reliably after 2.16.1. Configure tests + # for this are difficult, so hard wire a value that should work. # All these tests are for C++, but run with the "C" compiler driver. # Need to do this so that g++ won't try to link in libstdc++/libsupc++. @@ -80833,16 +80887,25 @@ done # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. + echo "$as_me:$LINENO: checking for ld version" >&5 +echo $ECHO_N "checking for ld version... $ECHO_C" >&6 ldver=`$LD --version 2>/dev/null | head -1 | \ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'` glibcxx_gnu_ld_version=`echo $ldver | \ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'` + echo "$as_me:$LINENO: result: $glibcxx_gnu_ld_version" >&5 +echo "${ECHO_T}$glibcxx_gnu_ld_version" >&6 # Set --gc-sections. - if test x"$with_gnu_ld" = x"yes"; then - # GNU ld it is! Joy and bunny rabbits! + glibcxx_gcsections_min_ld=21602 + if test x"$with_gnu_ld" = x"yes" && + test $glibcxx_gnu_ld_version -gt $glibcxx_gcsections_min_ld ; then + + # Sufficiently young GNU ld it is! Joy and bunny rabbits! + # NB: This flag only works reliably after 2.16.1. Configure tests + # for this are difficult, so hard wire a value that should work. # All these tests are for C++, but run with the "C" compiler driver. # Need to do this so that g++ won't try to link in libstdc++/libsupc++. @@ -82225,16 +82288,25 @@ done # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. + echo "$as_me:$LINENO: checking for ld version" >&5 +echo $ECHO_N "checking for ld version... $ECHO_C" >&6 ldver=`$LD --version 2>/dev/null | head -1 | \ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'` glibcxx_gnu_ld_version=`echo $ldver | \ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'` + echo "$as_me:$LINENO: result: $glibcxx_gnu_ld_version" >&5 +echo "${ECHO_T}$glibcxx_gnu_ld_version" >&6 # Set --gc-sections. - if test x"$with_gnu_ld" = x"yes"; then - # GNU ld it is! Joy and bunny rabbits! + glibcxx_gcsections_min_ld=21602 + if test x"$with_gnu_ld" = x"yes" && + test $glibcxx_gnu_ld_version -gt $glibcxx_gcsections_min_ld ; then + + # Sufficiently young GNU ld it is! Joy and bunny rabbits! + # NB: This flag only works reliably after 2.16.1. Configure tests + # for this are difficult, so hard wire a value that should work. # All these tests are for C++, but run with the "C" compiler driver. # Need to do this so that g++ won't try to link in libstdc++/libsupc++. @@ -84009,16 +84081,25 @@ echo "${ECHO_T}$glibcxx_cv_WRITEV" >&6 # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. + echo "$as_me:$LINENO: checking for ld version" >&5 +echo $ECHO_N "checking for ld version... $ECHO_C" >&6 ldver=`$LD --version 2>/dev/null | head -1 | \ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'` glibcxx_gnu_ld_version=`echo $ldver | \ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'` + echo "$as_me:$LINENO: result: $glibcxx_gnu_ld_version" >&5 +echo "${ECHO_T}$glibcxx_gnu_ld_version" >&6 # Set --gc-sections. - if test x"$with_gnu_ld" = x"yes"; then - # GNU ld it is! Joy and bunny rabbits! + glibcxx_gcsections_min_ld=21602 + if test x"$with_gnu_ld" = x"yes" && + test $glibcxx_gnu_ld_version -gt $glibcxx_gcsections_min_ld ; then + + # Sufficiently young GNU ld it is! Joy and bunny rabbits! + # NB: This flag only works reliably after 2.16.1. Configure tests + # for this are difficult, so hard wire a value that should work. # All these tests are for C++, but run with the "C" compiler driver. # Need to do this so that g++ won't try to link in libstdc++/libsupc++. @@ -86114,16 +86195,25 @@ done # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. + echo "$as_me:$LINENO: checking for ld version" >&5 +echo $ECHO_N "checking for ld version... $ECHO_C" >&6 ldver=`$LD --version 2>/dev/null | head -1 | \ sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'` glibcxx_gnu_ld_version=`echo $ldver | \ $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'` + echo "$as_me:$LINENO: result: $glibcxx_gnu_ld_version" >&5 +echo "${ECHO_T}$glibcxx_gnu_ld_version" >&6 # Set --gc-sections. - if test x"$with_gnu_ld" = x"yes"; then - # GNU ld it is! Joy and bunny rabbits! + glibcxx_gcsections_min_ld=21602 + if test x"$with_gnu_ld" = x"yes" && + test $glibcxx_gnu_ld_version -gt $glibcxx_gcsections_min_ld ; then + + # Sufficiently young GNU ld it is! Joy and bunny rabbits! + # NB: This flag only works reliably after 2.16.1. Configure tests + # for this are difficult, so hard wire a value that should work. # All these tests are for C++, but run with the "C" compiler driver. # Need to do this so that g++ won't try to link in libstdc++/libsupc++. -- 2.11.0