FS#13929 - problem with libtar and pinot on x86_64 with -fPIC

Attached to Project: Arch Linux
Opened by John Werden (john_werden) - Monday, 23 March 2009, 07:20 GMT
Last edited by Eric Belanger (Snowman) - Monday, 27 April 2009, 20:39 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Eric Belanger (Snowman)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Trying to compile pinot with libtar fails due to:

g++ -shared -nostdlib /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../../../lib/crti.o /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/crtbeginS.o .libs/Filter.o .libs/TarFilter.o -ltar -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.3 -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/crtendS.o /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../../../lib/crtn.o -Wl,-soname -Wl,libtarfilter.so.0 -o .libs/libtarfilter.so.0.0.0
/usr/bin/ld: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../../../lib/libtar.a(block.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../../../lib/libtar.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libtarfilter.la] Error 1

Additional info:
* package version: 1.2.11-3

Steps to reproduce:
Download the newest version from http://colinf.chez.com/pinot/ (older versions don't use libtar)
- unpack, configure, make
This task depends upon

Closed by  Eric Belanger (Snowman)
Monday, 27 April 2009, 20:39 GMT
Reason for closing:  Won't fix
Additional comments about closing:  pinot doesn't use libtar anymore. I might even remove libtar from the repo.
Comment by Fabrice Colin (PinotDev) - Monday, 23 March 2009, 07:58 GMT
It looks like libtar wasn't built with -fPIC and is therefore not suitable for use in a shared library.

Debian builds libtar with this patch :
http://ftp.debian.org/debian/pool/main/libt/libtar/libtar_1.2.11-4.diff.gz
Fedora uses it too, and adds this other patch :
http://cvs.fedoraproject.org/viewvc/rpms/libtar/F-10/libtar-1.2.11-missing-protos.patch?revision=1.1

You may want to use these patches to build this package.

Fabrice
Comment by Jan de Groot (JGC) - Monday, 23 March 2009, 08:05 GMT
libtar works fine as shared library, but the static version is broken on x86_64.
I don't understand why projects switch to libtar nowadays though, it's a dead project with bugs, libarchive has a much brighter future.
Comment by Fabrice Colin (PinotDev) - Monday, 23 March 2009, 08:07 GMT
Yhe shared library itself probably works fine; what doesn't work is using this shared library from another shared library.
Debian and Fedora solve this issue with the above patches.
Thanks for heads up about libarchive.

Fabrice
Comment by Fabrice Colin (PinotDev) - Monday, 23 March 2009, 08:29 GMT
Ignore my previous comment about the shared library, it's irrelevant : I failed to notice the error message was about libtar.a ;-P
The problem about -fPIC remains though.

Fabrice

Loading...