<div dir="ltr">I can't test this since I don't have windows, but I think the problem is the additional directory checks in findVCToolChainViaEnvironment() which don't match his path to cl.exe, i.e., <span style="font-size:12.8px">S:\binaries\x86ret\bin\i386\</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">cl.exe.</span><div><br></div><div> </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 15, 2017 at 9:43 AM, Zachary Turner via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:small">Since we most likely cannot reproduce this without access to this same development environment, I think the easiest way to figure this out would be for Stephan to debug into clang itself.  It definitely sounds like a problem, but I think only you will be able to figure out exactly what it is.  Luckily it should be easy to figure out.  Set a breakpoint in the constructor of MSVCToolChain in clang/lib/Driver/ToolChains/<wbr>MSVC.cpp and see what's going on in there.  Most likely it's the VCToolsInstallDir or VCINSTALLDIR as Reid mentioned.</span> <br></div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 15, 2017 at 9:30 AM Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Aug 14, 2017 at 6:17 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span><div class="gmail_extra">> 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?<br></div><div class="gmail_extra"><br></div></span><div class="gmail_extra">I haven't figured out what changed, but that definitely seems like a regression.</div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>As I read the current code, we search the environment, then we try the new setup config API, and then we try the registry. That seems correct.</div><div><br></div><div>I think the change from 4.0 to 5.0 was that when we look at the environment, we now try these variables in order:</div><div>1. VCToolsInstallDir: this is new</div><div>2. VCINSTALLDIR: we always tried this before PATH</div><div>3. PATH</div><div><br></div><div>Are either of those first two variables set to point to 2013?</div><div><br></div><div>Once clang finds cl.exe it calls GetFileVersionInfoW to work out the version, which should work as intended.</div></div></div></div>
</blockquote></div>
</div></div><br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>