[syslog-ng] linking changes

Balazs Scheidler bazsi at balabit.hu
Wed Feb 23 14:52:18 CET 2011


On Wed, 2011-02-23 at 14:31 +0100, Corinna Vinschen wrote:
> On Feb 23 14:11, Balazs Scheidler wrote:
> > On Wed, 2011-02-23 at 13:57 +0100, Corinna Vinschen wrote:
> > > On Feb 23 13:05, Balazs Scheidler wrote:
> > > > Hi,
> > > > 
> > > > I've tried to put a closure on how syslog-ng 3.2 and above is being
> > > > linked. There were numerous problems as it started to get into Linux
> > > > distributions.
> > > > [...]
> > > > Also, the main syslog-ng executable is not linked against
> > > > libssl/libcrypto on purpose, it is only used by the afsocket module
> > > > (which implements the tcp/syslog destinations).
> > > > 
> > > > Could anyone who is in charge of maintaining syslog-ng binaries in
> > > > various distributions give this a test so 3.2.3 will compile everywhere
> > > > out-of-the-box?
> > > 
> > > Sorry, but this won't work for the Cygwin distro.  The changes don't
> > > take my patch from
> > > https://lists.balabit.hu/pipermail/syslog-ng/2011-February/016007.html
> > > into account.
> > 
> > I understand that, but pdbtool doesn't open libdbparser.so anymore and
> > libsyslog-ng-patterndb.so has been removed and I link that into pdbtool
> > statically.
> > 
> > Rechecking the patch you referenced, the only important difference is
> > that you mark the convenience library with noinst_ whereas my patch
> > installs that publicly (which indeed is a bug).
> > 
> > Am I missing something else?
> 
> Well, yes.  As outlined in
> https://lists.balabit.hu/pipermail/syslog-ng/2011-February/016006.html
> there are two problems:
> 
> - You can't link against a static lib when creating a shared lib.  That
>   means, creating libdbparser.so will fail.  My patch results in
>   creating a shared libsyslog-ng-patterndb.so for linking libdbparser.so,
>   and a static libsyslog-ng-patterndb.a for linking pdbtool.
>   Marking both libsyslog-ng-patterndb as noinst is just to avoid that
>   both convenience libs are installed.

hmm.. not even with -fPIC ? If I have to duplicate executable code into
pdbtool anyway (because of static linking it), I'd rather not have a
separate .so which is only loaded by an .so.

If that's the case, I'd include the same source files into both targets
(the .la one and pdbtool one)

> 
> - The link order is important when creating binaries on the Windows
>   platform.  Since libsyslog-ng-patterndb.a reference symbols in
>   ../../lib/libsyslog-ng.la, you must reorder them on the command line.
>   Not
> 
>     ../../lib/libsyslog-ng.la libsyslog-ng-patterndb.a
> 
>   but
>   
>     libsyslog-ng-patterndb.a ../../lib/libsyslog-ng.la

Ok, I've missed that, and changed my Makefile.

> 
> My patch fixes both problems.  The result should work on all platforms.

Thanks for your efforts, and sorry for missing the point. Hopefully we
can close this once and for all :)

-- 
Bazsi




More information about the syslog-ng mailing list