1 message in net.sourceforge.lists.courier-users[courier-users] courier compilation f...
FromSent OnAttachments
Hanno BöckNov 24, 2007 8:10 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[courier-users] courier compilation fails with --as-neededActions...
From:Hanno Böck (ml@hboeck.de)
Date:Nov 24, 2007 8:10:40 am
List:net.sourceforge.lists.courier-users

courier (0.58 and all older versions I've tested) fails with Linking when using LDFLAGS="-Wl,--as-needed".

Reproducible with LDFLAGS="-Wl,--as-needed" ./configure LDFLAGS="-Wl,--as-needed" make

--as-needed tells the linker to only link libraries with functions that are actually in use. Failure usually means that the linking order is wrong at some place. I didn't find a bugtracker for courier, so I'm posting it here.

Output:

make[1]: Entering directory `/tmp/courier-0.58.0/tcpd' make all-am make[2]: Entering directory `/tmp/courier-0.58.0/tcpd' /bin/sh ./libtool --tag=CC --mode=link gcc -I./.. -I.. -Wall -g -O2 -static -Wl,--as-needed -o couriertcpd argparse.o tcpd.o tcpdaccess.o tcpremoteinfo.o libspipe.la ../rfc1035/librfc1035.a ../gdbmobj/libgdbmobj.la
../liblock/liblock.la ../numlib/libnumlib.la ../waitlib/libwaitlib.a
../soxwrap/libsoxwrap.a ../md5/libmd5.la ../random128/librandom128.la -Wl,-lgdbm gcc -I./.. -I.. -Wall -g -O2 -Wl,--as-needed -o couriertcpd argparse.o tcpd.o tcpdaccess.o tcpremoteinfo.o -Wl,-lgdbm ./.libs/libspipe.a ../rfc1035/librfc1035.a
../gdbmobj/.libs/libgdbmobj.a ../liblock/.libs/liblock.a
../numlib/.libs/libnumlib.a ../waitlib/libwaitlib.a ../soxwrap/libsoxwrap.a
../md5/.libs/libmd5.a ../random128/.libs/librandom128.a ../gdbmobj/.libs/libgdbmobj.a(gdbmobj.o): In function `gdbm_dofetch': /tmp/courier-0.58.0/gdbmobj/gdbmobj.c:173: undefined reference to `gdbm_fetch' ../gdbmobj/.libs/libgdbmobj.a(gdbmobj.o): In function `gdbmobj_exists': /tmp/courier-0.58.0/gdbmobj/gdbmobj.c:110: undefined reference to `gdbm_exists' ../gdbmobj/.libs/libgdbmobj.a(gdbmobj.o): In function `gdbmobj_store': /tmp/courier-0.58.0/gdbmobj/gdbmobj.c:96: undefined reference to `gdbm_store' ../gdbmobj/.libs/libgdbmobj.a(gdbmobj.o): In function `gdbmobj_close': /tmp/courier-0.58.0/gdbmobj/gdbmobj.c:33: undefined reference to `gdbm_close' ../gdbmobj/.libs/libgdbmobj.a(gdbmobj.o): In function `gdbmobj_open': /tmp/courier-0.58.0/gdbmobj/gdbmobj.c:63: undefined reference to `gdbm_open' /tmp/courier-0.58.0/gdbmobj/gdbmobj.c:70: undefined reference to `gdbm_fdesc' collect2: ld returned 1 exit status make[2]: *** [couriertcpd] Error 1 make[2]: Leaving directory `/tmp/courier-0.58.0/tcpd' make[1]: *** [all] Error 2 make[1]: Leaving directory `/tmp/courier-0.58.0/tcpd' make: *** [all-recursive] Error 1