failure building static 0.15.9

Andras Salamon andras at dns.net
Sun Dec 7 17:30:46 CET 2003


On Sat, Dec 06, 2003 at 09:38:43PM -0500, David Relson wrote:
> Gyepi SAM <gyepi at praxis-sw.com> wrote:
> > The compilation problem appears to be missing link for libpthread.
> 
> Allyn might be the only person doing static builds on RH-9.

The static build also fails on my install of RH-6.2 with db-4.0.14.
It works fine on a RH-7.2-based custom system with db-3.1.17 and gsl-1.4.

The resulting static binary on the RH-6.2 system appears incompletely
linked. On both these systems, the static build does not require
    LDFLAGS="-lpthread"
but on the RH-6.2 system configure misdetects the static libdb.

On the RH-6.2 box, this is what the libdb-4.0.14 installation looks like,
built from sources:

% ls -l /usr/local/BerkeleyDB.4.0/lib
total 1261
-r--r--r--    2 root     root       742038 Oct 27 13:15 libdb-4.0.a
-r--r--r--    1 root     root          724 Oct 27 13:15 libdb-4.0.la
-r--r--r--    2 root     root       539376 Oct 27 13:15 libdb-4.0.so
lrwxrwxrwx    1 root     root           12 Oct 27 13:15 libdb-4.so -> libdb-4.0.so
lrwxrwxrwx    1 root     root           11 Oct 27 13:15 libdb.a -> libdb-4.0.a
lrwxrwxrwx    1 root     root           12 Oct 27 13:15 libdb.so -> libdb-4.0.so

This is the configure call on the RH-6.2 box:

./configure --enable-static --with-libdb-prefix=/usr/local/BerkeleyDB.4.0

This is the resulting compiler call:

gcc -DBOGOFILTER -g -O2  -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Waggregate-return -Wmissing-declarations -Wnested-externs -ggdb -fno-common -Wchar-subscripts -Wcomment -Wimplicit -Wreturn-type -Wpointer-arith -o bogofilter_static -static bogofilter.o main.o method.o graham.o robinson.o fisher.o libbogofilter.a  strlcpy.o strlcat.o /usr/local/BerkeleyDB.4.0/lib/libdb.so -Wl,-rpath -Wl,/usr/local/BerkeleyDB.4.0/lib libbf_gsl.a -lm 

Note the inclusion of
    /usr/local/BerkeleyDB.4.0/lib/libdb.so
which should probably be
    /usr/local/BerkeleyDB.4.0/lib/libdb.a

Substituting libdb.a for libdb.so in the above invocation of gcc results
in a correctly linked static binary, which seems to work:
    cp -p src/bogofilter_static src/bogofilter; make check
gives 31 passes, t.valgrind skipped.

I don't know what needs to change in acinclude.m4 to make this work,
but the lib-link.m4 code from gettext-0.11.3 seems suspect.  I see
gettext-0.13 was released on 30 November 2003, maybe an upgrade to a
more recent version would solve the problem.

-- Andras Salamon                   andras at dns.net




More information about the bogofilter-dev mailing list