mesa-pvr: Fix build issues with llvm 18+
PATCH 1/1 mesa-pvr: Fix build issues with llvm 18+
Backport two fixes from the latest mesa project to fix two builds issues related to newer llvm versions.
--- ...allium-Fix-build-with-llvm-18-and-19.patch | 53 +++++++++++++++++++ .../recipes-graphics/mesa/mesa-pvr_23.2.1.bb | 1 + 2 files changed, 54 insertions(+) create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patch
meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patch new file +53 -0
@@ -0,0 +1,53 @@ +From 6c5033bb01a3a1341d4db5007586a5f2e2727b0a Mon Sep 17 00:00:00 2001 +From: Ryan Eatmon <[email protected]> +Date: Mon, 4 Nov 2024 13:37:29 -0600 +Subject: [PATCH] gallium: Fix build with llvm 18 and 19 + +- CodeGenOpt::Level changed to CodeGenOoptLevel. [1] +- llvm::sys::getHostCPUFeatures() now returns the features instead of +modifying the passed in argument. [2] + +Upstream-Status: Backport [1][https://gitlab.freedesktop.org/mesa/mesa/-/commit/f79617fe804ea6524651ff1bc3a91098d3199179] +Upstream-Status: Backport [2][https://gitlab.freedesktop.org/mesa/mesa/-/commit/fa9cd89a85b904615ebc11da609445b5b751e68d] + +Signed-off-by: Ryan Eatmon <[email protected]> +--- + src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +index 5e7a30a6cc2..dbc777e3096 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp ++++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +@@ -366,7 +366,11 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, + builder.setEngineKind(EngineKind::JIT) + .setErrorStr(&Error) + .setTargetOptions(options) ++#if LLVM_VERSION_MAJOR >= 18 ++ .setOptLevel((CodeGenOptLevel)OptLevel); ++#else + .setOptLevel((CodeGenOpt::Level)OptLevel); ++#endif + + #if DETECT_OS_WINDOWS + /* +@@ -394,8 +398,14 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, + * which allows us to enable/disable code generation based + * on the results of cpuid on these architectures. + */ +- llvm::StringMap<bool> features; +- llvm::sys::getHostCPUFeatures(features); ++ #if LLVM_VERSION_MAJOR >= 19 ++ /* llvm-19+ returns StringMap from getHostCPUFeatures. ++ */ ++ auto features = llvm::sys::getHostCPUFeatures(); ++ #else ++ llvm::StringMap<bool> features; ++ llvm::sys::getHostCPUFeatures(features); ++ #endif + + for (StringMapIterator<bool> f = features.begin(); + f != features.end(); +-- +2.17.1 +
meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb +1 -0
@@ -16,6 +16,7 @@ SRC_URI = " \ file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ file://0001-gallium-Fix-build-with-llvm-17.patch \ file://0001-meson-Disable-cmake-dependency-detector-for-llvm.patch \ + file://0001-gallium-Fix-build-with-llvm-18-and-19.patch \ " S = "${WORKDIR}/git"
Signature · 1 line
2.17.1
Quoted 74 lines · Ryan Eatmon via lists.yoctoproject.org
Backport two fixes from the latest mesa project to fix two builds issues related to newer llvm versions.
Signed-off-by Ryan Eatmon <[email protected]>--- ...allium-Fix-build-with-llvm-18-and-19.patch | 53 +++++++++++++++++++ .../recipes-graphics/mesa/mesa-pvr_23.2.1.bb | 1 + 2 files changed, 54 insertions(+) create mode 100644 meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patchmeta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patch new file +53
-0@@ -0,0 +1,53 @@ +From 6c5033bb01a3a1341d4db5007586a5f2e2727b0a Mon Sep 17 00:00:00 2001 +From: Ryan Eatmon <[email protected]> +Date: Mon, 4 Nov 2024 13:37:29 -0600 +Subject: [PATCH] gallium: Fix build with llvm 18 and 19 + +- CodeGenOpt::Level changed to CodeGenOoptLevel. [1] +- llvm::sys::getHostCPUFeatures() now returns the features instead of +modifying the passed in argument. [2] + +Upstream-Status: Backport [1][https://gitlab.freedesktop.org/mesa/mesa/-/commit/f79617fe804ea6524651ff1bc3a91098d3199179] +Upstream-Status: Backport [2][https://gitlab.freedesktop.org/mesa/mesa/-/commit/fa9cd89a85b904615ebc11da609445b5b751e68d] + +Signed-off-by: Ryan Eatmon <[email protected]> +--- + src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +index 5e7a30a6cc2..dbc777e3096 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp ++++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +@@ -366,7 +366,11 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, + builder.setEngineKind(EngineKind::JIT) + .setErrorStr(&Error) + .setTargetOptions(options) ++#if LLVM_VERSION_MAJOR >= 18 ++ .setOptLevel((CodeGenOptLevel)OptLevel); ++#else + .setOptLevel((CodeGenOpt::Level)OptLevel); ++#endif + + #if DETECT_OS_WINDOWS + /* +@@ -394,8 +398,14 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, + * which allows us to enable/disable code generation based + * on the results of cpuid on these architectures. + */ +- llvm::StringMap<bool> features; +- llvm::sys::getHostCPUFeatures(features); ++ #if LLVM_VERSION_MAJOR >= 19 ++ /* llvm-19+ returns StringMap from getHostCPUFeatures. ++ */ ++ auto features = llvm::sys::getHostCPUFeatures(); ++ #else ++ llvm::StringMap<bool> features; ++ llvm::sys::getHostCPUFeatures(features); ++ #endif + + for (StringMapIterator<bool> f = features.begin(); + f != features.end(); +-- +2.17.1 +meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb +0
-0
meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb SRC_URI = " \ · line 22
Quoted 7 lines
meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb +1
-0@@ -16,6 +16,7 @@ SRC_URI = " \ file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ file://0001-gallium-Fix-build-with-llvm-17.patch \ file://0001-meson-Disable-cmake-dependency-detector-for-llvm.patch \ + file://0001-gallium-Fix-build-with-llvm-18-and-19.patch \ " S = "${WORKDIR}/git"
Thanks Ryan! Since it's an upstream commit, I can carry it on the powervr mesa branches directly, if that's preferable. Up to you.
Worth noting that in my tests right now I'm seeing a runtime fault. Don't believe it's related to this patch but I would be cautious enabling gallium-llvmpipe at this moment.
Quoted 81 lines · Randolph Sapp
Quoted 80 lines · Ryan Eatmon via lists.yoctoproject.org
Backport two fixes from the latest mesa project to fix two builds issues related to newer llvm versions.
Signed-off-by Ryan Eatmon <[email protected]>--- ...allium-Fix-build-with-llvm-18-and-19.patch | 53 +++++++++++++++++++ .../recipes-graphics/mesa/mesa-pvr_23.2.1.bb | 1 + 2 files changed, 54 insertions(+)create mode 100644
meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patchmeta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patch new file +53
-0@@ -0,0 +1,53 @@ +From 6c5033bb01a3a1341d4db5007586a5f2e2727b0a Mon Sep 17 00:00:00 2001 +From: Ryan Eatmon <[email protected]> +Date: Mon, 4 Nov 2024 13:37:29 -0600 +Subject: [PATCH] gallium: Fix build with llvm 18 and 19 + +- CodeGenOpt::Level changed to CodeGenOoptLevel. [1] +- llvm::sys::getHostCPUFeatures() now returns the features instead of +modifying the passed in argument. [2] + +Upstream-Status: Backport [1][https://gitlab.freedesktop.org/mesa/mesa/-/commit/f79617fe804ea6524651ff1bc3a91098d3199179] +Upstream-Status: Backport [2][https://gitlab.freedesktop.org/mesa/mesa/-/commit/fa9cd89a85b904615ebc11da609445b5b751e68d] + +Signed-off-by: Ryan Eatmon <[email protected]> +--- + src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +index 5e7a30a6cc2..dbc777e3096 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp ++++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +@@ -366,7 +366,11 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, + builder.setEngineKind(EngineKind::JIT) + .setErrorStr(&Error) + .setTargetOptions(options) ++#if LLVM_VERSION_MAJOR >= 18 ++ .setOptLevel((CodeGenOptLevel)OptLevel); ++#else + .setOptLevel((CodeGenOpt::Level)OptLevel); ++#endif + + #if DETECT_OS_WINDOWS + /* +@@ -394,8 +398,14 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, + * which allows us to enable/disable code generation based + * on the results of cpuid on these architectures. + */ +- llvm::StringMap<bool> features; +- llvm::sys::getHostCPUFeatures(features); ++ #if LLVM_VERSION_MAJOR >= 19 ++ /* llvm-19+ returns StringMap from getHostCPUFeatures. ++ */ ++ auto features = llvm::sys::getHostCPUFeatures(); ++ #else ++ llvm::StringMap<bool> features; ++ llvm::sys::getHostCPUFeatures(features); ++ #endif + + for (StringMapIterator<bool> f = features.begin(); + f != features.end(); +-- +2.17.1 +meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb +1
-0@@ -16,6 +16,7 @@ SRC_URI = " \ file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ file://0001-gallium-Fix-build-with-llvm-17.patch \ file://0001-meson-Disable-cmake-dependency-detector-for-llvm.patch \ + file://0001-gallium-Fix-build-with-llvm-18-and-19.patch \ "
Quoted 4 lines
meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb SRC_URI = " \ · line 22
Quoted 1 line
meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb +0
-0S = "${WORKDIR}/git"Thanks Ryan! Since it's an upstream commit, I can carry it on the powervr mesa branches directly, if that's preferable. Up to you.
That's up to you. But you will need to fix both of the versions.
Quoted 3 lines
Worth noting that in my tests right now I'm seeing a runtime fault. Don't believe it's related to this patch but I would be cautious enabling gallium-llvmpipe at this moment.
I'll hold off on accepting it while you fully test it. Just let me know.
Quoted 1 line
Reviewed-by Randolph Sapp <[email protected]>
Signature · 3 lines
Ryan Eatmon [email protected] ----------------------------------------- Texas Instruments, Inc. - LCPD - MGTS
Quoted 82 lines · Ryan Eatmon
Quoted 81 lines · Randolph Sapp
Quoted 80 lines · Ryan Eatmon via lists.yoctoproject.org
Backport two fixes from the latest mesa project to fix two builds issues related to newer llvm versions.
Signed-off-by Ryan Eatmon <[email protected]>--- ...allium-Fix-build-with-llvm-18-and-19.patch | 53 +++++++++++++++++++ .../recipes-graphics/mesa/mesa-pvr_23.2.1.bb | 1 + 2 files changed, 54 insertions(+)create mode 100644
meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patchmeta-ti-bsp/recipes-graphics/mesa/mesa-pvr-23.2.1/0001-gallium-Fix-build-with-llvm-18-and-19.patch new file +53
-0@@ -0,0 +1,53 @@ +From 6c5033bb01a3a1341d4db5007586a5f2e2727b0a Mon Sep 17 00:00:00 2001 +From: Ryan Eatmon <[email protected]> +Date: Mon, 4 Nov 2024 13:37:29 -0600 +Subject: [PATCH] gallium: Fix build with llvm 18 and 19 + +- CodeGenOpt::Level changed to CodeGenOoptLevel. [1] +- llvm::sys::getHostCPUFeatures() now returns the features instead of +modifying the passed in argument. [2] + +Upstream-Status: Backport [1][https://gitlab.freedesktop.org/mesa/mesa/-/commit/f79617fe804ea6524651ff1bc3a91098d3199179] +Upstream-Status: Backport [2][https://gitlab.freedesktop.org/mesa/mesa/-/commit/fa9cd89a85b904615ebc11da609445b5b751e68d] + +Signed-off-by: Ryan Eatmon <[email protected]> +--- + src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +index 5e7a30a6cc2..dbc777e3096 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp ++++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +@@ -366,7 +366,11 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, + builder.setEngineKind(EngineKind::JIT) + .setErrorStr(&Error) + .setTargetOptions(options) ++#if LLVM_VERSION_MAJOR >= 18 ++ .setOptLevel((CodeGenOptLevel)OptLevel); ++#else + .setOptLevel((CodeGenOpt::Level)OptLevel); ++#endif + + #if DETECT_OS_WINDOWS + /* +@@ -394,8 +398,14 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, + * which allows us to enable/disable code generation based + * on the results of cpuid on these architectures. + */ +- llvm::StringMap<bool> features; +- llvm::sys::getHostCPUFeatures(features); ++ #if LLVM_VERSION_MAJOR >= 19 ++ /* llvm-19+ returns StringMap from getHostCPUFeatures. ++ */ ++ auto features = llvm::sys::getHostCPUFeatures(); ++ #else ++ llvm::StringMap<bool> features; ++ llvm::sys::getHostCPUFeatures(features); ++ #endif + + for (StringMapIterator<bool> f = features.begin(); + f != features.end(); +-- +2.17.1 +meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb +1
-0@@ -16,6 +16,7 @@ SRC_URI = " \ file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ file://0001-gallium-Fix-build-with-llvm-17.patch \ file://0001-meson-Disable-cmake-dependency-detector-for-llvm.patch \ + file://0001-gallium-Fix-build-with-llvm-18-and-19.patch \ "
Quoted 6 lines
Quoted 4 lines
meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb SRC_URI = " \ · line 22
Quoted 1 line
meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb +0
-0S = "${WORKDIR}/git"Thanks Ryan! Since it's an upstream commit, I can carry it on the powervr mesa branches directly, if that's preferable. Up to you.
That's up to you. But you will need to fix both of the versions.
Suppose it makes more sense to keep it here then. This is a rather unusual configuration.
Quoted 5 lines
Quoted 3 lines
Worth noting that in my tests right now I'm seeing a runtime fault. Don't believe it's related to this patch but I would be cautious enabling gallium-llvmpipe at this moment.
I'll hold off on accepting it while you fully test it. Just let me know.
Fix for that posted to meta-arago. Good to go here.
Quoted 1 line
Quoted 1 line
Reviewed-by Randolph Sapp <[email protected]>