Opened 6 years ago
#12962 new Bugs
user overridden cxxflags are not honored for the compilation of some libraries
Reported by: | Owned by: | ||
---|---|---|---|
Milestone: | To Be Determined | Component: | Building Boost |
Version: | Boost 1.63.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Upon linking libboost_regex-mt.a
to a shared library I am getting the error:
/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
I am building boost with -fPIC
by running bjam with the following options:
./bjam '-sBUILD=<cflags>-fPIC <cxxflags>-fPIC <linkflags>-fPIC' --without-mpi --without-python --without-iostreams --layout=tagged link=shared,static
bjam does not seem to honor the -fPIC
flag upon compilation of libboost_regex-mt
:
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"
Looking at the bjam debug log, there seem to be many libraries where user overridden cxxflags are not honored for the compilation. These include libboost_math_tr1-mt.a
, libboost_program_options-mt.a
, libboost_signals-mt.a
, libboost_locale-mt.a
and others.
Note:
See TracTickets
for help on using tickets.