diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2011-05-30 08:45:07 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2011-05-30 08:45:07 +0000 |
commit | df33b41f117cd769424e9f0d5a393c9d714f189d (patch) | |
tree | 47425d4cc0a90c02e0447d3269a2f925ba49c9f1 /gcc | |
parent | 69940d4d9e914bfda0650a0771e916754dceb573 (diff) | |
download | gcc-df33b41f117cd769424e9f0d5a393c9d714f189d.zip gcc-df33b41f117cd769424e9f0d5a393c9d714f189d.tar.gz gcc-df33b41f117cd769424e9f0d5a393c9d714f189d.tar.bz2 |
configure.ac (gcc_cv_lto_plugin): Determine lto plugin support from plugin linker.
* configure.ac (gcc_cv_lto_plugin): Determine lto plugin support
from plugin linker.
* configure: Regenerate.
From-SVN: r174426
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rwxr-xr-x | gcc/configure | 45 | ||||
-rw-r--r-- | gcc/configure.ac | 47 |
3 files changed, 78 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c771214..3f4ec0b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-05-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * configure.ac (gcc_cv_lto_plugin): Determine lto plugin support + from plugin linker. + * configure: Regenerate. + 2011-05-30 Ira Rosen <ira.rosen@linaro.org> PR tree-optimization/49199 diff --git a/gcc/configure b/gcc/configure index 0873e98..a373518 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 diff --git a/gcc/configure.ac b/gcc/configure.ac index dbc825a..5e41479 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3249,14 +3249,40 @@ fi AC_MSG_CHECKING(linker plugin support) 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. +changequote(,)dnl + 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 +changequote([,])dnl + 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 @@ -3264,11 +3290,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 AC_DEFINE_UNQUOTED(HAVE_LTO_PLUGIN, $gcc_cv_lto_plugin, [Define to the level of your linker's plugin support.]) |