Boost logo

Boost-Build :

Subject: Re: [Boost-build] fPIC option for boost
From: Ven Tadipatri (ven.tadipatri_at_[hidden])
Date: 2011-01-06 09:50:21


Hi,
    I ran bjam with the -d2 option and I see this in the output.

     "g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -pthread -m64
-fPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_STATIC_LINK=1 -I"." -c -o
"bin.v2/libs/filesystem/build/gcc-4.1.2/debug/address-model-64/link-static/threading-multi/v2/src/v2_operations.o"
"libs/filesystem/v2/src/v2_operations.cpp"
     "g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -pthread -m64
-fPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_STATIC_LINK=1 -I"." -c -o
"bin.v2/libs/filesystem/build/gcc-4.1.2/debug/address-model-64/link-static/runtime-link-static/threading-multi/v2/src/v2_operations.o"
"libs/filesystem/v2/src/v2_operations.cpp"

so it looks like the -fPIC option is being passed to the compiler. And
after I run, I see the libboost-filesystem-1.44.a file was updated.
After running ranlib on the .a file , the error is still the same. Any
ideas?

Thanks,
Ven

On 01/06/2011 05:24 AM, Vladimir Prus wrote:
> On Thursday, January 06, 2011 00:40:13 Ven Tadipatri wrote:
>> Hi,
>> I'm trying to build Boost version 1.44 for CentOS, and though my code
>> compiles against it just fine, at link time it keeps complaining about
>> an fPIC option:
>> [ERROR] /usr/bin/ld: libboost-filesystem-1.44.a(v2_operations.o):
>> relocation R_X86_64_32 against `a local symbol' can not be used when
>> making a shared object; recompile with -fPIC
>> [ERROR] libboost-filesystem-1.44.a: could not read symbols: Bad value
>> [ERROR] collect2: ld returned 1 exit status
>>
>> Here is the command line I'm giving to bjam (v. 3.1.18)
>> bjam address-model=64 cxxflags=-fPIC --user-config=user-config.jam stage
>> variant=debug link=static threading=multi
>>
>> Here is the user-config.jam file
>> using gcc : 4.1 : /usr/bin/gcc :<compileflags>-fPIC;
>>
>> It looks like I'm compiling with the right options, so what's going on?
> For start, please touch v2_operations.cpp, run the above command with the
> extra -d2 option and verify that -fPIC is present in compile command.
>
> Then, run running 'ranlib' on libboost-filesystem-1.44.a
>
> HTH,
> Volodya
>
>


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk