diff options
author | Ryan Eatmon <reatmon@ti.com> | 2024-11-04 13:44:35 -0600 |
---|---|---|
committer | Ryan Eatmon <reatmon@ti.com> | 2024-11-06 13:48:12 -0600 |
commit | 3881f1381e735cdbf3d66fb1539c296128f01afe (patch) | |
tree | a553ec360940bd7f6b3fb03614ace3ea58b05007 | |
parent | 1e5b17d74c4d5de1a142dbbc75f4316fd8327678 (diff) | |
download | meta-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.patch | 53 | ||||
-rw-r--r-- | meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb | 1 |
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 @@ | |||
1 | From 6c5033bb01a3a1341d4db5007586a5f2e2727b0a Mon Sep 17 00:00:00 2001 | ||
2 | From: Ryan Eatmon <reatmon@ti.com> | ||
3 | Date: Mon, 4 Nov 2024 13:37:29 -0600 | ||
4 | Subject: [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 | ||
8 | modifying the passed in argument. [2] | ||
9 | |||
10 | Upstream-Status: Backport [1][https://gitlab.freedesktop.org/mesa/mesa/-/commit/f79617fe804ea6524651ff1bc3a91098d3199179] | ||
11 | Upstream-Status: Backport [2][https://gitlab.freedesktop.org/mesa/mesa/-/commit/fa9cd89a85b904615ebc11da609445b5b751e68d] | ||
12 | |||
13 | Signed-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 | |||
18 | diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | ||
19 | index 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 | -- | ||
52 | 2.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 | ||
21 | S = "${WORKDIR}/git" | 22 | S = "${WORKDIR}/git" |