Compilation of the toolchain with dynamic libraries
- Dominant language
- LLVM
- Stars
- 1.5k
- Forks
- 854
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 137
Description
When compiling the SYCL toolchain with option `-DLLVM_LINK_LLVM_DYLIB:BOOL=ON` the compilation fails in the SPIRV tool chain:
```
cd $SYCL_HOME/build
cmake -DCMAKE_BUILD_TYPE=Release \
-DLLVM_EXTERNAL_PROJECTS="llvm-spirv;sycl" \
-DLLVM_EXTERNAL_SYCL_SOURCE_DIR=$SYCL_HOME/sycl \
-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=$SYCL_HOME/llvm-spirv \
-DLLVM_ENABLE_PROJECTS="clang;llvm-spirv;sycl" -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
$SYCL_HOME/llvm
make -j`nproc` sycl-toolchain
[...]
/usr/bin/ld: CMakeFiles/llvm-spirv.dir/llvm-spirv.cpp.o: in function `convertSPIRV()::{lambda(std::ostream&)#1}::operator()(std::ostream&) const [clone .isra.67]':
llvm-spirv.cpp:(.text._ZZL12convertSPIRVvENKUlRSoE_clES_.isra.67+0x42): undefined reference to `SPIRV::convertSpirv(std::istream&, std::ostream&, std::__cxx11::basic_string, std::allocator >&, bool, bool)'
/usr/bin/ld: CMakeFiles/llvm-spirv.dir/llvm-spirv.cpp.o: in function `convertLLVMToSPIRV()':
llvm-spirv.cpp:(.text._ZL18convertLLVMToSPIRVv+0x14b): undefined reference to `llvm::writeSpirv(llvm::Module*, std::ostream&, std::__cxx11::basic_string, std::allocator >&)'
/usr/bin/ld: llvm-spirv.cpp:(.text._ZL18convertLLVMToSPIRVv+0x1d9): undefined reference to `llvm::writeSpirv(llvm::Module*, std::ostream&, std::__cxx11::basic_string, std::allocator >&)'
/usr/bin/ld: llvm-spirv.cpp:(.text._ZL18convertLLVMToSPIRVv+0x207): undefined reference to `SPIRV::SPIRVUseTextFormat'
/usr/bin/ld: CMakeFiles/llvm-spirv.dir/llvm-spirv.cpp.o: in function `convertSPIRVToLLVM()':
llvm-spirv.cpp:(.text._ZL18convertSPIRVToLLVMv+0x78): undefined reference to `llvm::readSpirv(llvm::LLVMContext&, std::istream&, llvm::Module*&, std::__cxx11::basic_string, std::allocator >&)'
/usr/bin/ld: CMakeFiles/llvm-spirv.dir/llvm-spirv.cpp.o: in function `regularizeLLVM()':
llvm-spirv.cpp:(.text._ZL14regularizeLLVMv+0x137): undefined reference to `llvm::regularizeLlvmForSpirv(llvm::Module*, std::__cxx11::basic_string, std::allocator >&)'
collect2: error: ld returned 1 exit status
make[3]: *** [tools/llvm-spirv/tools/llvm-spirv/CMakeFiles/llvm-spirv.dir/build.make:85: bin/llvm-spirv] Error 1
make[2]: *** [CMakeFiles/Makefile2:69666: tools/llvm-spirv/tools/llvm-spirv/CMakeFiles/llvm-spirv.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs...
```
Contributor guide
Assessment
This issue has not been assessed yet.