Linking libclang.dll out of memory with MSVC

For at least a couple of months now, I have been seeing intermittent out of memory errors when linking libclang.dll with MSVC. I’ve seen this on buildbots as well as my local workstation which has 64GB of memory. I’ve seen it with MSVC 2013 as well as MSVC 2015 Update 1.

Does anyone know what might have gone into cause this? It’s brought down the LLDB buildbot pretty much permamently as all builds are now failing with this.

At first it was happening only intermittently much like it happens on my local workstation, but now that it’s surfacing more often, I feel like it’s worth investigating.

First question: Is anyone else seeing this when building with MSVC?
Second question: Any ideas what might have happened in the past couple months to trigger this or how to go about tracking down the cause?

Are you building for 32-bits? By default that uses the 32-bit toolchain and you’re likely running out of address space - especially if you use LTCG. You can build with the 64-bit compiler (and still output 32-bits) which should fix your issue.

More information can be found here:

Yes I’m building for 32 bits. I’m aware of x64 → x86 cross toolchain. Should we consider making that the default toolchain for 32-bit targets across all of LLVM?

Actually I guess it’s not up to CMake to make it the default. It’s up to me to run vcvarsall.bat amd64_x86