libtool
[Top][All Lists]
Advanced

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

Re: Inherited linker flags


From: Ralf Wildenhues
Subject: Re: Inherited linker flags
Date: Sun, 26 Sep 2010 07:34:47 +0200
User-agent: Mutt/1.5.20 (2010-08-04)

Hello Sam,

* Sam Varshavchik wrote on Sun, Sep 26, 2010 at 05:57:43AM CEST:
> By doing some experimenting, I found that that everything appears to
> work nicely, if I put "-Wl,--undefined=Y" into liby.la's
> inherited_linker_flags setting. This apparently carries no impact
> when "sharedly" linking against liby.la. And when statically linking
> liby.la the undefined symbol forces the inclusion of Y's module into
> P, and resolving the weak reference from libx.
> 
> I could, of course, do the same thing by explicitly specifying the
> extra linker flag in Makefile.am in P's LDFLAGS. Having this flag in
> a .la file has the nice effect of libtool automatically handling
> this. It goes without saying that the whole thing works only on
> platforms where gcc and binutils have weak references.

There is currently no way to get arbitrary flags into the
inherited_linker_flags variable, except patching the file afterwards.

Please note that the flags are carried over to any library linking
(directly or indirectly) against liby.la, which may or may not be what
you intended.

Please also note that this may make the .la file linker-dependent (in
case your users use more than linker on their system, with different
--undefined API).  For the specific example, the risk seems fairly low,
however.  The clean way would be to add to P's LDFLAGS.

Cheers,
Ralf



reply via email to

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