Boost C++ Libraries: Ticket #12962: user overridden cxxflags are not honored for the compilation of some libraries https://svn.boost.org/trac10/ticket/12962 <p> Upon linking <code>libboost_regex-mt.a</code> to a shared library I am getting the error: </p> <pre class="wiki">/usr/bin/ld: /usr/local/lib/libboost_regex-mt.a(instances.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libboost_regex-mt.a: could not read symbols: Bad value </pre><p> I am building boost with <code>-fPIC</code> by running bjam with the following options: </p> <pre class="wiki">./bjam '-sBUILD=&lt;cflags&gt;-fPIC &lt;cxxflags&gt;-fPIC &lt;linkflags&gt;-fPIC' --without-mpi --without-python --without-iostreams --layout=tagged link=shared,static </pre><p> bjam does not seem to honor the <code>-fPIC</code> flag upon compilation of <code>libboost_regex-mt</code>: </p> <pre class="wiki">gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/threading-multi/instances.o "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -pthread -m64 -DBOOST_ALL_NO_LIB=1 -DNDEBUG -I"." -c -o "bin.v2/libs/regex/build/gcc-4.8/release/link-static/threading-multi/instances.o" "libs/regex/build/../src/instances.cpp" </pre><p> Looking at the bjam debug log, there seem to be many libraries where user overridden cxxflags are not honored for the compilation. These include <code>libboost_math_tr1-mt.a</code>, <code>libboost_program_options-mt.a</code>, <code>libboost_signals-mt.a</code>, <code>libboost_locale-mt.a</code> and others. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12962 Trac 1.4.3