Opened 12 years ago

#230 new defect

toolset=clang: 'address-model' uses wrong option

Reported by: Md Abdur Rahim Owned by: somebody
Priority: major Milestone:
Component: component1 Version: 2.0
Keywords: Cc:

Description

When compiling with the following command:

./b2 -d+2 -a toolset=clang cxxflags="-std=c++11 -stdlib=libc++" linkflags="-stdlib=libc++" architecture=x86 address-model=32 macosx-version=10.7

the 'address-model' parameter creates the option '-march' for clang, but this does not work the same as gcc (produces the message "error: unknown target CPU 'i386'").

Upon investigating which option Xcode uses when compiling for different address models, I see it uses the '-arch' option instead. Indeed, the following build command creates i386 static binaries in OS X.

./b2 -d+2 -a toolset=clang cxxflags="-std=c++11 -stdlib=libc++ -arch i386" linkflags="-stdlib=libc++ -arch i386" architecture=x86 macosx-version=10.7

I am not sure if this is a boost build problem or clang problem (if the latter, please let me know and I will report the bug to the clang guys). I also brought this up on the mailing list here: http://lists.boost.org/boost-build/2012/07/26152.php.

Change History (0)

Note: See TracTickets for help on using tickets.