Boost logo

Boost-Build :

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2005-01-16 14:09:09

If you create a library from object files (that are listed in the
Jamfile explicitly), the -fPIC flag is not used when compiling a shared
library (I'm using the gcc toolset)

I have attached a small test-case that shows the problem. My Jamfile
looks like

object bar_object : bar.cpp ;
lib libbar : bar_object ;

lib libfoo : foo.cpp ;

When compiling the intermediate foo.o object-file, the -fPIC flag is
used when creating a shared libfoo library. When creating a shared
libbar library however, the -fPIC flag is not used when compiling the
bar.o object file '-(

The solution I see is adding following to gcc.jam
if [ ] != CYGWIN && [ ] != NT
flags gcc.compile OPTIONS <link>shared/<main-target-type>LIB : -fPIC ;
+ flags gcc.compile OPTIONS <link>shared/<main-target-type>OBJ : -fPIC ;

Can anybody tell me if this is indeed the way to go?
 --------------060801080008060008080802 Content-Type: application/octet-stream;
Content-Transfer-Encoding: base64
Content-Disposition: attachment;

[Attachment content not displayed.] --------------060801080008060008080802--

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