[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: wrong postdep_objects for CXX when using "-flto -fuse-linker-plugin"
From: |
Brice De Bruyne |
Subject: |
Re: wrong postdep_objects for CXX when using "-flto -fuse-linker-plugin" |
Date: |
Sat, 04 Dec 2010 16:17:25 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.9.2.11) Gecko/20101013 Lightning/1.0b2 Thunderbird/3.1.5 |
Hi,
It seems the postdep_objects are set wrong when CXXFLAGS contains
"-fuse-linker-plugin".
CFLAGS don't matter it seems...
Following patch to libltdl/m4/libtool.m4 and then running ./bootstrap
fixes this problem:
--- libtool-2.4.1a/libltdl/m4/libtool.m4 2010-11-16
11:10:09.000000000 +0100
+++ libtool-2.4.1a-1/libltdl/m4/libtool.m4 2010-12-04
16:07:53.628086809 +0100
@@ -6900,9 +6900,16 @@
])
_lt_libdeps_save_CFLAGS=$CFLAGS
+_lt_libdeps_save_CXXFLAGS=$CXXFLAGS
case "$CC $CFLAGS " in #(
*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+case "$CC $CXXFLAGS " in #(
+*\ -flto*\ *) CXXFLAGS="$CXXFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CXXFLAGS="$CXXFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CXXFLAGS="$CXXFLAGS -fno-use-linker-plugin" ;;
esac
dnl Parse the compiler output and extract the necessary
@@ -7000,6 +7007,7 @@
$RM -f confest.$objext
CFLAGS=$_lt_libdeps_save_CFLAGS
+CXXFLAGS=$_lt_libdeps_save_CXXFLAGS
# PORTME: override above test on systems where it is broken
m4_if([$1], [CXX],
On 04-12-10 15:40, Brice De Bruyne wrote:
Hi,
The configure-script seems to misconfigure the postdep_objects_CXX
when CFLAGS contains "-flto -fuse-linker-plugin" (using
binutils-2.21.51.0.1 and gcc-4.6-20101127):
eg (libtool-2.4.1a):
CFLAGS="-flto -fuse-linker-plugin" CXXFLAGS="-flto
-fuse-linker-plugin" ./configure && grep postdep_objects libtool
postdep_objects="/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/crtendS.o
/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../crtn.o
/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../crti.o
/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/crtbeginS.o
/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/crtendS.o
/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../crtn.o"
instead of:
postdep_objects="/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/crtendS.o
/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../crtn.o"
This does not happen when only -flto or only -fuse-linker-plugin is in
CFLAGS, it only happens when they are both in CFLAGS...
I suppose the error comes from the check in libtool.m4....
Thanks for looking in to this!
Brice
libtool-2.4.1a-linker_plugin.patch
Description: Text document