Downloaded Boost 1.55, loaded using:
./bootstrap.sh --prefix=/usr/local/boost155 cxxflags="-arch i386 -arch x86_64" \ address-model=32_64 threading=multi macos-version=10.8 stage
Built using:
./b2 threading=multi link=static runtime-link=static \ cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++"
Inferior to libboost_chrono.a :
U std::string::_Rep::_M_destroy(std::allocator<char> const&) U std::string::_Rep::_S_empty_rep_storage U std::string::append(char const*, unsigned long) U std::string::append(std::string const&) U std::string::assign(char const*, unsigned long) U std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) U std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)
This means that the library was built with the option -stdlib=libstdc++ - that is, it is associated with the gnu version of the C ++ runtime.
We clean the assembly using:
find . -name \*.o -print0 | xargs -0 rm find . -name \*.a -print0 | xargs -0 rm
If we do not, it will not be restored, and you will receive the same code as before. Then we build with:
./b2 threading=multi link=static runtime-link=static \ cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++"
Inferior to libboost_chrono.a :
U std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*) U std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long) U std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*) U std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) U std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()
This means that it is created against libc++ .
This can be verified using a simple C ++ test program (to specify a link):
#include <string> int main(int argc, char **argv) { std::string s("Hello World"); return 0; } $ make test c++ test.cpp -o test $ nm ./test | c++filt U std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long) U std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string() $ rm test $ make test CXXFLAGS=-stdlib=libstdc++ c++ -stdlib=libstdc++ test.cpp -o test $ nm ./test | c++filt U std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) U std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
so yes, it compiles with the corresponding flag. This means that you must pass -stdlib=libstdc++ to everything you compile if you are using Xcode 5, since now defaults to -stdlib=libc++ . This means that any C ++ libraries dependent on c++ stdlib that you depend on must also be compiled with the same flag.
Be careful with the incremental build of boost - if you do not clear the .o and .a , they will not be recompiled based on the modified flags that save the files as compiled, so if they were compromised, then you run into a problem.