[llvm-dev] LLVM Build on Windows 10

490 views
Skip to first unread message

Paul C. Anagnostopoulos via llvm-dev

unread,
Mar 4, 2021, 3:44:25 PM3/4/21
to LLVM dev

Well, I emerge from a week of getting my new Windows 10 machine running smoothly. Now I have to tackle the LLVM build. When I do a build, I get a boatload of the following messages. I searched my old machine for settings involving policies, with no luck. I don't recall seeing these when I started building LLVM on my old machine. As always, any help is appreciated and your patience duly noted.

-------------------------------------

CMake Warning (dev) at C:/LLVM/llvm-project/llvm/cmake/modules/TableGen.cmake:94 (add_custom_command):
  Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
  add_custom_command().  Run "cmake --help-policy CMP0116" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.
Call Stack (most recent call first):
  C:/LLVM/llvm-project/mlir/cmake/modules/AddMLIR.cmake:2 (tablegen)
  C:/LLVM/llvm-project/mlir/test/lib/Dialect/Test/CMakeLists.txt:28 (mlir_tablegen)
This warning is for project developers.  Use -Wno-dev to suppress it.

----------------------------------------------

Michael Kruse via llvm-dev

unread,
Mar 4, 2021, 3:57:05 PM3/4/21
to Paul C. Anagnostopoulos, LLVM dev
The warning is brand-new in cmake 2.20, which is not officially
released yet. See
https://cmake.org/cmake/help/latest/policy/CMP0116.html#policy:CMP0116.
You probably have an older cmake on your machine.

Michael

Am Do., 4. März 2021 um 14:44 Uhr schrieb Paul C. Anagnostopoulos via
llvm-dev <llvm...@lists.llvm.org>:

> _______________________________________________
> LLVM Developers mailing list
> llvm...@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

Paul C. Anagnostopoulos via llvm-dev

unread,
Mar 5, 2021, 9:12:56 AM3/5/21
to llvm...@lists.llvm.org
I have only version 3.20.0-rc2 on my new machine. I didn't notice that I
was installing a release candidate. Shall I uninstall it and install the
latest 3.19?

Michael Kruse via llvm-dev

unread,
Mar 5, 2021, 6:09:58 PM3/5/21
to Paul C. Anagnostopoulos, llvm-dev
You could also fix the LLVM build system to work with cmake 2.20, this
could mean to just call cmake_policy as suggested. We would want LLVM
to eventually work with cmake 2.20 anyway.

Michael

Am Fr., 5. März 2021 um 08:13 Uhr schrieb Paul C. Anagnostopoulos via
llvm-dev <llvm...@lists.llvm.org>:
>

Paul C. Anagnostopoulos via llvm-dev

unread,
Mar 6, 2021, 3:47:35 PM3/6/21
to llvm...@lists.llvm.org

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?

[18/356] Linking CXX executable bin\llc.exe
FAILED: bin/llc.exe
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 ."
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:
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
LINK : fatal error LNK1318: Unexpected PDB error; RPC (23) '(0x000006BA)'
[19/356] Linking CXX executable bin\bugpoint.exe
FAILED: bin/bugpoint.exe
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 ."
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:
LINK : bin\bugpoint.exe not found or not built by the last incremental link; performing full link
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
LINK : fatal error LNK1318: Unexpected PDB error; RPC (23) '(0x000006BA)'

Stella Laurenzo via llvm-dev

unread,
Mar 6, 2021, 3:56:49 PM3/6/21
to Paul C. Anagnostopoulos, llvm-dev
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.

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.

Stella Laurenzo via llvm-dev

unread,
Mar 6, 2021, 5:42:01 PM3/6/21
to Paul C. Anagnostopoulos, llvm-dev
(caveat: I am not an expert on msft tool trivia - just been around the block a few times)

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.

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): https://docs.microsoft.com/en-us/cpp/build/how-to-enable-a-64-bit-visual-cpp-toolset-on-the-command-line?view=msvc-160

If you change any of these options, clear your CmakeCache.txt file to make sure everything is reprobed.

On Sat, Mar 6, 2021, 2:19 PM Paul C. Anagnostopoulos <pa...@windfall.com> wrote:

I'm not sure what a "vcvar" is. Here is the command I used to run Cmake:

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

Then I remembered I wanted the 64-bit linker and edited CMakeCache.txt. Why is it using the 32-bit linker?

//Path to a program.
CMAKE_LINKER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/link.exe

Ah, but I see these. Do they matter?

//Flags used by the linker during all build types.
CMAKE_EXE_LINKER_FLAGS:STRING=/machine:X86

...

//Flags used by the linker during the creation of modules during
// all build types.
CMAKE_MODULE_LINKER_FLAGS:STRING=/machine:X86


——————————————————————
Windfall             Paul C. Anagnostopoulos
  —————————————————
      Software       978 369-0839
——————————————————————
My life has been filled with calamities,
some of which actually happened.
—Mark Twain

Guga 'mzimba, sala 'nhliziyo
Reply all
Reply to author
Forward
0 new messages