CMake Win64 build status

I’m trying to build mainline LLVM (to fold in a fix) and I decided to try the CMake build since that is seemingly going to be the new supported path for Windows builds going forward.

The process of generating the Visual Studio files with CMake was relatively straightforward, and I got a 32-bit x86 build to go through without errors (although I haven’t tested it with my application yet).

The 64-bit build gets caught up on a few errors. First, all of the executables fail to link because of unresolved symbol errors for “_X86TargetMachineModule” and “_X86AsmPrinterForceLink”. I can see where these get set up on the link line in llvm/cmake/modules/LLVMConfig.make file, and I understand why these are required for this build platform.

Unfortunately, it looks like the VS 64-bit compiler assigns symbol names differently from the 32-bit compiler, so where /INCLUDE:_foo was the right thing for 32-bit you seem to need /INCLUDE:foo for 64-bit. Manually editing the generated .vcproj file for llc got me past this error for now.

The next problem I ran into is that the CMake-generated X86.vcproj project doesn’t pull in the llvm/lib/Target/X86/X86CompilationCallback_Win64.asm file. I tried manually adding that file to the project. I must have screwed something up, though, because even though VS claimed to have found a custom build rule for .asm files, it gives a bunch of errors when trying to run the assembler. (Is it possible that it is applying the 32-bit assembler to a 64-bit assembly file?)

I may have to try out the old llvm.sln to see whether I can get a working build out of it… I just wanted to bring these issues up before you close out the 2.5 release! :slight_smile:

  • Tim

Tim Foley <tim.foley.is@gmail.com> writes:

[snip]

Unfortunately, it looks like the VS 64-bit compiler assigns symbol names
differently from the 32-bit compiler, so where /INCLUDE:_foo was the right
thing for 32-bit you seem to need /INCLUDE:foo for 64-bit. Manually editing
the generated .vcproj file for llc got me past this error for now.

I've committed a tentative fix for this.

The next problem I ran into is that the CMake-generated X86.vcproj project
doesn't pull in the llvm/lib/Target/X86/X86CompilationCallback_Win64.asm
file.

This one requires a bit more work. I need to learn if CMake has some
sort of direct support for assembler. If not, a custom command will
do. But I have no much time for experimenting on my slow Windows
machine, so it may miss the 2.5 deadline.

Patches welcome! :slight_smile:

[snip]

I may have to try out the old llvm.sln to see whether I can get a working
build out of it... I just wanted to bring these issues up before you close
out the 2.5 release! :slight_smile:

Thanks for the feedback!