[cfe-dev] Using Clang 5.0.0 RC2 with MSVC dev builds

Stephan T. Lavavej via cfe-dev cfe-dev at lists.llvm.org
Mon Aug 14 18:04:49 PDT 2017


Hi Clang devs,

I'm trying to use Clang/LLVM with MSVC's STL in order to keep our code conformant and Clang-compatible, and I've encountered a problematic behavior change between Clang 4.0 and 5.0.

The only Visual Studio installation on my machine is VS 2013. (I work on msvcp140.dll, so my life is easier if I avoid anything that installs it system-wide like VS 2015/2017.)

I am NOT using a VS 2013 Developer Command Prompt.

I'm starting with a plain command prompt, using a development build of VS 2017 (somewhat beyond 15.3) by adding it to PATH, INCLUDE, and LIB. (I'm NOT running an installer for this development build, nor am I modifying the registry in any way.) The directory structure of our development build is simple, although it does not correspond to the publicly distributed installer. On my machine, I have S:\binaries\x86ret, with S:\binaries\x86ret\bin\i386\cl.exe containing the x86-native compiler, S:\binaries\x86ret\inc\vector containing my favorite header, and S:\binaries\x86ret\lib\i386\libcpmt.lib containing the STL's static lib. (The CRT's headers and libs are in different directories, but Clang isn't having trouble with INCLUDE and LIB.)

I've also used 7-Zip to extract Clang/LLVM 4.0.1 x64-hosted to a directory, WITHOUT running an installer.

In this scenario, everything works fine, and we've been testing our STL with Clang/LLVM since June (originally 4.0.0, now 4.0.1):

C:\Temp>echo %PATH%
S:\WCFB01\vctools\nonship\bin\x86;S:\binaries\x86ret\bin\i386;S:\WCFB01\vctools\Compiler\Regress\bin\AMD64\xperf;S:\WCFB01\vctools\NonShip\ClangLLVM\bin;C:\Temp\Exec;C:\Temp\git\cmd;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Users\stl\AppData\Local\Microsoft\WindowsApps;;S:\WCFB01\vctools\Compiler\Regress\bin;S:\WCFB01\vctools\Compiler\Regress\bin\AMD64;;S:\WCFB01\tools\perl\bin

C:\Temp>echo %INCLUDE%
S:\binaries\x86ret\atlmfc\include;S:\binaries\x86ret\inc;S:\WCFB01\ExternalApis\Windows\10\sdk\inc;S:\WCFB01\ExternalApis\UnifiedCRT\inc;S:\WCFB01\ExternalAPIs\DirectX\Jun2010\Include;

C:\Temp>echo %LIB%
S:\binaries\x86ret\atlmfc\lib\i386;S:\binaries\x86ret\lib\i386;S:\WCFB01\ExternalApis\Windows\10\sdk\lib\x86;S:\WCFB01\ExternalApis\UnifiedCRT\lib\i386;S:\WCFB01\ExternalApis\NetFX\v4.5\lib\x86;S:\WCFB01\ExternalAPIs\DirectX\Jun2010\Lib\x86;

C:\Temp>type meow.cpp
#include <iostream>
int main() {
#ifdef __clang__
    std::cout << "I am Clang: " << __clang_version__ << "\n";
#elif defined(_MSC_VER)
    std::cout << "I am C1XX: " << _MSC_FULL_VER << "\n";
#else
    std::cout << "I am something else.\n";
#endif
}

C:\Temp>where cl
S:\binaries\x86ret\bin\i386\cl.exe

C:\Temp>where link
S:\binaries\x86ret\bin\i386\link.exe

C:\Temp>cl /EHsc /nologo /W4 /MT meow.cpp && meow
meow.cpp
I am C1XX: 191125614

C:\Temp>where clang-cl
S:\WCFB01\vctools\NonShip\ClangLLVM\bin\clang-cl.exe

C:\Temp>clang-cl -v -m32 /EHsc /nologo /W4 /MT meow.cpp && meow
clang version 4.0.1 (tags/RELEASE_401/final)
Target: i386-pc-windows-msvc
Thread model: posix
InstalledDir: S:\WCFB01\vctools\NonShip\ClangLLVM\bin
 "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\bin\\clang-cl.exe" -cc1 -triple i386-pc-windows-msvc19.11.25614 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -main-file-name meow.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -D_MT -flto-visibility-public-std --dependent-lib=libcmt --dependent-lib=oldnames -stack-protector 2 -fcxx-exceptions -fexceptions -fexternc-nounwind -fms-volatile -fdiagnostics-format msvc -v -dwarf-column-info -debugger-tuning=gdb -resource-dir "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\bin\\..\\lib\\clang\\4.0.1" -internal-isystem "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\bin\\..\\lib\\clang\\4.0.1\\include" -internal-isystem "S:\\binaries\\x86ret\\atlmfc\\include" -internal-isystem "S:\\binaries\\x86ret\\inc" -internal-isystem "S:\\WCFB01\\ExternalApis\\Windows\\10\\sdk\\inc" -internal-isystem "S:\\WCFB01\\ExternalApis\\UnifiedCRT\\inc" -internal-isystem "S:\\WCFB01\\ExternalAPIs\\DirectX\\Jun2010\\Include" -WCL4 -fdeprecated-macro -fdebug-compilation-dir "C:\\Temp" -ferror-limit 19 -fmessage-length 120 -fms-extensions -fms-compatibility -fms-compatibility-version=19.11.25614 -std=c++14 -fdelayed-template-parsing -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o "C:\\Users\\stl\\AppData\\Local\\Temp\\1\\meow-291efe.obj" -x c++ meow.cpp
clang -cc1 version 4.0.1 based upon LLVM 4.0.1 default target x86_64-pc-windows-msvc
#include "..." search starts here:
#include <...> search starts here:
 S:\WCFB01\vctools\NonShip\ClangLLVM\bin\..\lib\clang\4.0.1\include
 S:\binaries\x86ret\atlmfc\include
 S:\binaries\x86ret\inc
 S:\WCFB01\ExternalApis\Windows\10\sdk\inc
 S:\WCFB01\ExternalApis\UnifiedCRT\inc
 S:\WCFB01\ExternalAPIs\DirectX\Jun2010\Include
End of search list.
 "S:\\binaries\\x86ret\\bin\\i386\\link.exe" -out:meow.exe -nologo "C:\\Users\\stl\\AppData\\Local\\Temp\\1\\meow-291efe.obj"
I am Clang: 4.0.1 (tags/RELEASE_401/final)

Observe that my C1XX version, 19.11.25614, is detected by Clang which passes -fms-compatibility-version=19.11.25614 and defaults to -std=c++14. The linker from my development build is also used, S:\binaries\x86ret\bin\i386\link.exe.

Next, I deleted everything in S:\WCFB01\vctools\NonShip\ClangLLVM\, downloaded http://prereleases.llvm.org/5.0.0/rc2/LLVM-5.0.0-rc2-win64.exe (grinding my teeth at non-secure HTTP), and extracted 5.0.0-rc2 there:

S:\WCFB01\vctools\NonShip\ClangLLVM>dir /b

S:\WCFB01\vctools\NonShip\ClangLLVM>7z x C:\Temp\LLVM-5.0.0-rc2-win64.exe -x!Uninstall.exe -x!$PLUGINSDIR\*

7-Zip [64] 16.04 : Copyright (c) 1999-2016 Igor Pavlov : 2016-10-04

Scanning the drive for archives:
1 file, 131097761 bytes (126 MiB)

Extracting archive: C:\Temp\LLVM-5.0.0-rc2-win64.exe
--
Path = C:\Temp\LLVM-5.0.0-rc2-win64.exe
Type = Nsis
Physical Size = 131097761
Method = LZMA:25
Solid = +
Headers Size = 205263
Embedded Stub Size = 114176
SubType = NSIS-3

Everything is Ok

Files: 291
Size:       1096683135
Compressed: 131097761

S:\WCFB01\vctools\NonShip\ClangLLVM>dir /b
bin
include
lib
libexec
msbuild-bin
share
tools

Now in my usual command prompt (where PATH, INCLUDE, and LIB are unchanged):

C:\Temp>where clang-cl
S:\WCFB01\vctools\NonShip\ClangLLVM\bin\clang-cl.exe

C:\Temp>clang-cl -v -m32 /EHsc /nologo /W4 /MT meow.cpp && meow
clang version 5.0.0 (tags/RELEASE_500/rc2)
Target: i386-pc-windows-msvc
Thread model: posix
InstalledDir: S:\WCFB01\vctools\NonShip\ClangLLVM\bin
 "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\bin\\clang-cl.exe" -cc1 -triple i386-pc-windows-msvc18.0.40629 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -main-file-name meow.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -D_MT -flto-visibility-public-std --dependent-lib=libcmt --dependent-lib=oldnames -stack-protector 2 -fcxx-exceptions -fexceptions -fexternc-nounwind -fms-volatile -fdiagnostics-format msvc -v -dwarf-column-info -debugger-tuning=gdb -resource-dir "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\lib\\clang\\5.0.0" -internal-isystem "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\lib\\clang\\5.0.0\\include" -internal-isystem "S:\\binaries\\x86ret\\atlmfc\\include" -internal-isystem "S:\\binaries\\x86ret\\inc" -internal-isystem "S:\\WCFB01\\ExternalApis\\Windows\\10\\sdk\\inc" -internal-isystem "S:\\WCFB01\\ExternalApis\\UnifiedCRT\\inc" -internal-isystem "S:\\WCFB01\\ExternalAPIs\\DirectX\\Jun2010\\Include" -WCL4 -fdeprecated-macro -fdebug-compilation-dir "C:\\Temp" -ferror-limit 19 -fmessage-length 120 -fms-extensions -fms-compatibility -fms-compatibility-version=18.0.40629 -std=c++11 -fno-threadsafe-statics -fdelayed-template-parsing -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o "C:\\Users\\stl\\AppData\\Local\\Temp\\1\\meow-e93677.obj" -x c++ meow.cpp
clang -cc1 version 5.0.0 based upon LLVM 5.0.0-rc2 default target x86_64-pc-windows-msvc
#include "..." search starts here:
#include <...> search starts here:
 S:\WCFB01\vctools\NonShip\ClangLLVM\lib\clang\5.0.0\include
 S:\binaries\x86ret\atlmfc\include
 S:\binaries\x86ret\inc
 S:\WCFB01\ExternalApis\Windows\10\sdk\inc
 S:\WCFB01\ExternalApis\UnifiedCRT\inc
 S:\WCFB01\ExternalAPIs\DirectX\Jun2010\Include
End of search list.
In file included from meow.cpp:1:
In file included from S:\binaries\x86ret\inc\iostream:6:
In file included from S:\binaries\x86ret\inc\istream:6:
In file included from S:\binaries\x86ret\inc\ostream:6:
In file included from S:\binaries\x86ret\inc\ios:6:
In file included from S:\binaries\x86ret\inc\xlocnum:7:
In file included from S:\binaries\x86ret\inc\cmath:617:
In file included from S:\binaries\x86ret\inc\xtgmath.h:9:
S:\binaries\x86ret\inc\xtr1common(199,22) :  error: use of undeclared identifier 'char16_t'
        struct _Is_integral<char16_t>
                            ^
S:\binaries\x86ret\inc\xtr1common(205,22) :  error: use of undeclared identifier 'char32_t'
        struct _Is_integral<char32_t>
                            ^
In file included from meow.cpp:1:
In file included from S:\binaries\x86ret\inc\iostream:6:
In file included from S:\binaries\x86ret\inc\istream:6:
In file included from S:\binaries\x86ret\inc\ostream:6:
In file included from S:\binaries\x86ret\inc\ios:6:
In file included from S:\binaries\x86ret\inc\xlocnum:10:
In file included from S:\binaries\x86ret\inc\streambuf:6:
In file included from S:\binaries\x86ret\inc\xiosbase:6:
In file included from S:\binaries\x86ret\inc\xlocale:8:
In file included from S:\binaries\x86ret\inc\stdexcept:6:
In file included from S:\binaries\x86ret\inc\exception:7:
In file included from S:\binaries\x86ret\inc\type_traits:6:
S:\binaries\x86ret\inc\xstddef(257,2) :  error: 'auto' return without trailing return type; deduced return types are a
      C++14 extension
        auto _Unfancy(_Ptrty _Ptr)
        ^
[...more errors...]

Now I'm getting -fms-compatibility-version=18.0.40629 -std=c++11 which is thoroughly incompatible with my development build's headers (in S:\binaries\x86ret\inc).

Let's add -fms-compatibility-version=19.11.25614 and see what happens:

C:\Temp>clang-cl -v -m32 /EHsc /nologo /W4 /MT -fms-compatibility-version=19.11.25614 meow.cpp && meow
clang version 5.0.0 (tags/RELEASE_500/rc2)
Target: i386-pc-windows-msvc
Thread model: posix
InstalledDir: S:\WCFB01\vctools\NonShip\ClangLLVM\bin
 "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\bin\\clang-cl.exe" -cc1 -triple i386-pc-windows-msvc19.11.25614 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -main-file-name meow.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -D_MT -flto-visibility-public-std --dependent-lib=libcmt --dependent-lib=oldnames -stack-protector 2 -fcxx-exceptions -fexceptions -fexternc-nounwind -fms-volatile -fdiagnostics-format msvc -v -dwarf-column-info -debugger-tuning=gdb -resource-dir "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\lib\\clang\\5.0.0" -internal-isystem "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\lib\\clang\\5.0.0\\include" -internal-isystem "S:\\binaries\\x86ret\\atlmfc\\include" -internal-isystem "S:\\binaries\\x86ret\\inc" -internal-isystem "S:\\WCFB01\\ExternalApis\\Windows\\10\\sdk\\inc" -internal-isystem "S:\\WCFB01\\ExternalApis\\UnifiedCRT\\inc" -internal-isystem "S:\\WCFB01\\ExternalAPIs\\DirectX\\Jun2010\\Include" -WCL4 -fdeprecated-macro -fdebug-compilation-dir "C:\\Temp" -ferror-limit 19 -fmessage-length 120 -fms-extensions -fms-compatibility -fms-compatibility-version=19.11.25614 -std=c++14 -fdelayed-template-parsing -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o "C:\\Users\\stl\\AppData\\Local\\Temp\\1\\meow-06d238.obj" -x c++ meow.cpp
clang -cc1 version 5.0.0 based upon LLVM 5.0.0-rc2 default target x86_64-pc-windows-msvc
#include "..." search starts here:
#include <...> search starts here:
 S:\WCFB01\vctools\NonShip\ClangLLVM\lib\clang\5.0.0\include
 S:\binaries\x86ret\atlmfc\include
 S:\binaries\x86ret\inc
 S:\WCFB01\ExternalApis\Windows\10\sdk\inc
 S:\WCFB01\ExternalApis\UnifiedCRT\inc
 S:\WCFB01\ExternalAPIs\DirectX\Jun2010\Include
End of search list.
 "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\link.exe" -out:meow.exe -nologo "C:\\Users\\stl\\AppData\\Local\\Temp\\1\\meow-06d238.obj"
libcmt.lib(new_scalar.obj) : warning LNK4229: invalid directive '/ThrowingNew' encountered; ignored
libvcruntime.lib(trnsctrl.obj) : warning LNK4229: invalid directive '/GUARDSYM:___CxxFrameHandler,S' encountered; ignored
libvcruntime.lib(trnsctrl.obj) : warning LNK4229: invalid directive '/GUARDSYM:___CxxFrameHandler3,S' encountered; ignored
libvcruntime.lib(trnsctrl.obj) : warning LNK4229: invalid directive '/GUARDSYM:___CxxFrameHandler2,S' encountered; ignored
libvcruntime.lib(trnsctrl.obj) : warning LNK4229: invalid directive '/GUARDSYM:___CxxLongjmpUnwind at 4,S' encountered; ignored
libvcruntime.lib(chandler4.obj) : warning LNK4229: invalid directive '/GUARDSYM:__except_handler4,S' encountered; ignored
libcmt.lib(loadcfg.obj) : error LNK2001: unresolved external symbol ___guard_iat_table
libcmt.lib(loadcfg.obj) : error LNK2001: unresolved external symbol ___guard_iat_count
libcmt.lib(loadcfg.obj) : error LNK2001: unresolved external symbol ___guard_longjmp_table
libcmt.lib(loadcfg.obj) : error LNK2001: unresolved external symbol ___guard_longjmp_count
meow.exe : fatal error LNK1120: 4 unresolved externals
clang-cl.exe: error: linker command failed with exit code 1120 (use -v to see invocation)

That additionally activates -std=c++14, and compilation succeeds. However, VS 2013's linker is used - that's the "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\link.exe" - and it's unable to understand various parts of VS 2017-era libraries.

Trying to add -fuse-ld=S:\binaries\x86ret\bin\i386\link.exe doesn't work:

C:\Temp>clang-cl -v -m32 /EHsc /nologo /W4 /MT -fms-compatibility-version=19.11.25614 -fuse-ld=S:\binaries\x86ret\bin\i386\link.exe meow.cpp && meow
clang version 5.0.0 (tags/RELEASE_500/rc2)
Target: i386-pc-windows-msvc
Thread model: posix
InstalledDir: S:\WCFB01\vctools\NonShip\ClangLLVM\bin
 "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\bin\\clang-cl.exe" -cc1 -triple i386-pc-windows-msvc19.11.25614 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -main-file-name meow.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -D_MT -flto-visibility-public-std --dependent-lib=libcmt --dependent-lib=oldnames -stack-protector 2 -fcxx-exceptions -fexceptions -fexternc-nounwind -fms-volatile -fdiagnostics-format msvc -v -dwarf-column-info -debugger-tuning=gdb -resource-dir "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\lib\\clang\\5.0.0" -internal-isystem "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\lib\\clang\\5.0.0\\include" -internal-isystem "S:\\binaries\\x86ret\\atlmfc\\include" -internal-isystem "S:\\binaries\\x86ret\\inc" -internal-isystem "S:\\WCFB01\\ExternalApis\\Windows\\10\\sdk\\inc" -internal-isystem "S:\\WCFB01\\ExternalApis\\UnifiedCRT\\inc" -internal-isystem "S:\\WCFB01\\ExternalAPIs\\DirectX\\Jun2010\\Include" -WCL4 -fdeprecated-macro -fdebug-compilation-dir "C:\\Temp" -ferror-limit 19 -fmessage-length 120 -fms-extensions -fms-compatibility -fms-compatibility-version=19.11.25614 -std=c++14 -fdelayed-template-parsing -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o "C:\\Users\\stl\\AppData\\Local\\Temp\\1\\meow-74e9f6.obj" -x c++ meow.cpp
clang -cc1 version 5.0.0 based upon LLVM 5.0.0-rc2 default target x86_64-pc-windows-msvc
#include "..." search starts here:
#include <...> search starts here:
 S:\WCFB01\vctools\NonShip\ClangLLVM\lib\clang\5.0.0\include
 S:\binaries\x86ret\atlmfc\include
 S:\binaries\x86ret\inc
 S:\WCFB01\ExternalApis\Windows\10\sdk\inc
 S:\WCFB01\ExternalApis\UnifiedCRT\inc
 S:\WCFB01\ExternalAPIs\DirectX\Jun2010\Include
End of search list.
 "x86_64-pc-windows-msvc-S:\\binaries\\x86ret\\bin\\i386\\link.exe" -out:meow.exe -nologo "C:\\Users\\stl\\AppData\\Local\\Temp\\1\\meow-74e9f6.obj"
clang-cl.exe: error: unable to execute command: program not executable
clang-cl.exe: error: linker command failed with exit code 1 (use -v to see invocation)

Some searching led me to https://github.com/llvm-mirror/clang/commit/635bc7fefc12cc1333ba6ec77e563b7c8af01265 "Accept absolute paths in the -fuse-ld option." so I'm not sure why this doesn't work.

I'm not picky about the linker (and I don't need debug info), so let's try -fuse-ld=lld-link and see what happens:

C:\Temp>clang-cl -v -m32 /EHsc /nologo /W4 /MT -fms-compatibility-version=19.11.25614 -fuse-ld=lld-link meow.cpp && meow
clang version 5.0.0 (tags/RELEASE_500/rc2)
Target: i386-pc-windows-msvc
Thread model: posix
InstalledDir: S:\WCFB01\vctools\NonShip\ClangLLVM\bin
 "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\bin\\clang-cl.exe" -cc1 -triple i386-pc-windows-msvc19.11.25614 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -main-file-name meow.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -D_MT -flto-visibility-public-std --dependent-lib=libcmt --dependent-lib=oldnames -stack-protector 2 -fcxx-exceptions -fexceptions -fexternc-nounwind -fms-volatile -fdiagnostics-format msvc -v -dwarf-column-info -debugger-tuning=gdb -resource-dir "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\lib\\clang\\5.0.0" -internal-isystem "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\lib\\clang\\5.0.0\\include" -internal-isystem "S:\\binaries\\x86ret\\atlmfc\\include" -internal-isystem "S:\\binaries\\x86ret\\inc" -internal-isystem "S:\\WCFB01\\ExternalApis\\Windows\\10\\sdk\\inc" -internal-isystem "S:\\WCFB01\\ExternalApis\\UnifiedCRT\\inc" -internal-isystem "S:\\WCFB01\\ExternalAPIs\\DirectX\\Jun2010\\Include" -WCL4 -fdeprecated-macro -fdebug-compilation-dir "C:\\Temp" -ferror-limit 19 -fmessage-length 120 -fms-extensions -fms-compatibility -fms-compatibility-version=19.11.25614 -std=c++14 -fdelayed-template-parsing -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o "C:\\Users\\stl\\AppData\\Local\\Temp\\1\\meow-1d7183.obj" -x c++ meow.cpp
clang -cc1 version 5.0.0 based upon LLVM 5.0.0-rc2 default target x86_64-pc-windows-msvc
#include "..." search starts here:
#include <...> search starts here:
 S:\WCFB01\vctools\NonShip\ClangLLVM\lib\clang\5.0.0\include
 S:\binaries\x86ret\atlmfc\include
 S:\binaries\x86ret\inc
 S:\WCFB01\ExternalApis\Windows\10\sdk\inc
 S:\WCFB01\ExternalApis\UnifiedCRT\inc
 S:\WCFB01\ExternalAPIs\DirectX\Jun2010\Include
End of search list.
 "S:\\WCFB01\\vctools\\NonShip\\ClangLLVM\\bin\\lld-link" -out:meow.exe -nologo "C:\\Users\\stl\\AppData\\Local\\Temp\\1\\meow-1d7183.obj"
I am Clang: 5.0.0 (tags/RELEASE_500/rc2)

That works, although I'm a little nervous about using this for our whole test suite when it isn't the default.

So my questions are:

1. Why is Clang 5.0 behaving differently from Clang 4.0 here? I see https://github.com/llvm-mirror/clang/blob/master/lib/Driver/ToolChains/MSVC.cpp trying to detect VS 2017 and other versions.

2. Is there a simple way for me to get Clang 4.0's behavior back, where having cl.exe and link.exe on my PATH makes Clang automatically detect the correct -fms-compatibility-version and link.exe to be used?

Thanks,
STL




More information about the cfe-dev mailing list