diff options
author | Simon McVittie <smcv@collabora.com> | 2021-11-08 13:14:59 +0000 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-01-19 23:00:48 +0000 |
commit | 949b5787eec0c8903897b90cf2b4b2611c6407b8 (patch) | |
tree | d09c95b8363d3c55038034fa3e1f6ff75ee77fe3 /meson.build | |
parent | cac6f633b21799bd1ecc35471d73a0bd190ccada (diff) |
meson: Try to link all-targets module if Gallium OpenCL is enabled
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 80817b6e344258ac9b955f824ebf9019a0fc1610.
Resolves: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3962
Resolves: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5609
Signed-off-by: Simon McVittie <smcv@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13720>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 07f681ad5d8..94bbfd35940 100644 --- a/meson.build +++ b/meson.build @@ -1634,7 +1634,7 @@ if with_gallium_opencl 'linker', 'coverage', 'instrumentation', 'ipo', 'irreader', 'lto', 'option', 'objcarcopts', 'profiledata' ] - llvm_optional_modules += ['frontendopenmp'] + llvm_optional_modules += ['all-targets', 'frontendopenmp'] endif if with_clc llvm_modules += ['coverage', 'target', 'linker', 'irreader', 'option', 'libdriver', 'lto'] |