|
Boost : |
Subject: Re: [boost] Clang on Windows
From: Edward Diener (eldiener_at_[hidden])
Date: 2018-03-09 21:13:15
On 3/9/2018 3:02 PM, John Maddock via Boost wrote:
>
>>   The clang-win toolset is known to be broken. I don't
>> know if it ever worked. I believe that clang-linux
>> (using regular clang, not clang-cl) works for most
>> platforms other than OSX. (Yes, I know, cleaning up
>> this mess is on my todo list.)
>
> Using:
>
> using clang : : "C:/Program Files/LLVM/bin/clang-cl.exe" :
> <compatibility>vc14.1 ;
My use of clang-cl with clang-5.0 for x32 compilation looks like:
using clang : 5.0cl : C:/Utilities/LLVM/500/x32/bin/clang++
:
<cxxflags>-fmacro-backtrace-limit=0
<cxxflags>-Wno-invalid-token-paste
<compileflags>-fmsc-version=1900
<compileflags>--target=i686-pc-windows-msvc
<linkflags>--target=i686-pc-windows-msvc
<linkflags>-fuse-ld=lld
;
It works for me pretty well when invoked as toolset=clang-5.0cl on the
b2 command line. Before invoking b2 I am also doing:
call "C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\vcvarsall.bat" x86
in order to setup vc++.
For x64 compilation it looks like:
using clang : 5.0x64cl : C:/Utilities/LLVM/500/x64/bin/clang++
:
<cxxflags>-fmacro-backtrace-limit=0
<cxxflags>-Wno-invalid-token-paste
<compileflags>-fmsc-version=1900
<compileflags>--target=x86_64-pc-windows-msvc
<linkflags>--target=x86_64-pc-windows-msvc
<linkflags>-fuse-ld=lld
;
invoked on the b2 command line as toolset=clang-5.0x64cl. Before
invoking b2 I am also doing:
call "C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\vcvarsall.bat" amd64
in order to setup vc++.
Needless to say I have other using statements for clang with gcc for
various C++ standard levels in the same user-config.jam.
I am pretty sure to use the same type of setup with the recently
released 6.0 on Windows.
Maybe these will help you.
>
> Results in:
>
> $ ../../../b2 config_info clang
> C:\cygwin64\home\John\user-config.jam:47: Unescaped special character in
> argument <cxxflags>-std:c++latest
> ..\..\..\libs\log\build\Jamfile.v2:45: Unescaped special character in
> argument <define>$(flag)=1
> M:/data/boost/boost/tools/build/src/build\configure.jam:288: in
> try-find-build
> *** argument error
> * rule log-check-result ( result )
> * called with: (Â )
> * missing argument result
> M:/data/boost/boost/tools/build/src/build\configure.jam:86:see
> definition of rule 'log-check-result' being called
> M:/data/boost/boost/tools/build/src/build\configure.jam:391: in
> find-builds-raw
> M:/data/boost/boost/tools/build/src/build\configure.jam:450: in
> configure.find-builds
> M:/data/boost/boost\boostcpp.jam:734: in boostcpp.deduce-address-model
> M:/data/boost/boost/tools/build/src/kernel\modules.jam:107: in
> modules.call-in
> M:/data/boost/boost/tools/build/src/util\indirect.jam:105: in indirect.call
> M:/data/boost/boost/tools/build/src/build\property.jam:144: in
> property.evaluate-conditionals-in-context
> M:/data/boost/boost/tools/build/src/build\targets.jam:1087: in
> evaluate-requirements
> M:/data/boost/boost/tools/build/src/build\targets.jam:1121: in
> common-properties2
> M:/data/boost/boost/tools/build/src/build\targets.jam:1017: in
> targets.common-properties
> M:/data/boost/boost/tools/build/src/build\targets.jam:1313: in
> class_at_basic-target.generate
> M:/data/boost/boost/tools/build/src/build\targets.jam:812: in
> generate-really
> M:/data/boost/boost/tools/build/src/build\targets.jam:784: in
> class_at_main-target.generate
> M:/data/boost/boost/tools/build/src\build-system.jam:797: in load
> M:\data\boost\boost\tools\build\src/kernel\modules.jam:295: in import
> M:\data\boost\boost\tools\build\src/kernel/bootstrap.jam:139: in
> boost-build
> M:\data\boost\boost\boost-build.jam:17: in module scope
>
> Using:
>
> using clang : : "C:/Program Files/LLVM/bin/clang.exe" ;
>
> Does indeed seem to work OK, and as far as I can tell it's clang on top
> of msvc-14.1.
>
>> Â Â They're harmless for now, but will break
>> at some unspecified time in the future, when
>> I switch to the new lexer.
>
> It would help a lot if the message said which characters were special
> and need escaping.
>
> Thanks, John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk