Boost logo

Boost-Build :

Subject: Re: [Boost-build] build for mac os x older targets
From: Søren (sd_at_[hidden])
Date: 2014-10-03 06:55:20


Hi again

I solved it!

I browsed the Internet about this and found others with issues caused by
different default C++ libraries across OS X 10.8 and 10.9.

I then builded Boost using:
./b2 toolset=clang link=static runtime-link=static
macosx-version-min=10.8 cxxflags="-std=c++11 -stdlib=libstdc++ -arch
x86_64" linkflags="-stdlib=libstdc++ -arch x86_64" architecture=x86

and included -stdlib=libstdc++ when building my own program. The default
is libc++ which apparently differs in such a way that link compability
is broken.

Perhaps the relevant maintainers may consider to deal with this in
future boost releases. Either in the documentation and/or in
clang-darwin.jam and darwin.jam.

kind regards
Søren

On 01/10/2014 09:13, Søren wrote:
> Hi All
>
> I have problems building boost static and my app for older versions of
> MacOSX.
>
> I'm running Maverick 10.9.x using the clang compiler included in
> Xcode: Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn).
>
> I'm building boost 1.56 from tar.gz. Static link, only using
> serialization. When I don't worry about the target, it works perfectly
> and runs there successfully on Maverick.
>
> Then I try to build for the previous version 10.8:
> $ ./b2 link=static threading=multi runtime-link=static
> macosx-version-min=10.8
> /Users/sd/Documents/dsp/boost_1_56_0/tools/build/src/build/feature.jam:493:
> in validate-value-string from module feature
> error: "10.8" is not a known value of feature <macosx-version-min>
> error: legal values:
>
> I found a possible fix for that by adding this line to
> tools/build/src/tools/darwin.jam:
> ...
> feature macosx-version-min : : propagated optional ;
> feature.extend macosx-version-min : 10.8 ; ## <-- added line
> ...
>
> Boost then seemingly builds successfully but I have trouble linking
> from my app:
> clang++ main.cpp -v -o testapp -mmacosx-version-min=10.8
> -I../boost_1_56_0 -L../boost_1_56_0/stage/lib -lboost_serialization
>
> ....
> "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld"
> -demangle -dynamic -arch x86_64 -macosx_version_min 10.8.0 -o testapp
> -L../boost_1_56_0/stage/lib
> /var/folders/3z/qn6nhp3103j42b29z1bs6k280000gn/T/main-6804fc.o
> -lboost_serialization -lstdc++ -lSystem
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/lib/darwin/libclang_rt.osx.a
> Undefined symbols for architecture x86_64:
> "boost::archive::basic_binary_oprimitive<boost::archive::binary_oarchive,
> char, std::char_traits<char> >::init()", referenced from:
> boost::archive::binary_oarchive_impl<boost::archive::binary_oarchive,
> char, std::char_traits<char> >::init(unsigned int) in main-6804fc.o
> ....
> ....
> ld: symbol(s) not found for architecture x86_64
>
> Does anyone know about a fix for this?
>
> Thanks in advance
> Søren


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