Dear community people,
I have no problems with TVM running natively on Linux (and it works great!), but now I’m forced to use TVM for delpoyment on Windows. It looks like I’m missing something in my appempt to cross-compile, and therefore kindly asking for a help please.
I’ve built llvm/clang both native and cross-compilation toolchains (x86_64-unknown-linux-gnu and x86_64-w64-mingw32) using the following guide: https://github.com/mstorsjo/llvm-mingw. I defined both ‘target’ and ‘target_host’ as ‘llvm -mtriple=x86_64-w64-mingw32’. But when it comes to
lib.export_library ('/tmp/deploy_lib.dll', cc.cross_compiler ("x86_64-w64-mingw32-clang++",output_format="dll"))
the compilation command
x86_64-w64-mingw-clang++ --shared -fPIC -o /tmp/deploy_lib.dll /tmp/tmpxxx/lib0.o
fails because the lib0.o object file is in Linux ELF format. This lib0.o file is created by llvm_module.cc ‘SaveToFile’ method which runs a llvm pass. What I can’t understand is how can I force it to create the object file in the PE format I need for cross-compiling for the exported dll?
I’d greatly appreciate any help.
Sincerely, Lev.