Dewayne Geraghty
2016-Feb-29 09:05 UTC
Problem with /usr/lib/libcrypt.a when building perl/python with libressl
I'm trying to rebuild my local ports tree using libressl. Unfortunately the linker is advising that I should build /usr/lib/libcrypt.a with -fPIC. As its a security-related module, I would appreciate advise as to whether this will/may cause a security issue? The message, during the link phase, that both python27 and perl 5.20 is sending is: /usr/bin/ld: /usr/lib/libcrypt.a(crypt.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/libcrypt.a: could not read symbols: Bad value cc: error: linker command failed with exit code 1 (use -v to see invocation) I understand the value of fPIC for shareable libraries but I'm a little confused as to why libcrypt.a requires -fPIC; which BTW does enable both python, perl and others to build cleanly. Regards, Dewayne
Brandon Allbery
2016-Feb-29 14:22 UTC
Problem with /usr/lib/libcrypt.a when building perl/python with libressl
On Mon, Feb 29, 2016 at 4:05 AM, Dewayne Geraghty <dewaynegeraghty at gmail.com> wrote:> I understand the value of fPIC for shareable libraries but I'm a little > confused as to why libcrypt.a requires -fPIC; which BTW does enable both > python, perl and others to build cleanly. >Both perl and python load crypto support as shared objects associated with their respective loadable modules. As such, you can't link non-PIC static objects into those shared objects on amd64 (although it works, pretty much by accident, on i386 32-bit). -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net