some boost libraries need recompilation with -fPIC on amd64

Bug #1033679 reported by Tom Fogal on 2012-08-06
This bug affects 6 people
Affects Status Importance Assigned to Milestone
boost-defaults (Ubuntu)

Bug Description

Output from some of our software compiling here:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libboost_filesystem-mt.a(operations.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libboost_filesystem-mt.a: could not read symbols: Bad value

Boost was added to the project via the following code in a cmakelists.txt:

  FIND_PACKAGE(Boost 1.46.0
                                COMPONENTS date_time filesystem regex systems signals serialization thread)

I also had this problem with 'regex', removed it from the cmakelists.txt just to see what would happen, and hit the same thing with filesystem. The full command that produced the above error was:

cd /home/tfogal/dev/SCIRunGUIPrototype/bin/Algorithms/DataIO && /usr/bin/cmake -E cmake_link_script CMakeFiles/Algorithms_DataIO.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -fPIC -g -Wall -shared -Wl,-soname, -o ../../lib/ CMakeFiles/Algorithms_DataIO.dir/ CMakeFiles/Algorithms_DataIO.dir/ ../../lib/ ../../lib/ -Wl,-Bstatic -lboost_date_time-mt -lboost_filesystem-mt -lboost_system-mt -lboost_signals-mt -lboost_serialization-mt -lboost_thread-mt -Wl,-Bdynamic -lpthread -Wl,-rpath,/home/tfogal/dev/SCIRunGUIPrototype/bin/lib

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: libboost-filesystem-dev
ProcVersionSignature: Ubuntu 3.2.0-27.43-generic 3.2.21
Uname: Linux 3.2.0-27-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu11
Architecture: amd64
Date: Mon Aug 6 15:35:20 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
 PATH=(custom, user)
SourcePackage: boost-defaults
UpgradeStatus: No upgrade log present (probably fresh install)

Tom Fogal (tfogal) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in boost-defaults (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers