summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Eatmon <reatmon@ti.com>2024-11-04 15:15:31 -0600
committerRyan Eatmon <reatmon@ti.com>2024-11-06 13:48:12 -0600
commit64ee95d661eebb5b09d00c86cd09d4a2c3c5971b (patch)
treeac99c90e0b8520e35e4e6c0440fd9b2a024fa465
parent3881f1381e735cdbf3d66fb1539c296128f01afe (diff)
downloadmeta-ti-64ee95d661eebb5b09d00c86cd09d4a2c3c5971b.tar.gz
mesa-pvr-22.3.5: 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-22.3.5/0001-fix-gallivm-fix-LLVM-include-of-Host-h-moved-to-TargetParser.patch65
-rw-r--r--meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-gallium-Fix-build-with-llvm-18-and-19.patch53
-rw-r--r--meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_22.3.5.bb2
3 files changed, 120 insertions, 0 deletions
diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-fix-gallivm-fix-LLVM-include-of-Host-h-moved-to-TargetParser.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-fix-gallivm-fix-LLVM-include-of-Host-h-moved-to-TargetParser.patch
new file mode 100644
index 00000000..7d4fe078
--- /dev/null
+++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-fix-gallivm-fix-LLVM-include-of-Host-h-moved-to-TargetParser.patch
@@ -0,0 +1,65 @@
1From bb2db56ffec6e527d88751f75117ae690227cd6c Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= <kai@dev.carbon-project.org>
3Date: Sat, 11 Feb 2023 18:38:01 +0100
4Subject: [PATCH] fix: gallivm: fix LLVM #include of Host.h, moved to
5 TargetParser
6
7Upstream moved Host.h from Support to TargetParser in LLVM 17.
8
9This shouldn't lead to a FTBFS, since there is a forwarding include left
10behind. Sadly the added deprecation warning #pragma is invalid and thus
11causes a build failure right away. But since we would have to follow the
12move anyway in the future, just do it right away.
13
14Reference: https://github.com/llvm/llvm-project/commit/d768bf994f508d7eaf9541a568be3d71096febf5
15Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
16Closes: #8275
17Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21263>
18
19Upstream-Status: Backport [https://gitlab.freedesktop.org/mesa/mesa/-/commit/bb2db56ffec6e527d88751f75117ae690227cd6c]
20
21---
22 src/gallium/auxiliary/gallivm/lp_bld_debug.cpp | 7 ++++++-
23 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 4 +++-
24 2 files changed, 9 insertions(+), 2 deletions(-)
25
26diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
27index 54bc5d5ada36c..f78f04f042be8 100644
28--- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
29+++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
30@@ -35,9 +35,14 @@
31 #include <llvm-c/Disassembler.h>
32 #include <llvm/Support/raw_ostream.h>
33 #include <llvm/Support/Format.h>
34-#include <llvm/Support/Host.h>
35 #include <llvm/IR/Module.h>
36
37+#if LLVM_VERSION_MAJOR >= 17
38+#include <llvm/TargetParser/Host.h>
39+#else
40+#include <llvm/Support/Host.h>
41+#endif
42+
43 #include "util/u_math.h"
44 #include "util/u_debug.h"
45
46diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
47index 334c13530394b..5e7a30a6cc2e3 100644
48--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
49+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
50@@ -60,7 +60,11 @@
51 #include <llvm/Analysis/TargetLibraryInfo.h>
52 #include <llvm/ExecutionEngine/SectionMemoryManager.h>
53 #include <llvm/Support/CommandLine.h>
54+#if LLVM_VERSION_MAJOR >= 17
55+#include <llvm/TargetParser/Host.h>
56+#else
57 #include <llvm/Support/Host.h>
58+#endif
59 #include <llvm/Support/PrettyStackTrace.h>
60 #include <llvm/ExecutionEngine/ObjectCache.h>
61 #include <llvm/Support/TargetSelect.h>
62
63--
64GitLab
65
diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-gallium-Fix-build-with-llvm-18-and-19.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/0001-gallium-Fix-build-with-llvm-18-and-19.patch
new file mode 100644
index 00000000..37888c34
--- /dev/null
+++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-22.3.5/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@@ -368,7 +368,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 #ifdef _WIN32
33 /*
34@@ -392,8 +396,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_22.3.5.bb b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_22.3.5.bb
index c93d01f9..bdc9ce16 100644
--- a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_22.3.5.bb
+++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_22.3.5.bb
@@ -19,6 +19,8 @@ SRC_URI = " \
19 file://0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch \ 19 file://0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch \
20 file://0001-gallium-Fix-build-with-llvm-17.patch \ 20 file://0001-gallium-Fix-build-with-llvm-17.patch \
21 file://0001-fix-gallivm-limit-usage-of-LLVMContextSetOpaquePoint.patch \ 21 file://0001-fix-gallivm-limit-usage-of-LLVMContextSetOpaquePoint.patch \
22 file://0001-fix-gallivm-fix-LLVM-include-of-Host-h-moved-to-TargetParser.patch \
23 file://0001-gallium-Fix-build-with-llvm-18-and-19.patch \
22" 24"
23 25
24S = "${WORKDIR}/git" 26S = "${WORKDIR}/git"