FS#40680 - [binutils] Cannot link to shared libraries
Attached to Project:
Arch Linux
Opened by Zulan (Zulan) - Wednesday, 04 June 2014, 12:02 GMT
Last edited by Allan McRae (Allan) - Wednesday, 04 June 2014, 14:00 GMT
Opened by Zulan (Zulan) - Wednesday, 04 June 2014, 12:02 GMT
Last edited by Allan McRae (Allan) - Wednesday, 04 June 2014, 14:00 GMT
|
Details
Description:
Cannot link a shared library with libbfd. Arch binutils deletes the libbfd.so symlink, so libbfd.a is used. Additional info: * binutils-2.24-3 Steps to reproduce: // foo.c #define PACKAGE "foo" #include <bfd.h> void foo() { void *argh = bfd_check_format_matches; } % gcc -shared -fPIC foo.c -o foo.so -lbfd /usr/bin/ld: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../lib/libbfd.a(format.o): relocation R_X86_64_32S against `binary_vec' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../lib/libbfd.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status Specifying the specific version of the library yields no error. (so. version used) % gcc -shared -fPIC foo.c -o foo.so -lbfd-2.24 |
This task depends upon
Closed by Allan McRae (Allan)
Wednesday, 04 June 2014, 14:00 GMT
Reason for closing: Fixed
Additional comments about closing: binutils-2.24-5 in [testing]
Wednesday, 04 June 2014, 14:00 GMT
Reason for closing: Fixed
Additional comments about closing: binutils-2.24-5 in [testing]
Comment by Zulan (Zulan) -
Wednesday, 04 June 2014, 12:05 GMT
Comment by Allan McRae (Allan) -
Wednesday, 04 June 2014, 14:00 GMT
Note: the binutils PKGBUILD explicity deletes the
/usr/lib/libbfd.so symlink in package().
Looks like despite what the configure looks like it is doing, the
libraries are not build with PIC by default.