https://bugzilla.redhat.com/show_bug.cgi?id=1716324
Bug ID: 1716324 Summary: perl-Text-Xslate-3.5.6-5.fc30 is not linked to libperl.so Product: Fedora Version: 30 Status: NEW Component: perl-Text-Xslate Assignee: jplesnik@redhat.com Reporter: ppisar@redhat.com QA Contact: extras-qa@fedoraproject.org CC: i@cicku.me, jplesnik@redhat.com, perl-devel@lists.fedoraproject.org Target Milestone: --- Classification: Fedora
perl-Text-Xslate-3.5.6-5.fc30 lost a dependency on libperl.so since -Wl,--as-needed was added to distribution-wide linker flags:
$ scanelf -n blib/arch/auto/Text/Xslate/Xslate.so TYPE NEEDED FILE ET_DYN libc.so.6 blib/arch/auto/Text/Xslate/Xslate.so
$ ldd -r blib/arch/auto/Text/Xslate/Xslate.so linux-vdso.so.1 (0x00007fff0d5cb000) libc.so.6 => /lib64/libc.so.6 (0x00007f948b9a1000) /lib64/ld-linux-x86-64.so.2 (0x00007f948bb8f000) undefined symbol: Perl_sv_cmp (blib/arch/auto/Text/Xslate/Xslate.so) undefined symbol: PL_ppaddr (blib/arch/auto/Text/Xslate/Xslate.so) [...]
Xslate.so is built like this:
gcc -lpthread -shared -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -fstack-protector-strong -lperl -o blib/arch/auto/Text/Xslate/Xslate.so lib/Text/Xslate.o src/xslate_methods.o
The cause is that -Wl,--as-needed takes effect when library is supplied and considering only preceding object files and ignoring and following object files. A correct linker command must list all object files before -l flags. Like this:
gcc lib/Text/Xslate.o src/xslate_methods.o -lpthread -shared -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -fstack-protector-strong -lperl -o blib/arch/auto/Text/Xslate/Xslate.so
Either there is bug in perl-Text-Xslate build script or in Module::Build::XSUtil that it uses.