libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/3] Disable GCC LTO for verbose library extraction.


From: Ralf Wildenhues
Subject: [PATCH 2/3] Disable GCC LTO for verbose library extraction.
Date: Sun, 29 Aug 2010 18:19:03 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

* 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 <address@hidden>
---
 ChangeLog             |    6 ++++++
 libltdl/m4/libtool.m4 |    8 ++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6421def..f7e2943 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2010-08-29  Ralf Wildenhues  <address@hidden>
 
+       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 ffe20db..0a5f5b1 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],
-- 
1.7.2.1.222.g9988




reply via email to

[Prev in Thread] Current Thread [Next in Thread]