Subject: Re: [Boost-build] clang and 'address-model'
From: Jurko GospodnetiÄ (jurko.gospodnetic_at_[hidden])
Date: 2012-07-16 00:37:21
> When doing this, I get "error: unknown target CPU 'i386'" after every
> compile command. The compile commands look like:
> "clang++" -x c++ -O3 -std=c++11 -stdlib=libc++ -O3 -finline-functions
> -Wno-inline -Wall -pedantic -march=i386 -DBOOST_ALL_NO_LIB=1 -DNDEBUG
> -I"." -c -o
> Now, I'm not sure why it is '-march=i386' here instead of '-arch i386' -
> I'm not really sure what -march is for but it doesn't appear to be the
> right one. This can be verified by building something in Xcode / clang
> that has 'Architectures' set to '32-bit Intel', and noticing the compile
> command contains the -arch flag.
> For good measure, the following command does produce i386 static
> binaries with clang on 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 stage
I just checked the Boost Build sources and the -march option is
defined in tools/gcc.jam and is a gcc option documented at:
Never used clang myself, but I understand its idea is to be gcc
compatible. Unfortunately, after 15 minutes of googling I failed to find
any documentation explaining its command-line options. :-(
I guess someone familiar with Clang should update its toolset
definition to use different options.
Hope this helps.
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