Boost logo

Boost-Build :

From: Mike (mike.otj_at_[hidden])
Date: 2008-03-26 18:25:42


I am attempting to build boost 1.34.1 on 64-bit Linux with bjam v2 passing
the -fPIC compiler option along to gcc/g++. I would like to pass all
necessary bjam parameters via the command line.

After building bjam, I make the following call:

bjam --v2 -d2 --toolset=gcc gcc/variant=release,debug gcc/cflags=-fPIC
gcc/cxxflags=-fPIC gcc/linkflags=-fPIC --build-dir=<my builddir
path> --prefix=<my install path> install

The output from bjam shows that sources compiled for static linking do *not*
have the -fPIC flag. For example:

 "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread
  -DBOOST_ALL_NO_LIB=1 -DNDEBUG -I"." -c -o "<my

This version of execution_monitor.o is put into the
libboost_test_exec_monitor-gcc41-mt-1_34_1.a archive.

Alternatively, sources that are pulled into a shared library have the -fPIC
flag. For example:

 "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -fPIC
"<my builddir>/release/threading-multi/execution_monitor.o"

This version of execution_monitor.o is pulled into

Can anyone tell me why -fPIC is not passed to all calls of g++/gcc?

I am also observing that the -fPIC flag is not passed to any link steps.

Aside: I have already tried to use the bjam v1 syntax to override the
gcc/g++ calls, but it seems as though bjam v1 cannot be invoked.



Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at