Boost logo

Boost :

Subject: Re: [boost] clang-win, again
From: Edward Diener (eldiener_at_[hidden])
Date: 2018-10-25 14:43:07


On 10/25/2018 3:56 AM, degski via Boost wrote:
> On Thu, 25 Oct 2018 at 00:53, Edward Diener via Boost <boost_at_[hidden]>
> wrote:
>
>> On 10/24/2018 6:33 PM, Egor Pugin via Boost wrote:
>>>> Do you mean clang on Windows targeting vc++ or clang on Windows
>>> targeting mingw-64/gcc ?
>>>
>>> clang-vc++ aka clang-cl
>>> In other words clang in VC++ compat mode.
>>>
>>>
>>
>> I have this in user-config.jam for clang 7.0 on Windows targeting vc++ (
>> VC++ compat mode ) :
>>
>> using msvc ;
>>
>> using clang : 7.0 : C:/Utilities/LLVM/700/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
>> ;
>>
>
> You are calling clang++.exe, I doubt this invokes a vc-compatible
> compiler. From what I have seen is that this approach creates some weird
> linux/vc chimaera (all the build paths have some linux reference in it).
> I'm not saying [Peter also seems to have this approach] that this [having
> compatibility mode on] is required, you're indicated progress in the
> PP-realm seem to confirm that.

My understanding, from having previously been active asking questions
on the clang developers mailing list, is that there is absolutely no
difference between clang targeting vc++, which the "--target=" does
above for the compile and the link, and clang-cl. In fact if you look at
a release of LLVM on Windows, which in recent builds defaults to
targeting vc++, you will see that the clang-cl.exe is exactly the same
size as the clang++.exe.

>
> When Boost-1.69-rc comes out I'll waste a few more hours of my life trying
> to compile Boost with Clang, I'll keep you updated. If and when you give it
> another try, I would pass on the advice (and more or less request) from
> STL, that is to actually use VC-15.9 (yes, that's preview) cleanly
> installed, as mixing the old (14.0) and the new, we won't be able to get to
> the bottom of it.

For clang 7.0 I did change to use VS2017 rather than the previously
mentioned VS2015. This also means -fmsc-version=1915 for vc++ 14.1.

>
> I also add C:\Utilities\LLVM\700\x64\bin first in my PATH and I manually
>> invoke:
>>
>> "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
>> amd64
>>
>> before the b2 invocation using toolset=clang-7.0.
>>
>> It is possible that neither of these extra actions are needed.
>>
>
> Your setup is migrated from VS2015. In a clean install of VS2017,
> "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" does
> not exist.The correct path (for x64 host targeting x64) is "C:\Program
> Files (x86)\Microsoft Visual
> Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat". If you use the
> shortcuts in the menu [Windows Key], this problem is solved for you.
>
> You'll need to open a developer command prompt, as, if not, clang (any
> clang) will have a hard time locating the VC-STL and other required
> libraries in the "windows kits" [8.1 or 10.0]. You could/can also add the
> [clang] path afterwards [after opening the build prompt] with 'set
> PATH="C:\Utilities\LLVM\700\x64\bin";%PATH%'. Both these actions are
> required.

I did change to manually invoke vcvars64.bat and, as already explained
in my original response, I always have the appropriate clang bin
directory first in my PATH.

>
> Also possible might be to use the -fmsc-version=1915 for vc++14.1 and
>> invoke the vcvarsall,bat for Microsoft Visual Studio 14.1.
>>
>
> The version you put is only relevant if Boost actually does something with
> the supplied information. In the meanwhile _MSC_VER should give the correct
> info.

The -fms-compatibility compiler option is a clang switch (
https://clang.llvm.org/docs/MSVCCompatibility.html ). I do not think
Boost Build does anything with it.

>
> degski
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk