From 4b692fc7ec96629d385a003f9b732e3e02c50fc7 Mon Sep 17 00:00:00 2001 From: jchzhou Date: Wed, 16 Jul 2025 15:59:56 +0800 Subject: [PATCH] backport a patch for fixing building issues with clang 19+ (cherry picked from commit 24aa07c74f9aee2de4996cf081e438e531e87735) --- 29993.patch | 47 +++++++++++++++++++++++++++++++++++++++++++++++ mesa.spec | 8 +++++++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 29993.patch diff --git a/29993.patch b/29993.patch new file mode 100644 index 0000000..847fce4 --- /dev/null +++ b/29993.patch @@ -0,0 +1,47 @@ +From 5a9c052ba78e5d1b0020b8f8320d211d2205a958 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 1 Jul 2024 23:09:29 -0700 +Subject: [PATCH] amd: Include missing llvm IR header Module.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +With LLVM-19, Module.h header is not being pulled, which results in +compile errors e.g. + +src/amd/llvm/ac_llvm_helper.cpp:102:10: error: no matching function for call to ‘unwrap(LLVMOpaqueModule*&)’ + 102 | unwrap(module)->setTargetTriple(TM->getTargetTriple().getTriple()); + | ~~~~~~^~~~~~~~ +In file included from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/Type.h:18, + from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/DerivedTypes.h:23, + from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/IR/InstrTypes.h:26, + from /mnt/b/yoe/master/build/tmp/work/x86_64-linux/mesa-native/24.0.7/recipe-sysroot-native/usr/include/llvm/Analysis/TargetLibraryInfo.h:14, + from ../mesa-24.0.7/src/amd/llvm/ac_llvm_helper.cpp:8: + +Its getting the definition from llvm/IR/Type.h instead of Module.h and caused +confusion to compiler + +Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11424 + +Signed-off-by: Khem Raj +Reviewed-by: Marek Olšák +Part-of: +--- + src/amd/llvm/ac_llvm_helper.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp +index 5d065279ad1fb..af4a50f8409d5 100644 +--- a/src/amd/llvm/ac_llvm_helper.cpp ++++ b/src/amd/llvm/ac_llvm_helper.cpp +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + #include + #include + #include +-- +GitLab + diff --git a/mesa.spec b/mesa.spec index a721adf..a336c0c 100644 --- a/mesa.spec +++ b/mesa.spec @@ -52,7 +52,7 @@ Name: mesa Summary: Mesa graphics libraries Version: 24.0.3 -Release: 3 +Release: 4 License: MIT URL: http://www.mesa3d.org @@ -64,6 +64,9 @@ Patch3: 0001-llvmpipe-add-loongarch64-basic-support.patch Patch4: 0002-llvmpipe-support-loongarch64-orcjit.patch # https://gitlab.freedesktop.org/mesa/mesa/-/commit/99017891cad55972c26c0ca8354f48e722b37a66 Patch5: backport-pass-priv-instead-NULL-to-radeon_bo_can_reclaim.patch +# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29993/ landed in mesa 24.2 +# for addressing builidng issues after https://github.com/llvm/llvm-project/pull/97159 +Patch6: 29993.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -582,6 +585,9 @@ done %endif %changelog +* Wed Jul 16 2025 jchzhou - 24.0.3-4 +- backport a patch for fixing building issues with clang 19+ + * Mon Dec 23 2024 liweigang - 24.0.3-3 - sync upstream issue -- Gitee