Skip to content

meson: Try to link all-targets module if Gallium OpenCL is enabled

Simon McVittie requested to merge smcv/mesa:issue5609 into main

If we don't do this, and we are statically linking LLVM (-Dshared-llvm=disabled) while using a version of LLVM compiled for a general-purpose distribution, then the link fails with undefined references to the functions called by LLVMInitializeAllTargets().

Using a version of LLVM that was built specifically for Mesa will sometimes mask this: if the only backends built into LLVM are backends that we specifically link anyway, then the link will succeed.

According to commit 80817b6e "meson: Adjust Clover's required LLVM modules", all-targets is not available when using CMake to locate LLVM, so make it optional rather than mandatory.

This partially reverts commit 80817b6e.

Resolves: #3962 (closed)
Resolves: #5609 (closed)
Signed-off-by: Simon McVittie smcv@collabora.com

Edited by Simon McVittie

Merge request reports