<div dir="auto">(caveat: I am not an expert on msft tool trivia - just been around the block a few times)<div dir="auto"><br></div><div dir="auto">By "vcvars", I was referring to the method you used to get a command prompt that had the environment setup to use the VC compiler and linker tools. You may have selected something like a developer command prompt from the start menu, or you may have run a variant of the vcvarsall.bat file that comes with visual studio.</div><div dir="auto"><br></div><div dir="auto">It looks like this page provides some up to date docs (I just have it buried in some startup script and have long since forgotten): <a href="https://docs.microsoft.com/en-us/cpp/build/how-to-enable-a-64-bit-visual-cpp-toolset-on-the-command-line?view=msvc-160">https://docs.microsoft.com/en-us/cpp/build/how-to-enable-a-64-bit-visual-cpp-toolset-on-the-command-line?view=msvc-160</a></div><div dir="auto"><br></div><div dir="auto">If you change any of these options, clear your CmakeCache.txt file to make sure everything is reprobed.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 6, 2021, 2:19 PM Paul C. Anagnostopoulos <<a href="mailto:paul@windfall.com" target="_blank" rel="noreferrer">paul@windfall.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div>
    <p>I'm not sure what a "vcvar" is. Here is the command I used to run
      Cmake:</p>
    <p><font face="monospace">cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug
        -DLLVM_BUILD_DOCS=ON -DLLVM_ENABLE_PROJECTS=Clang;lld;llvm;mlir
        -DLLVM_ENABLE_SPHINX=ON -DSPHINX_WARNINGS_AS_ERRORS=OFF -S
        c:\llvm\llvm-project\llvm</font></p>
    <p>Then I remembered I wanted the 64-bit linker and edited
      CMakeCache.txt. Why is it using the 32-bit linker?<br>
    </p>
    <p><font face="monospace">//Path to a program.<br>
        CMAKE_LINKER:FILEPATH=C:/Program Files (x86)/Microsoft Visual
        Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/link.exe</font><br>
    </p>
    <p>Ah, but I see these. Do they matter?</p>
    <font face="monospace">//Flags used by the linker during all build
      types.<br>
      CMAKE_EXE_LINKER_FLAGS:STRING=/machine:X86<br>
    </font>
    <p><font face="monospace">...</font></p>
    <p><font face="monospace">//Flags used by the linker during the
        creation of modules during<br>
        // all build types.<br>
        CMAKE_MODULE_LINKER_FLAGS:STRING=/machine:X86<br>
      </font><br>
    </p>
    <div>On 3/6/2021 3:56 PM, Stella Laurenzo
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="auto">Could you post the exact commands you are using
        for initializing your vcvars and configuring cmake? I haven't
        built LLVM on Windows in recent weeks but do have some
        experience with it.
        <div dir="auto"><br>
        </div>
        <div dir="auto">My suspicion is that you have initialized the
          vcvars in some way so that it is doing 32bit builds/using
          32bit compiler tools. I exclusively build x64 configurations
          on Windows, and I suspect the error is exactly what it says:
          the 32bit linker cannot access enough heap to finish. A quick
          search online suggests that the automatic fail over to a 64bit
          linker may be a bit unreliable.</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Sat, Mar 6, 2021, 12:47 PM
          Paul C. Anagnostopoulos via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" rel="noreferrer noreferrer" target="_blank">llvm-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>
            <p>I uninstalled Cmake 2.20 and installed 2.19. Then I could
              make some progress. My build is now hanging after a series
              of the following messages. I mean really hanging; I have
              to blow away the process. Does anyone know what a PDB
              error is?<br>
            </p>
            <div><font size="3"><font face="monospace">[18/356] Linking
                  CXX executable bin\llc.exe<br>
                  FAILED: bin/llc.exe<br>
                  cmd.exe /C "cd . && "C:\Program
                  Files\CMake\bin\cmake.exe" -E vs_link_exe
                  --intdir=tools\llc\CMakeFiles\llc.dir
                  --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x86\rc.exe
                  --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x86\mt.exe
                  --manifests  --
C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx86\x86\link.exe
                  /nologo @CMakeFiles\llc.rsp  /out:bin\llc.exe
                  /implib:lib\llc.lib /pdb:bin\llc.pdb /version:0.0
                  /machine:X86 /STACK:10000000 /debug /INCREMENTAL
                  /subsystem:console  && cd ."<br>
                  LINK Pass 1: command
"C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx86\x86\link.exe
                  /nologo @CMakeFiles\llc.rsp /out:bin\llc.exe
                  /implib:lib\llc.lib /pdb:bin\llc.pdb /version:0.0
                  /machine:X86 /STACK:10000000 /debug /INCREMENTAL
                  /subsystem:console /MANIFEST
                  /MANIFESTFILE:tools\llc\CMakeFiles\llc.dir/intermediate.manifest
                  tools\llc\CMakeFiles\llc.dir/manifest.res" failed
                  (exit code 1318) with the following output:<br>
                  LINK : the 32-bit linker
(C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx86\x86\link.exe)
                  ran out of heap space and is going to restart linking
                  with a 64-bit linker<br>
                  LINK : fatal error LNK1318: Unexpected PDB error; RPC
                  (23) '(0x000006BA)'<br>
                  [19/356] Linking CXX executable bin\bugpoint.exe<br>
                  FAILED: bin/bugpoint.exe<br>
                  cmd.exe /C "cd . && "C:\Program
                  Files\CMake\bin\cmake.exe" -E vs_link_exe
                  --intdir=tools\bugpoint\CMakeFiles\bugpoint.dir
                  --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x86\rc.exe
                  --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x86\mt.exe
                  --manifests  --
C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx86\x86\link.exe
                  /nologo @CMakeFiles\bugpoint.rsp 
                  /out:bin\bugpoint.exe /implib:lib\bugpoint.lib
                  /pdb:bin\bugpoint.pdb /version:0.0 /machine:X86
                  /STACK:10000000 /debug /INCREMENTAL
                  /subsystem:console  && cd ."<br>
                  LINK Pass 1: command
"C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx86\x86\link.exe
                  /nologo @CMakeFiles\bugpoint.rsp /out:bin\bugpoint.exe
                  /implib:lib\bugpoint.lib /pdb:bin\bugpoint.pdb
                  /version:0.0 /machine:X86 /STACK:10000000 /debug
                  /INCREMENTAL /subsystem:console /MANIFEST
/MANIFESTFILE:tools\bugpoint\CMakeFiles\bugpoint.dir/intermediate.manifest
                  tools\bugpoint\CMakeFiles\bugpoint.dir/manifest.res"
                  failed (exit code 1318) with the following output:<br>
                  LINK : bin\bugpoint.exe not found or not built by the
                  last incremental link; performing full link<br>
                  LINK : the 32-bit linker
(C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx86\x86\link.exe)
                  ran out of heap space and is going to restart linking
                  with a 64-bit linker<br>
                  LINK : fatal error LNK1318: Unexpected PDB error; RPC
                  (23) '(0x000006BA)'<br>
                </font><br>
              </font> </div>
          </div>
          _______________________________________________<br>
          LLVM Developers mailing list<br>
          <a href="mailto:llvm-dev@lists.llvm.org" rel="noreferrer noreferrer noreferrer" target="_blank">llvm-dev@lists.llvm.org</a><br>
          <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
        </blockquote>
      </div>
    </blockquote>
    <div>
      <font size="3"><br>
        ——————————————————————<br>
        <b><i>Windfall</i></b>             Paul C. Anagnostopoulos<br>
          —————————————————<br>
              <b><i>Software</i></b>       978 369-0839<br>
        ——————————————————————<br>
        My life has been filled with calamities,<br>
        some of which actually happened.<br>
        —Mark Twain <br>
        <br>
        Guga 'mzimba, sala 'nhliziyo
      </font>
    </div>
  </div>

</blockquote></div>