<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">> The `llvm37_32bit/bin/clang-cl.exe -m64` side of the diff is red; the `llvm37_64bit/bin/clang-cl.exe` side is in green.<o:p></o:p></p>
<p class="MsoNormal">> The primary difference seems to be:<o:p></o:p></p>
<p class="MsoNormal">> `llvm37_32bit/bin/clang-cl.exe -m64` chooses `-triple x86_64-pc-windows-msvc18.0.0`<o:p></o:p></p>
<p class="MsoNormal">> `llvm37_64bit/bin/clang-cl.exe` chooses `-triple x86_64-w64-windows-msvc18.0.0`<o:p></o:p></p>
<p class="MsoNormal">><o:p> </o:p></p>
<p class="MsoNormal">> Not sure if this is intended behavior or not, but just thought I'd let you guys know,<o:p></o:p></p>
<p class="MsoNormal">> since from what you guys were saying in IRC it sounded like `llvm37_32bit/bin/clang-cl.exe -m64`<o:p></o:p></p>
<p class="MsoNormal">> is supposed to be equivalent to `llvm37_64bit/bin/clang-cl.exe`. Like I said, I managed to get it<o:p></o:p></p>
<p class="MsoNormal">> building with the settings in the OP, so the difference is not a big deal it seems.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">What's the default triple for llvm37_32bit/bin/clang-cl.exe? –m64 strips the CPU/Arch part of the triple and replaces it with 'x86_64' so I expect the 32-bit triple is something like i586-pc-windows-msvc18.0.0.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I don't see any references to Triple::PC (aside from TripleTest.cpp) and 'w64' looks like it parses as Triple::UnknownVendor so it doesn't seem to make any functional difference to most of the LLVM projects. Is anyone aware of functional
 differences between the 'pc' and 'w64' vendors in other toolchains? <o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> cfe-dev [mailto:cfe-dev-bounces@lists.llvm.org]
<b>On Behalf Of </b>Sean Silva via cfe-dev<br>
<b>Sent:</b> 18 September 2015 05:23<br>
<b>To:</b> llvm-dev; cfe-dev@lists.llvm.org; Hans Wennborg; Nico Weber; Takumi NAKAMURA; brad.king@kitware.com<br>
<b>Subject:</b> Re: [cfe-dev] Heads up: Bug in CMake found when attempting 64-bit build with 32-bit clang-cl.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">btw, Hans, Nico: I noticed that we are using a different triple with `llvm37_32bit/bin/clang-cl.exe -m64` vs `llvm37_64bit/bin/clang-cl.exe`.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="http://i.imgur.com/eJXf2XN.png">http://i.imgur.com/eJXf2XN.png</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">The `llvm37_32bit/bin/clang-cl.exe -m64` side of the diff is red; the `llvm37_64bit/bin/clang-cl.exe` side is in green.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">The primary difference seems to be:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">`llvm37_32bit/bin/clang-cl.exe -m64` chooses `-triple x86_64-pc-windows-msvc18.0.0`<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">`llvm37_64bit/bin/clang-cl.exe` chooses `-triple x86_64-w64-windows-msvc18.0.0`<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Not sure if this is intended behavior or not, but just thought I'd let you guys know, since from what you guys were saying in IRC it sounded like `llvm37_32bit/bin/clang-cl.exe -m64` is supposed to be equivalent to `llvm37_64bit/bin/clang-cl.exe`.
 Like I said, I managed to get it building with the settings in the OP, so the difference is not a big deal it seems.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-- Sean SIlva<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, Sep 17, 2015 at 9:07 PM, Sean Silva <<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a>> wrote:<o:p></o:p></p>
<div>
<p class="MsoNormal">Hi Nico, Hans, Takumi,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I made it to the bottom of the issue. Turns out that<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">CMAKE_C_FLAGS=-m64<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">CMAKE_CXX_FLAGS=-m64<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">CMAKE_EXE_LINKER_FLAGS=/machine:x64<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">is enough to do a 64-bit build correctly with a 32-bit clang-cl (i.e. one that targets 32-bit by default). Hooray! The missing piece that I had to track down is why I would see `deps = msvc` stuff spewing onto my terminal, rather than consumed
 properly by ninja. I noticed that in rules.ninja, CMake had generated:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">msvc_deps_prefix = LINK : error LNK2001: <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">After some hunting in procmon, I found that there was a call to clang-cl done during the configure process that *wasn't including -m64*, leading to a link error. The text of the link error was then being interpreted as a valid output for
 setting msvc_deps_prefix.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Attached is a quick hack patch for CMake that fixes the issue for me locally. Some more details are in the commit message for the patch. It's not ideal by any means... my CMake-fu is weak.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Brad, you seem to be roughly our liaison with the CMake community. Do you know what the next steps are for getting this fixed in CMake upstream?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888">-- Sean Silva<o:p></o:p></span></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>