bug-libtool
[Top][All Lists]
Advanced

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

Re: Flags that need special handling.


From: Åke Sandgren
Subject: Re: Flags that need special handling.
Date: Thu, 18 Mar 2010 21:01:19 +0100

On Thu, 2010-03-18 at 19:51 +0100, Ralf Wildenhues wrote:
> Hello Ake,
> 
> thanks for the report.
> 
> * Ake Sandgren wrote on Thu, Mar 18, 2010 at 03:55:11PM CET:
> > When using the PathScale compiler and certain flags that are needed both
> > at compile and link time libtool is stripping them out from the link
> > command.
> 
> First off, a general remark.  libtool only strips unknown flags when
> creating libraries (not when compiling only, or when creating programs).
> This is done because some flags are harmful to pass on *without* also
> changing some other libtool semantics.  So when we allow to let through
> some flags unconditionally, we need to be sure that libtool does not
> interfere with the flags.

Yes, this problem only occurs during shared library creation as far as i
have seen so far.

> That being said, you should never need to wait for libtool to fix this
> handling: you can get libtool to pass through flags by prepending them
> with one of '-Wc,', '-Wl,', '-Xcompiler ', or '-Xlinker '.  The first
> one is for flags that the compiler driver should get, the second for
> flags for the linker, and the last two are only needed if the args
> contain commas that should not be converted.

> Since libtool is mostly not used during configure scripts, you may need
> to override LDFLAGS at 'make' time for this to work.  (The libtool flags
> also work when creating programs, or in compile mode, at least in the
> current git libtool; ugh.)

Yes, the problem is to get this to work all the way through configure
which eliminates the use of -Xcompiler/-Xlinker/-XCClinker in LDFLAGS
since they would get added during configure test code builds.
It's a pity there is no way to specify C/CXX/F/LD-FLAGS that should be
used only during make and not when configure is run... 

Overriding LDFLAGS during make means one has to write really good
instructions that nobody will read anyway...

> > The flags found so far are; -ipa, -Ofast and -IPA*
> 
> I haven't checked the PathScale manual yet, but -ipa and -IPA* sound
> like they have to do with inter-procedural analysis.  IIRC then some
> compilers may generate additional objects for this, but I'm not sure
> whether that works seamlessly when creating both static and shared
> libraries.

It shouldn't matter for static libs since they are built with ar and not
with $CC -shared.

> What does -Ofast do?

Correct, -ipa/-IPA are inter-procedural analysis. -Ofast is a "wrapper"
flag that among others contain -ipa.

I haven't made any in depth analysis of the problem so there might
possibly be some problem with adding those flags to the suggested list
but my guess is that it would be ok.





reply via email to

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