gallium/opencl needs all-targets in llvm_modules
Commit 80817b6e ("meson: Adjust Clover's required LLVM modules") removed all-targets
from llvm_modules
.
I have LLVM 11.1.0 built with multiple targets enabled and -DBUILD_SHARED_LIBS=ON
. When compiling Mesa 21.0.0, linking libMesaOpenCL.so.1.0.0
fails:
/gar/bin/ld: src/gallium/frontends/clover/libclllvm.a(llvm_invocation.cpp.o): in function `LLVMInitializeAllTargets':
/gar/packages/llvm-11.1.0/include/llvm/Config/Targets.def:28: undefined reference to `LLVMInitializeARMTarget'
/gar/bin/ld: /gar/packages/llvm-11.1.0/include/llvm/Config/Targets.def:29: undefined reference to `LLVMInitializeAVRTarget'
/gar/bin/ld: /gar/packages/llvm-11.1.0/include/llvm/Config/Targets.def:30: undefined reference to `LLVMInitializeBPFTarget'
/gar/bin/ld: /gar/packages/llvm-11.1.0/include/llvm/Config/Targets.def:31: undefined reference to `LLVMInitializeHexagonTarget'
...
As Clover calls several of the LLVMInitializeAll*
functions, it does need to be linked with all the target libraries. Or maybe it should only be initializing the default target?