bug-libtool
[Top][All Lists]
Advanced

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

Re: per-deplib static/dynamic patches


From: Balazs Scheidler
Subject: Re: per-deplib static/dynamic patches
Date: Sat, 11 Sep 2010 17:50:57 +0200

On Sat, 2010-09-11 at 10:57 +0200, Balazs Scheidler wrote:
> Hi,
> 
> I saw per-deplib static/dynamic patches implemented in 2006 by Ralf
> Wildenhues, but I can't see them in current libtool.
> 
> I'd need exactly this feature for syslog-ng as it needs to be started
> before /usr is mounted and all libraries that it depends on in usr must
> be linked statically, but other system libs should be linked
> dynamically.
> 
> Going for an all static binary is not really an option as syslog-ng is
> now plugin based and plugins need to link against the main program and
> if I link a static lib into the syslog-ng binary plugins may not find
> all symbols (as those can potentially be stripped since the main program
> isn't using them).
> 
> Can I ask if there's an updated patch available or if there are any
> plans to actually integrate them into libtool mainline?
> 
> BTW: the problem is not new for syslog-ng, it has been linked this way
> for years, however because of the plugin conversion it now started using
> libtool which it didn't until now.
> 
> Thanks for any help or hints you can give.
> 

I've got a not-very-nice solution for the problem right now, which I'm
posting here if anyone else stumbles into the same problem.

I've told automake to use my own LINK command:

+syslog_ng_LINK =  $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@

Which is the same as the one automake generates except the libtool prefix
is removed.

Then I've linked against my local library directly, bypassing libtool entirely:

-syslog_ng_LDADD = ../lib/libsyslog-ng.la @DEPS_LIBS@
+syslog_ng_LDADD = -L../lib/.libs -lsyslog-ng @DEPS_LIBS@

It may not work on all platforms, but since this linking mode is only
supported for Linux, it seems to be good enough for me.

Does anyone know any possible caveats?

-- 
Bazsi





reply via email to

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