diff options
author | ro <ro@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-30 08:45:07 +0000 |
---|---|---|
committer | ro <ro@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-30 08:45:07 +0000 |
commit | 1dc619a191a92d85c598859c9dd62844080d9874 (patch) | |
tree | 47425d4cc0a90c02e0447d3269a2f925ba49c9f1 /gcc/configure | |
parent | eb3a666edb518c77594417785c1fa98aefd5755e (diff) | |
download | gcc-1dc619a191a92d85c598859c9dd62844080d9874.tar.gz |
* configure.ac (gcc_cv_lto_plugin): Determine lto plugin support
from plugin linker.
* configure: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174426 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/configure')
-rwxr-xr-x | gcc/configure | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/gcc/configure b/gcc/configure index 0873e98212c..a3735188280 100755 --- a/gcc/configure +++ b/gcc/configure @@ -23206,14 +23206,38 @@ fi $as_echo_n "checking linker plugin support... " >&6; } gcc_cv_lto_plugin=0 if test -f liblto_plugin.la; then - if test $in_tree_ld = yes -a x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" = x"$gcc_cv_ld"; then - if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o "$gcc_cv_gld_major_version" -gt 2; then - gcc_cv_lto_plugin=2 - elif test "$ld_is_gold" = yes -a "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -eq 20; then - gcc_cv_lto_plugin=1 + save_ld_ver="$ld_ver" + save_ld_vers_major="$ld_vers_major" + save_ld_vers_minor="$ld_vers_minor" + save_ld_is_gold="$ld_is_gold" + + ld_is_gold=no + if test $in_tree_ld = yes -a x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" = x"$gcc_cv_ld"; then + ld_ver="GNU ld" + # FIXME: ld_is_gold? + ld_vers_major="$gcc_cv_gld_major_version" + ld_vers_minor="$gcc_cv_gld_minor_version" + else + # Determine plugin linker version. + # FIXME: Partial duplicate from above, generalize. + ld_ver=`$ORIGINAL_PLUGIN_LD_FOR_TARGET --version 2>/dev/null | sed 1q` + if echo "$ld_ver" | grep GNU > /dev/null; then + if echo "$ld_ver" | grep "GNU gold" > /dev/null; then + ld_is_gold=yes + ld_vers=`echo $ld_ver | sed -n \ + -e 's,^[^)]*[ ]\([0-9][0-9]*\.[0-9][0-9]*[^)]*\)) .*$,\1,p'` + else + ld_vers=`echo $ld_ver | sed -n \ + -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p'` + fi + ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'` + ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'` fi - elif test x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" = x"$gcc_cv_ld" && echo "$ld_ver" | grep GNU > /dev/null; then + fi + + # Determine plugin support. + if echo "$ld_ver" | grep GNU > /dev/null; then # Require GNU ld or gold 2.21+ for plugin support by default. if test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -ge 21; then gcc_cv_lto_plugin=2 @@ -23221,11 +23245,12 @@ if test -f liblto_plugin.la; then elif test "$ld_is_gold" = yes -a "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -eq 20; then gcc_cv_lto_plugin=1 fi - elif test x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" != x"$gcc_cv_ld"; then - # Allow -fuse-linker-plugin if plugin linker differs from - # default/specified linker. - gcc_cv_lto_plugin=1 fi + + ld_ver="$save_ld_ver" + ld_vers_major="$save_ld_vers_major" + ld_vers_minor="$save_ld_vers_minor" + ld_is_gold="$save_ld_is_gold" fi cat >>confdefs.h <<_ACEOF |