Merge pull request #6537 from lumarogit/mesa

mesa: update fix build with LLVM 17
This commit is contained in:
Luis
2023-09-21 11:07:32 +02:00
committed by GitHub
6 changed files with 14 additions and 72 deletions

View File

@@ -1,2 +1 @@
e3318926ad93230d2bef48ac0ab0d8f1 fix-build-llvm17.patch
6c89b2d1335993d708e1810eacfba9e4 mesa-23.1.8.tar.xz

View File

@@ -1,30 +0,0 @@
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
index 24d0823..97fcfc1 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -42,19 +42,23 @@
#include <llvm/Config/llvm-config.h>
#include <llvm-c/Analysis.h>
+#if LLVM_VERSION_MAJOR < 17
#include <llvm-c/Transforms/Scalar.h>
-#if LLVM_VERSION_MAJOR >= 7
+#endif
+#if LLVM_VERSION_MAJOR >= 7 && LLVM_VERSION_MAJOR < 17
#include <llvm-c/Transforms/Utils.h>
#endif
#include <llvm-c/BitWriter.h>
#if GALLIVM_USE_NEW_PASS == 1
#include <llvm-c/Transforms/PassBuilder.h>
#elif GALLIVM_HAVE_CORO == 1
-#if LLVM_VERSION_MAJOR <= 8 && (DETECT_ARCH_AARCH64 || DETECT_ARCH_ARM || DETECT_ARCH_S390 || DETECT_ARCH_MIPS64)
+#if LLVM_VERSION_MAJOR <= 8 && LLVM_VERSION_MAJOR < 17 && (DETECT_ARCH_AARCH64 || DETECT_ARCH_ARM || DETECT_ARCH_S390 || DETECT_ARCH_MIPS64)
#include <llvm-c/Transforms/IPO.h>
#endif
+#if LLVM_VERSION_MAJOR < 17
#include <llvm-c/Transforms/Coroutines.h>
#endif
+#endif
unsigned gallivm_perf = 0;

View File

@@ -5,19 +5,21 @@
name=mesa
version=23.1.8
release=1
source="https://mesa.freedesktop.org/archive/$name-$version.tar.xz
fix-build-llvm17.patch"
source="https://mesa.freedesktop.org/archive/$name-$version.tar.xz"
build() {
# Fix build with LLVM 17
patch -d $name-$version -Np1 -i $SRC/fix-build-llvm17.patch
cd $name-$version
# Remove two unneeded references to LLVM headers to avoid a build failure with LLVM 17 or later:
sed '/Scalar.h/d;/Utils.h/d' \
-i src/gallium/auxiliary/gallivm/lp_bld_init.c
scratch isinstalled vulkan-icd-loader && OPT_MESA_GALLIUM='zink,'
scratch isinstalled libvdpau && OPT_MESA_VDPAU='-D gallium-vdpau=enabled' || OPT_MESA_VDPAU='-D gallium-vdpau=disabled'
scratch isinstalled libva && OPT_MESA_VAAPI='-D gallium-va=enabled' || OPT_MESA_VAAPI='-D gallium-va=disabled'
scratch isinstalled wayland-protocols && OPT_MESA_PLATFORMS='wayland,x11' || OPT_MESA_PLATFORMS='x11'
venom-meson $name-$version build \
venom-meson build \
-D dri3=enabled \
-D egl=enabled \
-D llvm=enabled \

View File

@@ -1,3 +1,2 @@
0d813aebb105e917340897eecd6010f7 crossfile
e3318926ad93230d2bef48ac0ab0d8f1 fix-build-llvm17.patch
6c89b2d1335993d708e1810eacfba9e4 mesa-23.1.8.tar.xz

View File

@@ -1,30 +0,0 @@
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
index 24d0823..97fcfc1 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -42,19 +42,23 @@
#include <llvm/Config/llvm-config.h>
#include <llvm-c/Analysis.h>
+#if LLVM_VERSION_MAJOR < 17
#include <llvm-c/Transforms/Scalar.h>
-#if LLVM_VERSION_MAJOR >= 7
+#endif
+#if LLVM_VERSION_MAJOR >= 7 && LLVM_VERSION_MAJOR < 17
#include <llvm-c/Transforms/Utils.h>
#endif
#include <llvm-c/BitWriter.h>
#if GALLIVM_USE_NEW_PASS == 1
#include <llvm-c/Transforms/PassBuilder.h>
#elif GALLIVM_HAVE_CORO == 1
-#if LLVM_VERSION_MAJOR <= 8 && (DETECT_ARCH_AARCH64 || DETECT_ARCH_ARM || DETECT_ARCH_S390 || DETECT_ARCH_MIPS64)
+#if LLVM_VERSION_MAJOR <= 8 && LLVM_VERSION_MAJOR < 17 && (DETECT_ARCH_AARCH64 || DETECT_ARCH_ARM || DETECT_ARCH_S390 || DETECT_ARCH_MIPS64)
#include <llvm-c/Transforms/IPO.h>
#endif
+#if LLVM_VERSION_MAJOR < 17
#include <llvm-c/Transforms/Coroutines.h>
#endif
+#endif
unsigned gallivm_perf = 0;

View File

@@ -6,12 +6,14 @@ name=mesa-32
version=23.1.8
release=1
source="https://mesa.freedesktop.org/archive/${name%-*}-$version.tar.xz
crossfile
fix-build-llvm17.patch"
crossfile"
build() {
# Fix build with LLVM 17
patch -d ${name%-*}-$version -Np1 -i $SRC/fix-build-llvm17.patch
cd ${name%-*}-$version
# Remove two unneeded references to LLVM headers to avoid a build failure with LLVM 17 or later:
sed '/Scalar.h/d;/Utils.h/d' \
-i src/gallium/auxiliary/gallivm/lp_bld_init.c
export CC="gcc -m32"
export CXX="g++ -m32"
@@ -21,7 +23,7 @@ build() {
scratch isinstalled vulkan-icd-loader-32 && OPT_MESA_GALLIUM='zink,'
scratch isinstalled wayland-protocols && OPT_MESA_PLATFORMS='wayland,x11' || OPT_MESA_PLATFORMS='x11'
venom-meson ${name%-*}-$version build \
venom-meson build \
--sysconfdir=/etc \
--libdir=/usr/lib32 \
--native-file $SRC/crossfile \