ROCm / HIPIFY

HIPIFY: Convert CUDA to Portable C++ Code
https://rocm.docs.amd.com/projects/HIPIFY/en/latest/
MIT License
524 stars 75 forks source link

[HIPIFY][build] Linking failure against trunk LLVM 15.0.0git #507

Closed emankov closed 2 years ago

emankov commented 2 years ago

[Error log]

/usr/bin/ld: /home/toltec/git/llvm/trunk/dist/lib/libclangDriver.a(MSVC.cpp.o): in function `clang::driver::toolchains::MSVCToolChain::getSubDirectoryPath[abi:cxx11](llvm::SubDirectoryType, llvm::StringRef) const':

MSVC.cpp:(.text._ZNK5clang6driver10toolchains13MSVCToolChain19getSubDirectoryPathB5cxx11EN4llvm16SubDirectoryTypeENS3_9StringRefE+0x3b): undefined reference to `llvm::getSubDirectoryPath(llvm::SubDirectoryType, llvm::ToolsetLayout, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::Triple::ArchType, llvm::StringRef)'

/usr/bin/ld: /home/toltec/git/llvm/trunk/dist/lib/libclangDriver.a(MSVC.cpp.o): in function `clang::driver::toolchains::MSVCToolChain::getSubDirectoryPath[abi:cxx11](llvm::SubDirectoryType, llvm::Triple::ArchType) const':

MSVC.cpp:(.text._ZNK5clang6driver10toolchains13MSVCToolChain19getSubDirectoryPathB5cxx11EN4llvm16SubDirectoryTypeENS3_6Triple8ArchTypeE+0x41): undefined reference to `llvm::getSubDirectoryPath(llvm::SubDirectoryType, llvm::ToolsetLayout, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::Triple::ArchType, llvm::StringRef)'

/usr/bin/ld: /home/toltec/git/llvm/trunk/dist/lib/libclangDriver.a(MSVC.cpp.o): in function `clang::driver::toolchains::MSVCToolChain::getWindowsSDKLibraryPath(llvm::opt::ArgList const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const':

MSVC.cpp:(.text._ZNK5clang6driver10toolchains13MSVCToolChain24getWindowsSDKLibraryPathERKN4llvm3opt7ArgListERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x124): undefined reference to `llvm::getWindowsSDKDir(llvm::vfs::FileSystem&, llvm::Optional<llvm::StringRef>, llvm::Optional<llvm::StringRef>, llvm::Optional<llvm::StringRef>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'

/usr/bin/ld: MSVC.cpp:(.text._ZNK5clang6driver10toolchains13MSVCToolChain24getWindowsSDKLibraryPathERKN4llvm3opt7ArgListERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x2fa): undefined reference to `llvm::appendArchToWindowsSDKLibPath(int, llvm::SmallString<128u>, llvm::Triple::ArchType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'

/usr/bin/ld: /home/toltec/git/llvm/trunk/dist/lib/libclangDriver.a(MSVC.cpp.o): in function `clang::driver::toolchains::MSVCToolChain::useUniversalCRT() const':

MSVC.cpp:(.text._ZNK5clang6driver10toolchains13MSVCToolChain15useUniversalCRTEv+0x22): undefined reference to `llvm::useUniversalCRT(llvm::ToolsetLayout, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::Triple::ArchType, llvm::vfs::FileSystem&)'

/usr/bin/ld: /home/toltec/git/llvm/trunk/dist/lib/libclangDriver.a(MSVC.cpp.o): in function `clang::driver::toolchains::MSVCToolChain::getUniversalCRTLibraryPath(llvm::opt::ArgList const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const':

MSVC.cpp:(.text._ZNK5clang6driver10toolchains13MSVCToolChain26getUniversalCRTLibraryPathERKN4llvm3opt7ArgListERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0xdd): undefined reference to `llvm::getUniversalCRTSdkDir(llvm::vfs::FileSystem&, llvm::Optional<llvm::StringRef>, llvm::Optional<llvm::StringRef>, llvm::Optional<llvm::StringRef>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'

/usr/bin/ld: MSVC.cpp:(.text._ZNK5clang6driver10toolchains13MSVCToolChain26getUniversalCRTLibraryPathERKN4llvm3opt7ArgListERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x15f): undefined reference to `llvm::archToWindowsSDKArch(llvm::Triple::ArchType)'

/usr/bin/ld: /home/toltec/git/llvm/trunk/dist/lib/libclangDriver.a(MSVC.cpp.o): in function `clang::driver::toolchains::MSVCToolChain::AddClangSystemIncludeArgs(llvm::opt::ArgList const&, llvm::SmallVector<char const*, 16u>&) const':

MSVC.cpp:(.text._ZNK5clang6driver10toolchains13MSVCToolChain25AddClangSystemIncludeArgsERKN4llvm3opt7ArgListERNS3_11SmallVectorIPKcLj16EEE+0x6e5): undefined reference to `llvm::getSubDirectoryPath(llvm::SubDirectoryType, llvm::ToolsetLayout, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::Triple::ArchType, llvm::StringRef)'

/usr/bin/ld: MSVC.cpp:(.text._ZNK5clang6driver10toolchains13MSVCToolChain25AddClangSystemIncludeArgsERKN4llvm3opt7ArgListERNS3_11SmallVectorIPKcLj16EEE+0x771): undefined reference to `llvm::getSubDirectoryPath(llvm::SubDirectoryType, llvm::ToolsetLayout, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::Triple::ArchType, llvm::StringRef)'

/usr/bin/ld: MSVC.cpp:(.text._ZNK5clang6driver10toolchains13MSVCToolChain25AddClangSystemIncludeArgsERKN4llvm3opt7ArgListERNS3_11SmallVectorIPKcLj16EEE+0x7de): undefined reference to `llvm::useUniversalCRT(llvm::ToolsetLayout, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::Triple::ArchType, llvm::vfs::FileSystem&)'

/usr/bin/ld: MSVC.cpp:(.text._ZNK5clang6driver10toolchains13MSVCToolChain25AddClangSystemIncludeArgsERKN4llvm3opt7ArgListERNS3_11SmallVectorIPKcLj16EEE+0x8db): undefined reference to `llvm::getWindowsSDKDir(llvm::vfs::FileSystem&, llvm::Optional<llvm::StringRef>, llvm::Optional<llvm::StringRef>, llvm::Optional<llvm::StringRef>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'

/usr/bin/ld: MSVC.cpp:(.text._ZNK5clang6driver10toolchains13MSVCToolChain25AddClangSystemIncludeArgsERKN4llvm3opt7ArgListERNS3_11SmallVectorIPKcLj16EEE+0x1019): undefined reference to `llvm::getUniversalCRTSdkDir(llvm::vfs::FileSystem&, llvm::Optional<llvm::StringRef>, llvm::Optional<llvm::StringRef>, llvm::Optional<llvm::StringRef>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'

/usr/bin/ld: /home/toltec/git/llvm/trunk/dist/lib/libclangDriver.a(MSVC.cpp.o): in function `clang::driver::toolchains::MSVCToolChain::MSVCToolChain(clang::driver::Driver const&, llvm::Triple const&, llvm::opt::ArgList const&)':

MSVC.cpp:(.text._ZN5clang6driver10toolchains13MSVCToolChainC2ERKNS0_6DriverERKN4llvm6TripleERKNS6_3opt7ArgListE+0x582): undefined reference to `llvm::findVCToolChainViaCommandLine(llvm::vfs::FileSystem&, llvm::Optional<llvm::StringRef>, llvm::Optional<llvm::StringRef>, llvm::Optional<llvm::StringRef>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, llvm::ToolsetLayout&)'

/usr/bin/ld: MSVC.cpp:(.text._ZN5clang6driver10toolchains13MSVCToolChainC2ERKNS0_6DriverERKN4llvm6TripleERKNS6_3opt7ArgListE+0x852): undefined reference to `llvm::findVCToolChainViaEnvironment(llvm::vfs::FileSystem&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, llvm::ToolsetLayout&)'

/usr/bin/ld: MSVC.cpp:(.text._ZN5clang6driver10toolchains13MSVCToolChainC2ERKNS0_6DriverERKN4llvm6TripleERKNS6_3opt7ArgListE+0x872): undefined reference to `llvm::findVCToolChainViaSetupConfig(llvm::vfs::FileSystem&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, llvm::ToolsetLayout&)'

/usr/bin/ld: MSVC.cpp:(.text._ZN5clang6driver10toolchains13MSVCToolChainC2ERKNS0_6DriverERKN4llvm6TripleERKNS6_3opt7ArgListE+0x8af): undefined reference to `llvm::findVCToolChainViaRegistry(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, llvm::ToolsetLayout&)'

/usr/bin/ld: /home/toltec/git/llvm/trunk/dist/lib/libclangDriver.a(MSVC.cpp.o): in function `clang::driver::tools::visualstudio::Linker::ConstructJob(clang::driver::Compilation&, clang::driver::JobAction const&, clang::driver::InputInfo const&, llvm::SmallVector<clang::driver::InputInfo, 4u> const&, llvm::opt::ArgList const&, char const*) const':

MSVC.cpp:(.text._ZNK5clang6driver5tools12visualstudio6Linker12ConstructJobERNS0_11CompilationERKNS0_9JobActionERKNS0_9InputInfoERKN4llvm11SmallVectorIS9_Lj4EEERKNSC_3opt7ArgListEPKc+0x1b7): undefined reference to `llvm::archToLegacyVCArch(llvm::Triple::ArchType)'

/usr/bin/ld: MSVC.cpp:(.text._ZNK5clang6driver5tools12visualstudio6Linker12ConstructJobERNS0_11CompilationERKNS0_9JobActionERKNS0_9InputInfoERKN4llvm11SmallVectorIS9_Lj4EEERKNSC_3opt7ArgListEPKc+0x311): undefined reference to `llvm::getSubDirectoryPath(llvm::SubDirectoryType, llvm::ToolsetLayout, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::Triple::ArchType, llvm::StringRef)'

/usr/bin/ld: MSVC.cpp:(.text._ZNK5clang6driver5tools12visualstudio6Linker12ConstructJobERNS0_11CompilationERKNS0_9JobActionERKNS0_9InputInfoERKN4llvm11SmallVectorIS9_Lj4EEERKNSC_3opt7ArgListEPKc+0x3a2): undefined reference to `llvm::getSubDirectoryPath(llvm::SubDirectoryType, llvm::ToolsetLayout, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::Triple::ArchType, llvm::StringRef)'

/usr/bin/ld: MSVC.cpp:(.text._ZNK5clang6driver5tools12visualstudio6Linker12ConstructJobERNS0_11CompilationERKNS0_9JobActionERKNS0_9InputInfoERKN4llvm11SmallVectorIS9_Lj4EEERKNSC_3opt7ArgListEPKc+0x466): undefined reference to `llvm::useUniversalCRT(llvm::ToolsetLayout, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::Triple::ArchType, llvm::vfs::FileSystem&)'

/usr/bin/ld: MSVC.cpp:(.text._ZNK5clang6driver5tools12visualstudio6Linker12ConstructJobERNS0_11CompilationERKNS0_9JobActionERKNS0_9InputInfoERKN4llvm11SmallVectorIS9_Lj4EEERKNSC_3opt7ArgListEPKc+0x25d9): undefined reference to `llvm::getSubDirectoryPath(llvm::SubDirectoryType, llvm::ToolsetLayout, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::Triple::ArchType, llvm::StringRef)'

/usr/bin/ld: /home/toltec/git/llvm/trunk/dist/lib/libclangDriver.a(MSVC.cpp.o): in function `clang::driver::toolchains::MSVCToolChain::computeMSVCVersion(clang::driver::Driver const*, llvm::opt::ArgList const&) const':

MSVC.cpp:(.text._ZNK5clang6driver10toolchains13MSVCToolChain18computeMSVCVersionEPKNS0_6DriverERKN4llvm3opt7ArgListE+0x2bc): undefined reference to `llvm::getSubDirectoryPath(llvm::SubDirectoryType, llvm::ToolsetLayout, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::Triple::ArchType, llvm::StringRef)'

clang-15: error: linker command failed with exit code 1 (use -v to see invocation)

make[2]: *** [CMakeFiles/hipify-clang.dir/build.make:624: hipify-clang] Error 1

make[1]: *** [CMakeFiles/Makefile2:167: CMakeFiles/hipify-clang.dir/all] Error 2

make: *** [Makefile:136: all] Error 2
emankov commented 2 years ago

Fixed with #508 and #509.