[Top][All Lists]

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

Re: -static-libgcc link flag and shared objects

From: Ralf Wildenhues
Subject: Re: -static-libgcc link flag and shared objects
Date: Sat, 18 Feb 2006 10:09:21 +0100
User-agent: Mutt/1.5.9i

Hi Joe,

* Joe Orton wrote on Fri, Feb 17, 2006 at 11:22:52AM CET:
> We had an Apache user complain that -static-libgcc was not passed 
> through to the linker on Solaris if passed on the --mode=link line, when 
> linking a shared object; would this be considered a libtool bug?

Yes, I'd consider this a bug: the documented way to pass flags not
recognized by libtool, 

won't work in this case, because creating a C++ library may also get
libtool to add

to the link line, through the $postdeps computed at configure time,
unless at the time of the test the compiler saw the -static_libgcc flag
(for g++ this should often be the case).  This is the reason, by the
way, that we don't simply allow through -static-libgcc: it breaks if
given only in libfoo_la_LDFLAGS but not at configure time.  (Surely
that is also the case for ABI flags like -m32, but those are much less
likely to be passed in per-library flags.)

So you end up with something like
  configure LDFLAGS=-static-libgcc
  make LDFLAGS=-Wc,-static-libgcc

(and you'd still have to make sure the latter are not passed to links
not done with libtool), or, much simpler, and already described in the
  configure CC='gcc -static-libgcc'

which will work, the hack that it is.

There are more open issues with $postdeps in Libtool.  I don't see a
coherent solution to this mess ATM.


reply via email to

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