Boost logo

Boost-Build :

Subject: Re: [Boost-build] Cross compiling to 64 bit on 32 bit host
From: Vladimir Prus (ghost_at_[hidden])
Date: 2011-03-18 10:54:16

On Friday, March 18, 2011 17:35:32 Bo Jensen wrote:
> I am trying to build my 64 bit libraries on a 32 bit host and almost
> got it right. I can build correctly with gcc when adding -m64 on the
> commandline, so the libraries are all there. But when I build using
> boost build, the I get the following error :
> /usr/bin/ld:
> /home/bj/sulum/external/boost/bin.v2/libs/thread/build/gcc-4.4.1/release/a
> ddress-model-64/link-static/threading-multi/libboost_thread.a(thread.o):
> relocation R_X86_64_32 against `tls_destructor' can not be used when
> making a shared object; recompile with -fPIC
> /home/bj/sulum/external/boost/bin.v2/libs/thread/build/gcc-4.4.1/release/ad
> dress-model-64/link-static/threading-multi/libboost_thread.a: could not
> read symbols: Bad value
> collect2: ld returned 1 exit status
> I don't think it has any thing to do with thread library, I am missing
> something.
> But all files are being compiled with -fPIC, so I am a bit stuck, any
> pointers appreciated ?

That's a well known issue -- dynamic executable for 64 bit x86 cannot use
non-fPIC code at all, and therefore using static libraries in such build
results in the error you see.

What is the exact command that produces the above error?

Vladimir Prus

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