When emergeing net-p2p/btpd-0.13 with "-Wl,--as-needed" in LDFLAGS, it fals with the following; x86_64-pc-linux-gnu-gcc -O2 -march=athlon64 -msse3 -pipe -std=c99 -Wl,--as-needed -o btpd -lcrypto -lm btpd-active.o btpd-btpd.o btpd-cli_if.o btpd-content.o btpd-download.o btpd-download_subr.o btpd-http_tr_if.o btpd-main.o btpd-net.o btpd-net_buf.o btpd-opts.o btpd-peer.o btpd-tlib.o btpd-torrent.o btpd-tracker_req.o btpd-upload.o btpd-util.o ../misc/libmisc.a ../libevent/libevent.a btpd-content.o: In function `cm_create': content.c:(.text+0x1ec): undefined reference to `ceil' content.c:(.text+0x22c): undefined reference to `ceil' btpd-content.o: In function `cm_put_bytes': content.c:(.text+0x87f): undefined reference to `ceil' btpd-content.o: In function `startup_test_end': content.c:(.text+0xc4a): undefined reference to `ceil' btpd-content.o: In function `cm_start': content.c:(.text+0x1133): undefined reference to `ceil' btpd-download_subr.o:download_subr.c:(.text+0x32b): more undefined references to `ceil' follow ../misc/libmisc.a(libmisc_a-metainfo.o): In function `mi_info_hash': metainfo.c:(.text+0x483): undefined reference to `SHA1' ../misc/libmisc.a(libmisc_a-stream.o): In function `bts_sha': stream.c:(.text+0x4df): undefined reference to `SHA1_Init' stream.c:(.text+0x52a): undefined reference to `SHA1_Update' stream.c:(.text+0x53b): undefined reference to `SHA1_Final' ../misc/libmisc.a(libmisc_a-subr.o): In function `rand_between': subr.c:(.text+0x713): undefined reference to `rint' collect2: ld returned 1 exit status make[1]: *** [btpd] Error 1 make[1]: Leaving directory `/var/tmp/portage/net-p2p/btpd-0.13/work/btpd-0.13/btpd' make: *** [all-recursive] Error 1 Remove --as-needed and it compiles fine. This is on hardened amd64, however I get the same results with vanilla gcc 3.4. Reproducible: Always
Created attachment 132957 [details, diff] btpd-0.13-as-needed.patch This patch fixes the problem. It's backported from svn trunk.
Created attachment 151963 [details] btpd-0.13 ebuild with coldwind's patch applied This is still an issue, and 0.13 is still the latest release, however the patch coldwind posted fixes it, so I've attached an updated ebuild which applies the patch.
The source patch is correct, the ebuild is not, though. After the patch has been applied, eautomake from autotools.eclass should be called to rebuild all autotools. If it works its just because maintainer mode kicks in, but that's not good (see "Errors in build phase about autoconf version" in http://www.gentoo.org/proj/en/qa/autofailure.xml).
Created attachment 189153 [details, diff] Makefile.in --as-needed patch Patching Makefile.in
Created attachment 189154 [details, diff] Ebuild patch This implements what Diego was talking about. * Add src_unpack * patch Makefile.in * call eautomake
I just attached 2 new patches to fix the bug. I'll leave it to the maintainer to submit upstream.
Comment on attachment 189153 [details, diff] Makefile.in --as-needed patch This is wrong :( Use the original patch.
Created attachment 189181 [details, diff] New btpd-0.13.ebuild patch Oops. it needs WANT_AUTOMAKE="1.9".
Fixed with a bump to 0.15; thanks anyway Sander!
*** Bug 248148 has been marked as a duplicate of this bug. ***