Re: [Boost-users] x86_64 needs -fPIC issue, anyone successful?
Bill Freeman wrote:
I'm trying to build a library (librets) that links against boost libraries in order to build a shared library (as part of a SWIG based python extension). ... /usr/bin/ld: /home/f/Desktop/rets/lib/libboost_system.a(error_code.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
...
Or, if not, can someone tell me how to tell the bjam stuff to apply -fPIC so that I can try that. ... Neal Becker wrote:
You should have a libboost_system.so to link against (which should have, and probably was, built with -fpic). Either: 1) You don't have libboost_system.so where linker is looking or 2) Usually these are setup as symlinks, libboost_system.so -> libboost_system.so.x.y.z You could be missing the symlink, or it could point to the wrong place. ------------------------------------------ The so files are there. But librets explicitly wants the .a, presumably because it wants to bind in the actual code, rather than the stub. While python extension libraries themselves need to be shared, so that they can be loaded dynamicly, at run time, the librets folks apparently don't want to depend on the boost shared libraries being installed on the target system. While the wisdom of that choice is debatable, librets is simply something I want to use (from python). I'm not involved in its development community. I'm just looking for the easy way out. Getting the boost static's built PIC seems worth trying. Bill
participants (1)
-
Bill Freeman