Re: Passing flags with mode=link

2014-05-16 Thread Peter Rosin
On 2014-04-17 21:38, Evgeny Grin wrote:
> Hi,
> 
> I spend a few hours before I realized that libtool did not pass to linker 
> flags other than -L -l -Wl, and -Xlinker. It's totally confusing as in 
> compile mode libtool pass all flags to compiler.
> Currently there are no way to pass flags like -static-libgcc to linker except 
> editing makefile/configure.
> Common way of setting required flags by setting LDFLAGS before configure 
> didn't work because simple flag "-static-libgcc" will be ignored by libtool 
> and flag "-XCClinker -static-libgcc" will cause configure fail on GCC tests.
> Moreover, currently many configure tests can be incorrect as configure test 
> pure GCC/linker with LDFLAGS (and some flags can modify GCC/linker results) 
> but during "make" stage libtool filter many linker flags and linker works not 
> as configure expect.
> I suggest to pass all flags to linker, as in compile mode.

This is an FAQ:

http://www.gnu.org/software/libtool/manual/libtool.html#FAQ

Cheers,
Peter


___
https://lists.gnu.org/mailman/listinfo/libtool


Re: Libtool and ASAN

2014-05-16 Thread Peter Rosin
Hi!

On 2014-04-28 17:45, Akim Demaille wrote:
> I'm trying to use -fsanitize=address on OS X using MacPorts' Clang++ 3.5.
> The project consists of C++ libraries, on top of which is built a Python
> module (with a thin C++ layer which needs to be compiled).  Libtool
> (2.4.2 - the name of a fine belgian band of electronic music btw)
> is used in all layers.
> 
> To enable ASAN, I add '-fsanitize=address' to my CXXFLAGS.  It works well
> except for the C++ part of the Python module:

*snip*

> What matters here is that -fsanitize=address is dropped, it is
> not passed to the linker.  And I really need it:

*snap*

> I have to use -Wc to force Libtool to pass it to the compiler used
> to link (I must not use -Wl, because then it is passed to the linker
> invoked by the compiler, and the linker rejects -fsanitize).

*snep*

> My other libraries, which are not modules, are linked properly though.
> For instance (the only relevant part is that -fsanitize is not stripped
> from the command passed to the linker):

This part I don't understand, is there perhaps a -fsanitize in one of the
dependent .la files?

*snyp*

> So what should I do?  Am I doing something wrong?  I'd like to avoid
> having to teach my package to configure itself with ASAN and the others,
> it should remain only a question of passing appropriate CXXFLAGS
> and other LDFLAGS to configure.
> 
> Why does libtool strip these -f?  I could not find any instruction
> about this in the documentation.
> 
> Thanks for reading (the English parts of this message :)!

This last part is an FAQ:

http://www.gnu.org/software/libtool/manual/libtool.html#FAQ

Cheers,
Peter


___
https://lists.gnu.org/mailman/listinfo/libtool