[syslog-ng]syslog-ng 1.9.2/1.6.5 static linking

Roberto Nibali syslog-ng@lists.balabit.hu
Wed, 02 Feb 2005 12:35:21 +0100


Hello,

> It is not GNU make but GCC which interprets -static and -shared and
> calls the linker accordingly.
>=20
> I have added a configure option called --enable-full-static which links
> everything statically:
>=20
> AC_ARG_ENABLE(full-statuc,
>    [  --enable-full-static    Link everything in statically],,
>    enable_full_static=3Dno)

I'm sorry, but Jos=E9's patch broke the full static build. With syslog-ng=
-1.6.5,=20
and following command set ($BUILD_DIR is the current syslog-ng top direct=
ory) :

config:
         cd $(BUILD_DIR); ./configure \
                 --prefix=3D/usr \
                 --sysconfdir=3D/etc
         echo "#undef PATH_SYSCONFDIR"             >> ${BUILD_DIR}/src/co=
nfig.h
         echo "#define PATH_SYSCONFDIR \"/etc/\""  >> ${BUILD_DIR}/src/co=
nfig.h

compile:
         ${MAKE} -C ${BUILD_DIR} LDFLAGS=3D-static

The resulting linking of syslog-ng will be:

$ gcc  -g -O2 -Wall -I/usr/include/libol -D_GNU_SOURCE  -static -o syslog=
-ng=20
main.o sources.o center.o filters.o destinations.o log.o cfgfile.o cfg-gr=
ammar.o=20
cfg-lex.o affile.o afsocket.o afunix.o afinet.o afinter.o afuser.o afstre=
ams.o=20
afprogram.o afremctrl.o nscache.o utils.o syslog-names.o macros.o  -lnsl=20
-lresolv  -lfl /usr/lib/libol.a -lnsl

$ ldd ${BUILD_DIR}/src/syslog-ng
         not a dynamic executable

The same command set with syslog-ng-1.6.6 (with or without --enable-full-=
static)=20
yields:

$ gcc  -g -O2 -Wall -I/usr/include/libol -D_GNU_SOURCE  -static -o syslog=
-ng=20
main.o sources.o center.o filters.o destinations.o log.o cfgfile.o cfg-gr=
ammar.o=20
cfg-lex.o affile.o afsocket.o afunix.o afinet.o afinter.o afuser.o afstre=
ams.o=20
afprogram.o afremctrl.o nscache.o utils.o syslog-names.o macros.o  -lnsl=20
-lresolv  -Wl,-static -lfl -lwrap   /usr/lib/libol.a -lnsl -Wl,-call_shar=
ed

$ ldd src/src/syslog-ng
/usr/bin/ldd: src/src/syslog-ng: No such file or directory

$ ls -al src/src/syslog-ng
-rwxrwxr-x    1 ratz     users      412669 Feb  2 12:29 src/src/syslog-ng

A typical linker error when full static linking is involved. Please rever=
t the=20
patch or help me find an appropriate fix.

Thanks and best regards,
Roberto Nibali, ratz
--=20
-------------------------------------------------------------
addr://Rathausgasse 31, CH-5001 Aarau  tel://++41 62 823 9355
http://www.terreactive.com             fax://++41 62 823 9356
-------------------------------------------------------------
terreActive AG                       Wir sichern Ihren Erfolg
-------------------------------------------------------------