bug-libtool
[Top][All Lists]
Advanced

[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: Ralf Wildenhues
Subject: Re: wrong postdep_objects for CXX when using "-flto -fuse-linker-plugin"
Date: Sun, 5 Dec 2010 21:47:54 +0100
User-agent: Mutt/1.5.20 (2010-08-04)

Hi Brice,

* Brice De Bruyne wrote on Sat, Dec 04, 2010 at 04:17:25PM CET:
> 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:

CXXFLAGS shouldn't matter here, if it does then that is a bug.
The idea is that this code is language-independent by letting
the calling macro do, roughly
  save_CC=$CC
  save_CFLAGS=$CFLAGS
  CC=$CXX               # or $F77, or $FC, or ...
  CFLAGS=$CXXFLAGS      # or $FFLAGS ...
  ... test code
  CC=$save_CC
  CFLAGS=$save_CFLAGS

Please check that your change also works without adjusting $CXX*
variables.  Also, ideally you'd write a ChangeLog and NEWS entry for the
patch, too, but otherwise we can do that too.

Thanks,
Ralf

> --- 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],



reply via email to

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