<div dir="auto">Are you sure you're not just running out of memory?<div dir="auto"><br></div><div dir="auto">If swap is disabled and VS consumes more memory than ninja as a baseline, I guess a memory-demanding compile step could fail like this.</div><div dir="auto"><br></div><div dir="auto">I recently saw similar failures with GCC on Linux for SemaExprMember.cpp on a memory-constrained system.</div><div dir="auto"><br></div><div dir="auto">- Kim</div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Oct 6, 2018, 22:24 Fábio Picchi via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer">cfe-dev@lists.llvm.org</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_default" style="font-family:courier new,monospace;font-size:small;color:#000000">Tried to build clang using the updated Visual Studio 2017 and got the same error.</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:#000000">Good news is that building with ninja worked.</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:#000000">That is quite puzzling... I don't know if anyone else was able to reproduce the issue I was having but it makes zero sense that building with the VS toolset raises a compiler error and building with ninja, using the same compiler, doesn't. I don't know how to further debug this problem but I would love to help if any of you would have a suggestion on how to approach it.</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:#000000"><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Oct 6, 2018 at 8:31 AM Fábio Picchi <<a href="mailto:fabio.exe@gmail.com" rel="noreferrer noreferrer" target="_blank">fabio.exe@gmail.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 dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">My path to cl.exe</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX64\x64\CL.exe</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">> 
If it's running out of heap space on the amd64 native toolchain, it's a 
bug in the compiler because this should not even be theoretically 
possible

</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">I will try to update visual studio to see if the problem is solved. <br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">> 
we can build with ninja

</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">I will also try to build with ninja :) I had never heard about the project!<br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)"><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 4, 2018 at 11:44 AM Zachary Turner <<a href="mailto:zturner@google.com" rel="noreferrer noreferrer" target="_blank">zturner@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">compiler out of heap space is quite interesting.  I can understand the linker running out of heap space, but the compiler is quite unusual.  The first thing I would do is check to make sure you are using the 64-bit host toolchain.  You said you passed -Thost=x64, but let's make sure there's not a bug in the Visual Studio generator or something.<div><br></div><div>Turn on Diagnostic output (Tools -> Options -> Projects & Solutions -> Build and Run -> MSBuild Project Output Verbosity -> Diagnostic) and rebuild.  Then rebuild and wait for the error to happen.  When it does, find the error in the log and scroll up looking for "cl.exe" (or do a reverse find from the end).</div><div><br></div><div>Look at the path to cl.exe.  Is it the one from the amd64 directory or the x86 directory?</div><div><br></div><div>If it's running out of heap space on the amd64 native toolchain, it's a bug in the compiler because this should not even be theoretically possible.  If it's running out of heap space on the x86 toolchain, then the question is why isn't it using the correct toolchain.</div><div><br></div><div>FWIW, I kind of wish we would stop supporting building with the VS generator.  MSBuild doesn't really scale well, and now that VS has support for opening CMake projects directly, and we can build with ninja, I don't see a strong use case for building with MSBuild anymore given how many problems it causes.</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 4, 2018 at 6:24 AM Fábio Picchi via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" rel="noreferrer noreferrer" target="_blank">cfe-dev@lists.llvm.org</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 dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">Updates:</div></div></div><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">> Are you building debug or release? If debug, try building release.</div></div></div><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">I tried and got the same error.</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">I noticed my <b>build target</b> was <b>Win32</b> even though I passed the option -Thost=x64 to cmake. I followed the new instructions to regenerate the solution using:</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)"><span class="m_8161213405679210159m_6796628857111181084m_7336027500368240131m_2138539653079828758m_-2303184047299052870gmail-bright">cmake -G "Visual Studio 15 2017" -A x64 -Thost=x64 ..\llvm</span><span class="m_8161213405679210159m_6796628857111181084m_7336027500368240131m_2138539653079828758m_-2303184047299052870gmail-p"><span class="m_8161213405679210159m_6796628857111181084m_7336027500368240131m_2138539653079828758m_-2303184047299052870gmail-bright"><br></span></span></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">Now the build target is displayed as <b>x64</b>. I tried to build it in Debug mode and still got the dreaded error:</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">C1060: compiler is out of heap space</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">I couldn't check the log errors in detail because I had to leave for work but I'll post more updates in the evening.</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">I will try to do some research on the weekend but it would be great if someone could better explain the out of heap space error. How can the linker run out of memory just by linking binaries? Why is this process so memory intensive? Furthermore, why does it matter if I am targeting x86 or x64? I understand the pointers double in size but that would mean more memory usage for the x64 target, not the x86.</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)">Thank you very much for the help!</div></div></div><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace;font-size:small;color:rgb(0,0,0)"><span class="m_8161213405679210159m_6796628857111181084m_7336027500368240131m_2138539653079828758m_-2303184047299052870gmail-p"><span class="m_8161213405679210159m_6796628857111181084m_7336027500368240131m_2138539653079828758m_-2303184047299052870gmail-bright"></span></span></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 4, 2018 at 4:19 AM Dennis Luehring via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" rel="noreferrer noreferrer" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Am 03.10.2018 um 23:29 schrieb Reid Kleckner via cfe-dev:<br>
> Can anyone who actually knows answer Shaob's question? He asked "Does the<br>
> Win64 generator automatically imply -Thost=x64?<br>
<br>
<br>
CMake gives a warning if not using -Thost=x64 with VS2017 generator <br>
Win64 that i could happen that the x86 tool chain is used - so i think <br>
its not automatically implied<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" rel="noreferrer noreferrer" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer noreferrer noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" rel="noreferrer noreferrer" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer noreferrer noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" rel="noreferrer noreferrer" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer noreferrer noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>