Subject: Re: [boost] cross-compilation: building boost on linux targetting osx
From: FrÃ©dÃ©ric Bron (frederic.bron_at_[hidden])
Date: 2017-03-04 05:39:14
>> 1. I give toolset clang to bootstrap.sh which sets the toolset to
>> clang in project-config.jam but clang-linux is used:
>> common.mkdir bin.v2/libs/system/build/clang-linux-3.8.1/release
>> Should it be clang-darwin instead?
> bootstrap.sh builds b2 and the set of toolsets used for this is completely
> different than the one Boost.Build has. It needs to be a host native
OK, you're right. I now let it to its default and then change the
default toolset in project-config.jam to the one I want to use for
>> Currently, I am using the following commands to build boost:
>> and run b2:
>> CC="x86_64-apple-darwin13-clang" CFLAGS="-O2 -DNDEBUG"
>> CXX="x86_64-apple-darwin13-clang++-libc++" CXXFLAGS="-O2 -DNDEBUG
> To my knowledge these environment variables aren't used by Boost.Build.
> Aren't they typically used by make, which isn't involved here?
You are right, not used by boost build but I just use to always do
this when I compile libraries because "normal" libraries use
./congiure; make; make install and use these.
> Why not put
> all the compiler flags in user-config.jam? You can use <linkflags> for the
> linker flags. Use quotes like this to reduce repetition: <cxxflags>"-x -y
done, and this seems to have fixed my issues.
The reason I did not do it before was because they are some command
lines options for zlib, bzip2 and iconv:
apprently they do not work very well.
>> ./b2 -d2
> This should make b2 print the full command-line of each command. Have you
> compared that to what you expect?
Yes, I have a full log with all commands. The right compiler is used
but ar and ranlib are not the right ones. I have to re-run them when
it is finished. Instead of linux ar and ranlib, I run
Concerning dependencies, it is in the configure part that it happens
and can be found in bin.v2/config.log
>> boost.locale.iconv=on boost.locale.icu=off boost.locale.std=off
> I have never seen these before. Where are they described?
I have now fixed everything. I found that clang toolsets are broken in
case of cross-compilation. I had to manually modifiy them.
For example, <archiver> and <ranlib> are not used. plain "ar" and
"ranlib" are used.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk