summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Eatmon <reatmon@ti.com>2024-11-04 13:44:35 -0600
committerRyan Eatmon <reatmon@ti.com>2024-11-06 13:48:12 -0600
commit3881f1381e735cdbf3d66fb1539c296128f01afe (patch)
treea553ec360940bd7f6b3fb03614ace3ea58b05007
parent1e5b17d74c4d5de1a142dbbc75f4316fd8327678 (diff)
downloadmeta-ti-3881f1381e735cdbf3d66fb1539c296128f01afe.tar.gz
mesa-pvr_23.2.1: Fix build issues with llvm 18+
Backport two fixes from the latest mesa project to fix two builds issues related to newer llvm versions. Signed-off-by: Ryan Eatmon <reatmon@ti.com>
-rw-r--r--meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patch53
-rw-r--r--meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb1
2 files changed, 54 insertions, 0 deletions
diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patch
new file mode 100644
index 00000000..ad5059f1
--- /dev/null
+++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patch
@@ -0,0 +1,53 @@
1From 6c5033bb01a3a1341d4db5007586a5f2e2727b0a Mon Sep 17 00:00:00 2001
2From: Ryan Eatmon <reatmon@ti.com>
3Date: Mon, 4 Nov 2024 13:37:29 -0600
4Subject: [PATCH] gallium: Fix build with llvm 18 and 19
5
6- CodeGenOpt::Level changed to CodeGenOoptLevel. [1]
7- llvm::sys::getHostCPUFeatures() now returns the features instead of
8modifying the passed in argument. [2]
9
10Upstream-Status: Backport [1][https://gitlab.freedesktop.org/mesa/mesa/-/commit/f79617fe804ea6524651ff1bc3a91098d3199179]
11Upstream-Status: Backport [2][https://gitlab.freedesktop.org/mesa/mesa/-/commit/fa9cd89a85b904615ebc11da609445b5b751e68d]
12
13Signed-off-by: Ryan Eatmon <reatmon@ti.com>
14---
15 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 14 ++++++++++++--
16 1 file changed, 12 insertions(+), 2 deletions(-)
17
18diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
19index 5e7a30a6cc2..dbc777e3096 100644
20--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
21+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
22@@ -366,7 +366,11 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
23 builder.setEngineKind(EngineKind::JIT)
24 .setErrorStr(&Error)
25 .setTargetOptions(options)
26+#if LLVM_VERSION_MAJOR >= 18
27+ .setOptLevel((CodeGenOptLevel)OptLevel);
28+#else
29 .setOptLevel((CodeGenOpt::Level)OptLevel);
30+#endif
31
32 #if DETECT_OS_WINDOWS
33 /*
34@@ -394,8 +398,14 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
35 * which allows us to enable/disable code generation based
36 * on the results of cpuid on these architectures.
37 */
38- llvm::StringMap<bool> features;
39- llvm::sys::getHostCPUFeatures(features);
40+ #if LLVM_VERSION_MAJOR >= 19
41+ /* llvm-19+ returns StringMap from getHostCPUFeatures.
42+ */
43+ auto features = llvm::sys::getHostCPUFeatures();
44+ #else
45+ llvm::StringMap<bool> features;
46+ llvm::sys::getHostCPUFeatures(features);
47+ #endif
48
49 for (StringMapIterator<bool> f = features.begin();
50 f != features.end();
51--
522.17.1
53
diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb
index 21134bc7..33af456d 100644
--- a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb
+++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb
@@ -16,6 +16,7 @@ SRC_URI = " \
16 file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ 16 file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
17 file://0001-gallium-Fix-build-with-llvm-17.patch \ 17 file://0001-gallium-Fix-build-with-llvm-17.patch \
18 file://0001-meson-Disable-cmake-dependency-detector-for-llvm.patch \ 18 file://0001-meson-Disable-cmake-dependency-detector-for-llvm.patch \
19 file://0001-gallium-Fix-build-with-llvm-18-and-19.patch \
19" 20"
20 21
21S = "${WORKDIR}/git" 22S = "${WORKDIR}/git"