Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 284924 - mail-filter/libmilter-1.0.1 causes app-antivirus/clamav-0.95.2 to fail on LDFLAGS="-Wl,--as-needed"
Summary: mail-filter/libmilter-1.0.1 causes app-antivirus/clamav-0.95.2 to fail on LDF...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Alin Năstac (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2009-09-14 13:12 UTC by Nathan Phillip Brink (binki) (RETIRED)
Modified: 2009-09-20 16:26 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/tmp/clamav-0.95.2-build.log (clamav-0.95.2-build.log,13.14 KB, text/plain)
2009-09-14 13:13 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details
/tmp/clamav-0.95.2-config.log (clamav-0.95.2-config.log,289.47 KB, text/plain)
2009-09-14 13:14 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details
/tmp/libmilter-1.0.1-build.log (libmilter-1.0.1-build.log,16.08 KB, text/plain)
2009-09-14 13:31 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2009-09-14 13:12:22 UTC
app-antivirus/clamav-0.95.2 fails when LDFLAGS has -Wl,--as-needed in it and when libmilter is available as a shared object.
Comment 1 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2009-09-14 13:13:47 UTC
Created attachment 204041 [details]
/tmp/clamav-0.95.2-build.log
Comment 2 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2009-09-14 13:14:09 UTC
Created attachment 204043 [details]
/tmp/clamav-0.95.2-config.log
Comment 3 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2009-09-14 13:29:11 UTC
Actually... this may be a problem with mail-filter/libmilter-1.0.1 not properly linking libmilter.so:

$ ldd /usr/lib64/libmilter.so
        linux-vdso.so.1 =>  (0x00007fff7cba9000)
        libc.so.6 => /lib64/libc.so.6 (0x00007ff3bbc12000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff3bc1a6000)

$ nm -D /usr/lib64/libmilter.so |grep pthread
                 U pthread_create
                 U pthread_detach
                 U pthread_mutex_destroy
                 U pthread_mutex_init
                 U pthread_mutex_lock
                 U pthread_mutex_unlock
                 U pthread_self
                 U pthread_sigmask


Sorry, I don't know exactly what to make of all of this info, but using --as-needed with clamav does cause it to fail to link while avoiding --as-needed doesn't. In fact, this compilation fragment from mail-filter/libmilter-1.0.1 suggests it silently fails to link libmilter.so when compiling:

x86_64-pc-linux-gnu-gcc -Wl,--as-needed -Wl,-O1 -Wl,-t -Wl,--enable-new-dtags -Wl,--hash-style=both -lpthread -shared -o libmilter.so -Wl,-soname,libmilter.so.1.0.1 main
.o engine.o listener.o worker.o handler.o comm.o smfi.o signal.o sm_gethost.o monitor.o errstring.o strl.o     -lc


Comment 4 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2009-09-14 13:31:41 UTC
Created attachment 204054 [details]
/tmp/libmilter-1.0.1-build.log
Comment 5 Olivier Crete (RETIRED) gentoo-dev 2009-09-19 21:03:22 UTC
as-needed is not officially supported. Please provide a fix upstreamn and re-open the bug
Comment 6 Alin Năstac (RETIRED) gentoo-dev 2009-09-20 08:31:49 UTC
You're right, libmilter misses -lpthread when linked with -Wl,--as-needed.

Fixed in libmilter-1.0.1-r1, thanks!
Comment 7 Alin Năstac (RETIRED) gentoo-dev 2009-09-20 09:27:10 UTC
Also fixed in mail-mta/sendmail-8.14.3-r2.
Comment 8 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2009-09-20 16:26:40 UTC
(In reply to comment #6)
> You're right, libmilter misses -lpthread when linked with -Wl,--as-needed.
> 
> Fixed in libmilter-1.0.1-r1, thanks!
> 

Thank you very much for your support :-)