Disable GCC LTO for verbose library extraction.

* libltdl/m4/libtool.m4 (_LT_SYS_HIDDEN_LIBDEPS): Temporarily
append -fno-lto or -fno-whopr to CFLAGS if CC or CFLAGS (which
are substituted with the per-language variables here) contain
-flto or match -fwhopr*, respectively.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
This commit is contained in:
Ralf Wildenhues 2010-08-29 17:30:19 +02:00
parent bf1d52eb53
commit ada610770b
2 changed files with 14 additions and 0 deletions

View File

@ -1,5 +1,11 @@
2010-08-29 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Disable GCC LTO for verbose library extraction.
* libltdl/m4/libtool.m4 (_LT_SYS_HIDDEN_LIBDEPS): Temporarily
append -fno-lto or -fno-whopr to CFLAGS if CC or CFLAGS (which
are substituted with the per-language variables here) contain
-flto or match -fwhopr*, respectively.
Save and restore CFLAGS properly inside libtool.m4 macros.
* libltdl/m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Use different
temporary variables for saved and restored values of $LIBS,

View File

@ -6832,6 +6832,13 @@ public class foo {
};
_LT_EOF
])
_lt_libdeps_save_CFLAGS=$CFLAGS
case "$CC $CFLAGS " in #(
*\ -flto\ *) CFLAGS="$CFLAGS -fno-lto" ;;
*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
esac
dnl Parse the compiler output and extract the necessary
dnl objects, libraries and library flags.
if AC_TRY_EVAL(ac_compile); then
@ -6925,6 +6932,7 @@ else
fi
$RM -f confest.$objext
CFLAGS=$_lt_libdeps_save_CFLAGS
# PORTME: override above test on systems where it is broken
m4_if([$1], [CXX],