Bug 75416 - enable-compat-libs requires gold linker
Summary: enable-compat-libs requires gold linker
Status: RESOLVED NOTOURBUG
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-24 00:04 UTC by Stefan Brüns
Modified: 2014-02-24 02:02 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Stefan Brüns 2014-02-24 00:04:35 UTC
I tried linking the compat libs with the legacy binutils linker. The failing command (called from libtool) was:

gcc -shared  -fPIC -DPIC  .libs/libsystemd_login_la-libsystemd-login.o   -Wl,-rpath -Wl,/home/abuild/rpmbuild/BUILD/systemd-209/.libs -Wl,-rpath -Wl,/usr/lib64 ./.libs/libsystemd.so -L/usr/lib64 -llzma -lgcrypt -lgpg-error -lrt -lresolv -ldl  -flto -O2 -Wl,--as-needed -Wl,--no-undefined -Wl,--gc-sections -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,--version-script=./src/compat-libs/libsystemd-login.sym   -pthread -Wl,-soname -Wl,libsystemd-login.so.0 -o .libs/libsystemd-login.so.0.9.2

It fails with:
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: 
internal error, aborting at elf64-x86-64.c line 3219 in elf_x86_64_relocate_section

I have instrumented the abort with some additional output, which prints the section flags and plt offset:
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: .libs/libsystemd_login_la-libsystemd-login.o: Error with relocation R_X86_64_GOTPCREL against STT_GNU_IFUNC flags: 0x20011f offset 0xffffffffffffffff

Tested binutils 2.23.2 and 2.24.0.

Linking with gold works fine.
Comment 1 Zbigniew Jedrzejewski-Szmek 2014-02-24 01:44:20 UTC
Yep, compat-libs code uncovered a bunch of bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=16467
https://sourceware.org/bugzilla/show_bug.cgi?id=16504
http://llvm.org/bugs/show_bug.cgi?id=11897

The first will be fixed in bintuils 2.25.

The default flags are set so that the compliation works.
Comment 2 Zbigniew Jedrzejewski-Szmek 2014-02-24 02:02:42 UTC
And last but not least:

https://bugzilla.redhat.com/show_bug.cgi?id=1067245


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.