C:\t>clang a.ll \llvm\build\Debug\lib*.lib
warning: overriding the module target triple with x86_64-pc-windows-msvc18.0.0 [-Woverride-module]
1 warning generated.
LLVMSupport.lib(Signals.obj) : error LNK2038: mismatch detected for ‘_ITERATOR_DEBUG_LEVEL’: value ‘2’ doesn’t match value ‘0’ in a-db717b.o
LLVMSupport.lib(Signals.obj) : error LNK2038: mismatch detected for ‘RuntimeLibrary’: value ‘MTd_StaticDebug’ doesn’t match value ‘MT_StaticRelease’ in a-db717b.o
LLVMSupport.lib(Path.obj) : error LNK2038: mismatch detected for ‘_ITERATOR_DEBUG_LEVEL’: value ‘2’ doesn’t match value ‘0’ in a-db717b.o
LLVMSupport.lib(Path.obj) : error LNK2038: mismatch detected for ‘RuntimeLibrary’: value ‘MTd_StaticDebug’ doesn’t match value ‘MT_StaticRelease’ in a-db717b.o
LLVMSupport.lib(raw_ostream.obj) : error LNK2038: mismatch detected for ‘_ITERATOR_DEBUG_LEVEL’: value ‘2’ doesn’t match value ‘0’ in a-db717b.o
That works, thanks! It turns out to be only needed for the compile step, and it requires clang-cl - the option to output intermediate code is then ‘-c -Xclang -emit-llvm’ which will output files with .obj extension, but these are actually intermediate code files that just have to be renamed to .ll before machine code generation and linking.