From ada610770b6a30fcf8b22cd875c2002183765c4f Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sun, 29 Aug 2010 17:30:19 +0200 Subject: [PATCH] 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 --- ChangeLog | 6 ++++++ libltdl/m4/libtool.m4 | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6421defd..f7e29435 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-08-29 Ralf Wildenhues + 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, diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index ffe20db3..0a5f5b13 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -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],