KhronosGroup / SPIRV-LLVM-Translator

A tool and a library for bi-directional translation between SPIR-V and LLVM IR
Other
485 stars 218 forks source link

llvm_release_140 branch fails to build with SPIRV Tools integration on Windows with MSVC #1454

Open pal1000 opened 2 years ago

pal1000 commented 2 years ago

General information

svenvh commented 2 years ago

I'm not familiar with MSVC, but it seems that this part of the linker invocation is not understood? -LC:/Software/DEVELO~1/projects/spirv-tools/build/x64/lib -lSPIRV-Tools-opt -lSPIRV-Tools -lSPIRV-Tools-link

Not sure what exactly is going wrong, since we rely on cmake & pkg-config to add the SPIRV-Tools dependency...

pal1000 commented 2 years ago

I switched away from simplified DOS 8.3 path handling thinking it confuses pkgconf, but it didn't help:

FAILED: bin/llvm-spirv.exe
cmd.exe /C "cd . && C:\Software\Development\projects\cmake\bin\cmake.exe -E vs_link_exe --intdir=projects\SPIRV-LLVM-Translator\tools\llvm-spirv\CMakeFiles\llvm-spirv.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~3\2022\BUILDT~1\VC\Tools\MSVC\1431~1.311\bin\Hostx64\x64\link.exe /nologo projects\SPIRV-LLVM-Translator\tools\llvm-spirv\CMakeFiles\llvm-spirv.dir\llvm-spirv.cpp.obj projects\SPIRV-LLVM-Translator\tools\llvm-spirv\CMakeFiles\llvm-spirv.dir\__\__\__\__\resources\windows_version_resource.rc.res  /out:bin\llvm-spirv.exe /implib:lib\llvm-spirv.lib /pdb:bin\llvm-spirv.pdb /version:0.0 /machine:x64 /STACK:10000000 /INCREMENTAL:NO /subsystem:console  lib\LLVMSPIRVLib.lib  lib\LLVMAnalysis.lib  lib\LLVMBitReader.lib  lib\LLVMBitWriter.lib  lib\LLVMCore.lib  lib\LLVMSupport.lib  lib\LLVMTransformUtils.lib  -LC:/Software/Development/projects/spirv-tools/build/x64/lib  -lSPIRV-Tools-opt  -lSPIRV-Tools  -lSPIRV-Tools-link  lib\LLVMCodeGen.lib  lib\LLVMBitWriter.lib  lib\LLVMScalarOpts.lib  lib\LLVMAggressiveInstCombine.lib  lib\LLVMInstCombine.lib  lib\LLVMTarget.lib  lib\LLVMIRReader.lib  lib\LLVMAsmParser.lib  lib\LLVMLinker.lib  lib\LLVMTransformUtils.lib  lib\LLVMAnalysis.lib  lib\LLVMProfileData.lib  lib\LLVMDebugInfoDWARF.lib  lib\LLVMObject.lib  lib\LLVMBitReader.lib  lib\LLVMCore.lib  lib\LLVMRemarks.lib  lib\LLVMBitstreamReader.lib  lib\LLVMMCParser.lib  lib\LLVMMC.lib  lib\LLVMDebugInfoCodeView.lib  lib\LLVMTextAPI.lib  lib\LLVMBinaryFormat.lib  lib\LLVMSupport.lib  lib\LLVMDemangle.lib  psapi.lib  shell32.lib  ole32.lib  uuid.lib  advapi32.lib  delayimp.lib  -delayload:shell32.dll  -delayload:ole32.dll  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK: command "C:\PROGRA~2\MICROS~3\2022\BUILDT~1\VC\Tools\MSVC\1431~1.311\bin\Hostx64\x64\link.exe /nologo projects\SPIRV-LLVM-Translator\tools\llvm-spirv\CMakeFiles\llvm-spirv.dir\llvm-spirv.cpp.obj projects\SPIRV-LLVM-Translator\tools\llvm-spirv\CMakeFiles\llvm-spirv.dir\__\__\__\__\resources\windows_version_resource.rc.res /out:bin\llvm-spirv.exe /implib:lib\llvm-spirv.lib /pdb:bin\llvm-spirv.pdb /version:0.0 /machine:x64 /STACK:10000000 /INCREMENTAL:NO /subsystem:console lib\LLVMSPIRVLib.lib lib\LLVMAnalysis.lib lib\LLVMBitReader.lib lib\LLVMBitWriter.lib lib\LLVMCore.lib lib\LLVMSupport.lib lib\LLVMTransformUtils.lib -LC:/Software/Development/projects/spirv-tools/build/x64/lib -lSPIRV-Tools-opt -lSPIRV-Tools -lSPIRV-Tools-link lib\LLVMCodeGen.lib lib\LLVMBitWriter.lib lib\LLVMScalarOpts.lib lib\LLVMAggressiveInstCombine.lib lib\LLVMInstCombine.lib lib\LLVMTarget.lib lib\LLVMIRReader.lib lib\LLVMAsmParser.lib lib\LLVMLinker.lib lib\LLVMTransformUtils.lib lib\LLVMAnalysis.lib lib\LLVMProfileData.lib lib\LLVMDebugInfoDWARF.lib lib\LLVMObject.lib lib\LLVMBitReader.lib lib\LLVMCore.lib lib\LLVMRemarks.lib lib\LLVMBitstreamReader.lib lib\LLVMMCParser.lib lib\LLVMMC.lib lib\LLVMDebugInfoCodeView.lib lib\LLVMTextAPI.lib lib\LLVMBinaryFormat.lib lib\LLVMSupport.lib lib\LLVMDemangle.lib psapi.lib shell32.lib ole32.lib uuid.lib advapi32.lib delayimp.lib -delayload:shell32.dll -delayload:ole32.dll kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:bin\llvm-spirv.exe.manifest" failed (exit code 1120) with the following output:
LINK : warning LNK4044: unrecognized option '/LC:/Software/Development/projects/spirv-tools/build/x64/lib'; ignored
LINK : warning LNK4044: unrecognized option '/lSPIRV-Tools-opt'; ignored
LINK : warning LNK4044: unrecognized option '/lSPIRV-Tools'; ignored
LINK : warning LNK4044: unrecognized option '/lSPIRV-Tools-link'; ignored
llvm-spirv.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl spvtools::SpirvTools::SpirvTools(enum spv_target_env)" (??0SpirvTools@spvtools@@QEAA@W4spv_target_env@@@Z) referenced in function "int __cdecl convertLLVMToSPIRV(class SPIRV::TranslatorOpts const &)" (?convertLLVMToSPIRV@@YAHAEBVTranslatorOpts@SPIRV@@@Z)
llvm-spirv.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl spvtools::SpirvTools::~SpirvTools(void)" (??1SpirvTools@spvtools@@QEAA@XZ) referenced in function "int __cdecl convertLLVMToSPIRV(class SPIRV::TranslatorOpts const &)" (?convertLLVMToSPIRV@@YAHAEBVTranslatorOpts@SPIRV@@@Z)
llvm-spirv.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl spvtools::SpirvTools::SetMessageConsumer(class std::function<void __cdecl(enum spv_message_level_t,char const *,struct spv_position_t const &,char const *)>)" (?SetMessageConsumer@SpirvTools@spvtools@@QEAAXV?$function@$$A6AXW4spv_message_level_t@@PEBDAEBUspv_position_t@@1@Z@std@@@Z) referenced in function "int __cdecl convertLLVMToSPIRV(class SPIRV::TranslatorOpts const &)" (?convertLLVMToSPIRV@@YAHAEBVTranslatorOpts@SPIRV@@@Z)
llvm-spirv.cpp.obj : error LNK2019: unresolved external symbol "public: bool __cdecl spvtools::SpirvTools::Disassemble(unsigned int const *,unsigned __int64,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *,unsigned int)const " (?Disassemble@SpirvTools@spvtools@@QEBA_NPEBI_KPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z) referenced in function "int __cdecl convertLLVMToSPIRV(class SPIRV::TranslatorOpts const &)" (?convertLLVMToSPIRV@@YAHAEBVTranslatorOpts@SPIRV@@@Z)
bin\llvm-spirv.exe : fatal error LNK1120: 4 unresolved externals
ninja: build stopped: subcommand failed.