summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/mesa
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-09-29 14:20:49 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-29 23:11:59 +0100
commitab127e266ecd9f1cf6606d77fe1482d5e23abc52 (patch)
treef152135d60b8a1e526b3b6a2217429f262fafd66 /meta/recipes-graphics/mesa
parenta130e8b7987954d5145e288b5144f829c65d504b (diff)
downloadpoky-ab127e266ecd9f1cf6606d77fe1482d5e23abc52.tar.gz
mesa: Fix native build on hosts with llvm-dev installed
This issue is always there, it just shows up with newer LLVM since symbol mismatches are being found otherwise it was happily linking with host libLLVM.so silently. (From OE-Core rev: 941089fa63e2b38608291251d52a354f0f624926) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/mesa')
-rw-r--r--meta/recipes-graphics/mesa/files/0001-meson-Disable-cmake-dependency-detector-for-llvm.patch42
-rw-r--r--meta/recipes-graphics/mesa/mesa.inc1
2 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-graphics/mesa/files/0001-meson-Disable-cmake-dependency-detector-for-llvm.patch b/meta/recipes-graphics/mesa/files/0001-meson-Disable-cmake-dependency-detector-for-llvm.patch
new file mode 100644
index 0000000000..4cded0546d
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-meson-Disable-cmake-dependency-detector-for-llvm.patch
@@ -0,0 +1,42 @@
1From 00d41cd5aa3f4b494dc276c9b4ccdc096310c91f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 28 Sep 2023 15:34:22 -0700
4Subject: [PATCH] meson: use llvm-config instead of cmake to fix linking errors with meson 1.2.1
5
6meson dependency auto dependency detection uses cmake and then
7config-tool to process dependencies, in mesa the logic to detect llvm is
8using auto detection which means if it finds cmake then it will try to
9use cmake method. Cmake method works ok except a case when llvm-dev
10package is installed on the build host then it generates its own
11native.meson file and ignores OE supplied meson.native file which has
12correct llvm-config tool specified which is pointing to llvm-config from
13native sysroot. The generated meson.native file points to one found in
14/usr/bin and there onwards detector finds native install of llvm and
15configures that into building native mesa package.
16
17Since cmake detector does not always work, disable it by default and use
18config-tool which works in all cases. This is suggested in below issues
19too
20
21A similar issue is open in meson upstream [1] and mesa [2]
22
23[1] https://github.com/mesonbuild/meson/issues/10483
24[2] https://gitlab.freedesktop.org/mesa/mesa/-/issues/6738
25
26Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25438]
27
28Signed-off-by: Khem Raj <raj.khem@gmail.com>
29---
30 meson.build | 1 +
31 1 file changed, 1 insertion(+)
32
33--- a/meson.build
34+++ b/meson.build
35@@ -1659,6 +1659,7 @@ with_llvm = false
36 if _llvm.allowed()
37 dep_llvm = dependency(
38 'llvm',
39+ method : host_machine.system() == 'windows' ? 'auto' : 'config-tool',
40 version : _llvm_version,
41 modules : llvm_modules,
42 optional_modules : llvm_optional_modules,
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index 559d445ae5..4e824500dd 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -19,6 +19,7 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
19 file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ 19 file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
20 file://0001-gallium-Fix-build-with-llvm-17.patch \ 20 file://0001-gallium-Fix-build-with-llvm-17.patch \
21 file://0001-intel-Allow-using-intel_clc-from-the-system.patch \ 21 file://0001-intel-Allow-using-intel_clc-from-the-system.patch \
22 file://0001-meson-Disable-cmake-dependency-detector-for-llvm.patch \
22 " 23 "
23 24
24SRC_URI[sha256sum] = "45434ff91a709844130a3174d9c0ef39c6b50725b2bb0c13e736f36134db14ad" 25SRC_URI[sha256sum] = "45434ff91a709844130a3174d9c0ef39c6b50725b2bb0c13e736f36134db14ad"