I’ve been browsing the LLVM documentation, and I’ve got to ask about the availability of back-ends for Windows. Their examples for getting up and running on Windows still use the Visual Studio linker to create the resulting executable files. The JIT example is much cleaner, but I need to create output PE files, not JIT the code in-process.
What I’d like to ask is if there exists an LLVM backend which can perform virtually all of the necessary functions to go from LLVM IR to executable PE file, including handling the importing of Win32 functions from the kernel, and preferably, handling COM types as well.
Sadly not. LLVM itself doesn’t handle any of the linking stages, it’s just a compiler, so you’ll need to integrate it with the Windows SDK linker, or the linker from MinGW.