<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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
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-CA" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">I think the linker message occurs because Paul is compiling a 32-bit target (x86). When the 32-bit linker is out-of-space it automatically falls back to the 64-bit linker (x64), thus the message.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Paul, there are several options here. You could perhaps use the 64-bit target instead? Such as:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="mso-fareast-language:EN-US">> mkdir buildVS && cd buildVS<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="mso-fareast-language:EN-US">> cmake -G"Visual Studio 16 2019" -Thost=x64 ../llvm
</span>(your other cmake options)<span style="mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">The default scenario you’re seeing is `cl.exe` using /Zi which offloads the PDB generation to `mspdbsrv.exe`. Since the LLVM libs are quite big, something in there might be running out of memory
in a 32-bit process. You should be fine if switching to 64-bit host processes. <o:p>
</o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Another option is to build with Clang instead of MSVC in which case /Zi is like /Z7.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">There’s already LLVM 10.0 embedded into Visual Studio (ensure it is installed through the VS Installer, click Modify):<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="mso-fareast-language:EN-US">>
</span>cmake -G "Visual Studio 16 2019" -TClangCL ../llvm (your other cmake options)<span style="mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Or download & install the LLVM 11.0 release (and install the “llvm2019” extension in Visual Studio: Extensions menu, Manage Extensions, click “Online” on the left, and use the search box):<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="mso-fareast-language:EN-US"><br>
> </span>cmake -G "Visual Studio 16 2019" -Tllvm ../llvm (your other cmake options)<span style="mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Another other option is to create a secondary build folder and use ninja for building, and VS for editing & debugging. This is the best in terms of iteration times I would say.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">To use MSVC & Ninja you would do:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="mso-fareast-language:EN-US">> mkdir buildninja && cd buildninja<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="mso-fareast-language:EN-US">> cmake -G Ninja ../llvm -DCMAKE_BUILD_TYPE=Debug -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_ENABLE_PROJECTS="clang;lld;llvm" -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_LIBXML2=OFF<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="mso-fareast-language:EN-US">> ninja check-all<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Or if you want to use LLVM 11.0 & Ninja:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="mso-fareast-language:EN-US">> cmake -G Ninja ../llvm -DCMAKE_BUILD_TYPE=Debug -DLLVM_OPTIMIZED_TABLEGEN=ON -DCMAKE_C_COMPILER=”C:/Program Files/LLVM/bin/clang-cl.exe” -DCMAKE_CXX_COMPILER=”C:/Program
Files/LLVM/bin/clang-cl.exe” -DCMAKE_LINKER=”C:/Program Files/LLVM/bin/lld-link.exe” -DLLVM_ENABLE_PROJECTS="clang;lld;llvm" -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_LIBXML2=OFF<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Important - ensure all the above commands run in a Visual Studio cmd prompt, by first launching “x64 Native Tools Command Prompt for VS 2019” from your start menu.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Alex.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b>De :</b> llvm-dev <llvm-dev-bounces@lists.llvm.org> <b>De la part de</b> Adrian McCarthy via llvm-dev<br>
<b>Envoyé :</b> December 8, 2020 5:14 PM<br>
<b>À :</b> Paul C. Anagnostopoulos <paul@windfall.com><br>
<b>Cc :</b> llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Objet :</b> Re: [llvm-dev] Ninja hangs when I try to build<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Sorry, I'm not familiar with "the usual message about switching from the 32-bit to the 64-bit linker." Can you elaborate?<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">> Is there an easy way to turn off PDB creation?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Probably, but I don't know it offhand. The MS linker is going to produce a PDB by default if /DEBUG is specified, and it's pretty common to generate them for "release" builds as well.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">My guess is that you're building multiple configurations at once, and different configurations (e.g., 32- and 64-bit, or debug and release) are trying to write their own PDBs to the same file name. I generally only build one configuration
at a time, and I use ninja (even with MSVC) rather than the Visual Studio solution. Off the top of my head, exactly where the Cmake-generated build configurations try to place the PDBs.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, Dec 8, 2020 at 1:17 PM Paul C. Anagnostopoulos <<a href="mailto:paul@windfall.com">paul@windfall.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt">Thank you! I killed mspdbsrv and things got much further. Now I'm getting the usual message about switching from the 32-bit to the 64-bit linker, and then an "Unexpected PDB error; RPC (23)" message. This has
been going on for awhile. <br>
<br>
Is there an easy way to turn off PDB creation?<br>
<br>
At 12/8/2020 02:17 PM, Adrian McCarthy wrote:<br>
>The program database manager is a separate process VS uses to compile debug info into a PDB. The error happens when it's trying to update a PDB that was created (or last modified) by a newer version of the PDB manager.<br>
><br>
><<a href="https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/fatal-error-c1902?view=msvc-160" target="_blank">https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/fatal-error-c1902?view=msvc-160</a>><a href="https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/fatal-error-c1902?view=msvc-160" target="_blank">https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/fatal-error-c1902?view=msvc-160</a><br>
><br>
>I suspect you have more than one version of VS installed.<br>
><br>
>I would close all instances of Visual Studio, check your environment to ensure that your build is set up to use the specific version you're expecting, and make sure there are no lingering processes running mspdbsrv.exe, and then try again. If the problem
recurs after that, I'd repeat but also delete the PDB files in question and force the compiler to rebuild them from scratch.<o:p></o:p></p>
</blockquote>
</div>
</div>
</body>
</html>