tag 586572 - patch
thanks

Hi!

On Sun, 2010-06-20 at 19:12:46 +0200, Denis Washington wrote:
> Package: libdpkg-dev
> Version: 1.15.7.2
> Severity: normal
> Tags: patch
> 
> I am trying to build a shared library where libdpkg.a (from libdpkg-dev
> 1.15.7.2, installed on Ubuntu 10.04) should be linked into. I get the
> following error, though:
> 
> /usr/bin/ld: /usr/lib/dpkg/libdpkg.a(database.o): relocation R_X86_64_32S 
> against `.bss' can not be used when making a shared object; recompile with 
> -fPIC
> 
> This is because the objects in libdpkg.a are not compiled to
> position-independent code (with gcc -fPIC). I believe that should be
> done, though, to make using libdpkg.a in shared libraries possible.

As explained on the mailing list, this will not be enough for your
purposes anyway.

> Attached is a trivial patch that adds -fPIC to CFLAGS.

But then if we were to provide a PIC enabled library, we'd have to
build it twice w/ and w/o PIC (to something like libdpkg-pic.a), as
the normal static library should not be PIC enabled. But right now
I'd rather not, as other libraries might start exposing libdpkg through
other shared libraries, when there's no guarantees of stability at all.

regards,
guillem



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to