I'm reporting this bug because the package in summary fails to build when forcing --as-needed on through spec files (check out http://blog.flameeyes.eu/2008/11/14/problems-and-mitigation-strategies-for-as-needed for details).
Please note that this bug _might_ apply to -Wl,--as-needed in LDFLAGS as well; in both cases it should be fixed. Also, if this is due to the package in question not respecting user-defined LDFLAGS, you should get to fix that too.
Check the attached build log.
Created attachment 197078 [details]
I cant reproduce it with
Make sure to have USE=perl.
The missing symbols named on lines 129 and later come from libdl, which is linked via -ldl. Due to the forced --as-needed, -ldl is discarded since it occurs well before the reference to DynaLoader.a. Moving all the -l switches to the end of the line should fix the problem.
127 i686-pc-linux-gnu-gcc -O2 -pipe -D_GNU_SOURCE -Wl,-O1 -rdynamic -L/usr/local/lib -L/usr/lib/perl5/5.8.8/i686-linux/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -o dbhub commands.o fileio.o main.o network.o userlist.o utils.o langvars.o logger.o motd.o semops.o perl_utils.o xs_functions.o lang.o /usr/lib/perl5/5.8.8/i686-linux/auto/DynaLoader/DynaLoader.a -lperl -lcrypt
128 /usr/lib/perl5/5.8.8/i686-linux/auto/DynaLoader/DynaLoader.a(DynaLoader.o): In function `XS_DynaLoader_dl_find_symbol':
129 (.text+0x6f5): undefined reference to `dlsym'
130 /usr/lib/perl5/5.8.8/i686-linux/auto/DynaLoader/DynaLoader.a(DynaLoader.o): In function `XS_DynaLoader_dl_find_symbol':
131 (.text+0x781): undefined reference to `dlerror'
As a secondary point, why are there two -lperl and -lcrypt? Why is there a -lc at all?
(In reply to comment #3)
> Make sure to have USE=perl.
The perl support needs you to have file called DynaLoader.a, but that file doesn't exist in Gentoo's perl-5.10.1 for some reason... Your log shows it's there still with 5.8.8.
Obviously it's impossible to hit to this bug with that file missing -> and configure disabling perl support
Created attachment 236967 [details, diff]
Updated -gentoo.patch to files/
Overwrite the current -gentoo.patch in files/ directory with this, and run eautoreconf on the package.
It should solve the issue... that is, if you got the DynaLoader.a file installed. I have no idea howto get that file.
applied the patch to portage -> this bug is now for the missing file in perl
Packages embedding Perl and not using ExtUtils::Embed::ldopts will look for DynaLoader.a in vain.
Here they just create a dummy DynaLoader.a
If uptream doesn't care, do we?
meh, it was easy...
+ 24 Oct 2010; Samuli Suominen <firstname.lastname@example.org> dbhub-0.451.ebuild,
+ Don't check DynaLoader library for compability with recent perl wrt
+ #276928 by Diego E. Pettenò.