package/mesa3d: Fix build with ARM soft-float

Buildroot commit 4ab91a29d8 bumped the
package to version 26.1.3 which first included upstream commit
94a6274275

causing a build error with this defconfig

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV5_EABI_UCLIBC_STABLE=y
BR2_PER_PACKAGE_DIRECTORIES=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
BR2_PACKAGE_MESA3D_OPENGL_GLX=y
BR2_PACKAGE_XORG7=y

Add a patch to disable some assembler intructions which are not
available with a toolchain configure for soft-float.

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Bernd Kuhls
2026-08-13 23:33:48 +02:00
committed by Julien Olivain
parent ec31fb67f5
commit 060ab51e0a

View File

@@ -0,0 +1,55 @@
From 345b14a820a557b72f218637cb37ef39947b1f50 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Wed, 1 Jul 2026 22:48:15 +0200
Subject: [PATCH] src/util/u_math.c: do not use arm fpu instructions if fpu is
not available
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42682>
Upstream: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42682
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
src/util/u_math.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/util/u_math.c b/src/util/u_math.c
index 722eac7f733..5683766a417 100644
--- a/src/util/u_math.c
+++ b/src/util/u_math.c
@@ -87,6 +87,7 @@ util_fpstate_get(void)
}
#endif
#if DETECT_ARCH_ARM
+#if !defined(__SOFTFP__)
if (util_get_cpu_caps()->has_neon) {
#ifdef HAVE___BUILTIN_ARM_GET_FPSCR
fpstate = __builtin_arm_get_fpscr();
@@ -94,6 +95,7 @@ util_fpstate_get(void)
__asm__ volatile("vmrs %0, fpscr" : "=r"(fpstate));
#endif
}
+#endif
#elif DETECT_ARCH_AARCH64
{
#ifdef HAVE___BUILTIN_AARCH64_GET_FPCR
@@ -154,6 +156,7 @@ util_fpstate_set(unsigned fpstate)
}
#endif
#if DETECT_ARCH_ARM
+#if !defined(__SOFTFP__)
if (util_get_cpu_caps()->has_neon) {
#ifdef HAVE___BUILTIN_ARM_SET_FPSCR
__builtin_arm_set_fpscr(fpstate);
@@ -161,6 +164,7 @@ util_fpstate_set(unsigned fpstate)
__asm__ volatile("vmsr fpscr, %0" :: "r"(fpstate));
#endif
}
+#endif
#elif DETECT_ARCH_AARCH64
{
#ifdef HAVE___BUILTIN_AARCH64_SET_FPCR
--
2.47.3