* [Buildroot] [PATCH v2 1/6] package/llvm-project/libclc: apply mesa-libclc patch set
@ 2026-09-20 21:39 Bernd Kuhls
2026-09-20 21:39 ` [Buildroot] [PATCH v2 2/6] package/mesa3d: rework OpenCL handling Bernd Kuhls
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Bernd Kuhls @ 2026-09-20 21:39 UTC (permalink / raw)
To: buildroot
Cc: Daniel Lang, El Mehdi YOUNES, Joseph Kogut, Romain Naour,
Valentin Korenblit
https://gitlab.freedesktop.org/karolherbst/mesa-libclc/-/commits/llvm_23
https://gitlab.freedesktop.org/karolherbst/mesa-libclc/-/blob/llvm_23/README.md
"This is a fork of LLVM's libclc applying some fixes of a known good
state. [...]
Alternatively to using this fork distributions can patch their own
libclc project with the commits titled with "libclc: ..."
Needed for mesa3d >= 26.2.0:
https://lists.freedesktop.org/archives/mesa-announce/2026-August/000863.html
"One important note for packagers is that there is now a Mesa community
maintained libclc fork that is verified to pass the OpenCL CTS with
Mesa/Rusticl, and will fix bugs after an upstream libclc major release
branch goes EoL. The Mesa build system will pick it up when available,
and fall back to upstream libclc if not. This libclc fork is not
verified for any other usages or users of libclc outside of Mesa."
This patch adds the mesa-libclc to our libclc package instead of adding
a new mesa-libclc package.
Also update configure options to build with llvm 23.
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
v2: new patch added to series as replacement for a new mesa-libclc
package (Julien)
...disable-use-of-SPV_KHR_fma-extension.patch | 36 ++
...0002-libclc-restore-old-fma-behavior.patch | 65 ++
...libclc-add-__clc_mesa_libclc_version.patch | 49 ++
...le-fp16-version-of-atan2-and-atan2pi.patch | 56 ++
...c-Revert-libclc-Update-remquo-187998.patch | 595 ++++++++++++++++++
...bclc-Update-hypot-implementation-185.patch | 171 +++++
...vert-libclc-Update-trigpi-functions-.patch | 173 +++++
...a-precision-issues-due-to-lack-of-fm.patch | 80 +++
.../libclc/0009-revert-10644a1-v3.patch | 37 ++
package/llvm-project/libclc/libclc.mk | 11 +-
10 files changed, 1270 insertions(+), 3 deletions(-)
create mode 100644 package/llvm-project/libclc/0001-libclc-disable-use-of-SPV_KHR_fma-extension.patch
create mode 100644 package/llvm-project/libclc/0002-libclc-restore-old-fma-behavior.patch
create mode 100644 package/llvm-project/libclc/0003-libclc-add-__clc_mesa_libclc_version.patch
create mode 100644 package/llvm-project/libclc/0004-libclc-disable-fp16-version-of-atan2-and-atan2pi.patch
create mode 100644 package/llvm-project/libclc/0005-libclc-Revert-libclc-Update-remquo-187998.patch
create mode 100644 package/llvm-project/libclc/0006-libclc-Revert-libclc-Update-hypot-implementation-185.patch
create mode 100644 package/llvm-project/libclc/0007-libclc-Partly-revert-libclc-Update-trigpi-functions-.patch
create mode 100644 package/llvm-project/libclc/0008-libclc-fix-tgamma-precision-issues-due-to-lack-of-fm.patch
create mode 100644 package/llvm-project/libclc/0009-revert-10644a1-v3.patch
diff --git a/package/llvm-project/libclc/0001-libclc-disable-use-of-SPV_KHR_fma-extension.patch b/package/llvm-project/libclc/0001-libclc-disable-use-of-SPV_KHR_fma-extension.patch
new file mode 100644
index 0000000000..482d61dbff
--- /dev/null
+++ b/package/llvm-project/libclc/0001-libclc-disable-use-of-SPV_KHR_fma-extension.patch
@@ -0,0 +1,36 @@
+From 0fdefef847d704b0162cacdbafe01350f4531a61 Mon Sep 17 00:00:00 2001
+From: Karol Herbst <kherbst@redhat.com>
+Date: Wed, 22 Jul 2026 13:36:59 +0200
+Subject: [PATCH] libclc: disable use of SPV_KHR_fma extension
+
+Upstream: https://gitlab.freedesktop.org/karolherbst/mesa-libclc/-/commit/0fdefef847d704b0162cacdbafe01350f4531a61
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ libclc/cmake/modules/AddLibclc.cmake | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/libclc/cmake/modules/AddLibclc.cmake b/libclc/cmake/modules/AddLibclc.cmake
+index d84101f..82aa563 100644
+--- a/libclc/cmake/modules/AddLibclc.cmake
++++ b/libclc/cmake/modules/AddLibclc.cmake
+@@ -165,7 +165,7 @@ function(libclc_add_library target_name)
+ if(LIBCLC_USE_SPIRV_BACKEND)
+ add_custom_command(OUTPUT ${builtins_lib}
+ COMMAND ${CMAKE_CLC_COMPILER} -c --target=${ARG_TRIPLE}
+- -mllvm --spirv-ext=+SPV_KHR_fma
++ -mllvm
+ -x ir -o ${builtins_lib} ${linked_bc}
+ DEPENDS ${linked_bc}
+ )
+@@ -173,7 +173,6 @@ function(libclc_add_library target_name)
+ add_custom_command(OUTPUT ${builtins_lib}
+ COMMAND ${llvm-spirv_exe}
+ --spirv-max-version=1.1
+- --spirv-ext=+SPV_KHR_fma
+ -o ${builtins_lib} ${linked_bc}
+ DEPENDS ${linked_bc}
+ )
+--
+2.47.3
+
diff --git a/package/llvm-project/libclc/0002-libclc-restore-old-fma-behavior.patch b/package/llvm-project/libclc/0002-libclc-restore-old-fma-behavior.patch
new file mode 100644
index 0000000000..5fe5b2a6b7
--- /dev/null
+++ b/package/llvm-project/libclc/0002-libclc-restore-old-fma-behavior.patch
@@ -0,0 +1,65 @@
+From f55c425b7277bc7178729a4c4335a5ec404d03dc Mon Sep 17 00:00:00 2001
+From: Karol Herbst <kherbst@redhat.com>
+Date: Wed, 22 Jul 2026 14:51:19 +0200
+Subject: [PATCH] libclc: restore old fma behavior
+
+Upstream: https://gitlab.freedesktop.org/karolherbst/mesa-libclc/-/commit/f55c425b7277bc7178729a4c4335a5ec404d03dc
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ libclc/clc/lib/spirv/math/clc_fma.inc | 8 ++++----
+ libclc/opencl/lib/generic/math/fma.cl | 2 +-
+ libclc/opencl/lib/spirv/math/fma.cl | 3 ++-
+ 3 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/libclc/clc/lib/spirv/math/clc_fma.inc b/libclc/clc/lib/spirv/math/clc_fma.inc
+index 42b1cf9..9efdcc4 100644
+--- a/libclc/clc/lib/spirv/math/clc_fma.inc
++++ b/libclc/clc/lib/spirv/math/clc_fma.inc
+@@ -8,9 +8,9 @@
+
+ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_fma(__CLC_GENTYPE a, __CLC_GENTYPE b,
+ __CLC_GENTYPE c) {
+-#if __CLC_FPSIZE == 32
+- if (!__clc_runtime_has_hw_fma32())
+- return __clc_sw_fma(a, b, c);
+-#endif
++//#if __CLC_FPSIZE == 32
++// if (!__clc_runtime_has_hw_fma32())
++// return __clc_sw_fma(a, b, c);
++//#endif
+ return __builtin_elementwise_fma(a, b, c);
+ }
+diff --git a/libclc/opencl/lib/generic/math/fma.cl b/libclc/opencl/lib/generic/math/fma.cl
+index 281ee83..a31864f 100644
+--- a/libclc/opencl/lib/generic/math/fma.cl
++++ b/libclc/opencl/lib/generic/math/fma.cl
+@@ -8,7 +8,7 @@
+
+ #include "clc/math/clc_fma.h"
+
+-#define __CLC_FUNCTION fma
++#define __CLC_FUNCTION clc_sw_fma
+ #define __CLC_BODY "clc/shared/ternary_def.inc"
+
+ #include "clc/math/gentype.inc"
+diff --git a/libclc/opencl/lib/spirv/math/fma.cl b/libclc/opencl/lib/spirv/math/fma.cl
+index b5a44af..ab955a9 100644
+--- a/libclc/opencl/lib/spirv/math/fma.cl
++++ b/libclc/opencl/lib/spirv/math/fma.cl
+@@ -6,10 +6,11 @@
+ //
+ //===----------------------------------------------------------------------===//
+
+-#include "clc/math/clc_fma.h"
++#include "clc/internal/math/clc_sw_fma.h"
+
+ #define __CLC_FLOAT_ONLY
+ #define __CLC_FUNCTION fma
++#define __CLC_IMPL_FUNCTION(x) __clc_sw_fma
+ #define __CLC_BODY "clc/shared/ternary_def.inc"
+
+ #include "clc/math/gentype.inc"
+--
+2.47.3
+
diff --git a/package/llvm-project/libclc/0003-libclc-add-__clc_mesa_libclc_version.patch b/package/llvm-project/libclc/0003-libclc-add-__clc_mesa_libclc_version.patch
new file mode 100644
index 0000000000..42fc68d68d
--- /dev/null
+++ b/package/llvm-project/libclc/0003-libclc-add-__clc_mesa_libclc_version.patch
@@ -0,0 +1,49 @@
+From 534609b129e3473b07f8d063c1c7259a07cce93b Mon Sep 17 00:00:00 2001
+From: Karol Herbst <kherbst@redhat.com>
+Date: Mon, 20 Jul 2026 16:12:30 +0200
+Subject: [PATCH] libclc: add __clc_mesa_libclc_version
+
+Allows us to detect if we got our own libclc binaries at runtime.
+
+Upstream: https://gitlab.freedesktop.org/karolherbst/mesa-libclc/-/commit/534609b129e3473b07f8d063c1c7259a07cce93b
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ libclc/opencl/lib/spirv/CMakeLists.txt | 1 +
+ libclc/opencl/lib/spirv/version.cl | 12 ++++++++++++
+ 2 files changed, 13 insertions(+)
+ create mode 100644 opencl/lib/spirv/version.cl
+
+diff --git a/libclc/opencl/lib/spirv/CMakeLists.txt b/libclc/opencl/lib/spirv/CMakeLists.txt
+index 6e9e28e..715642c 100644
+--- a/libclc/opencl/lib/spirv/CMakeLists.txt
++++ b/libclc/opencl/lib/spirv/CMakeLists.txt
+@@ -5,6 +5,7 @@ endif()
+
+ # Non-Vulkan SPIR-V uses a curated subset of generic builtins.
+ libclc_add_sources(${LIBCLC_OPENCL_TARGET} FILES
++ version.cl
+ math/fma.cl
+ )
+
+diff --git a/libclc/opencl/lib/spirv/version.cl b/libclc/opencl/lib/spirv/version.cl
+new file mode 100644
+index 0000000..96a3410
+--- /dev/null
++++ b/libclc/opencl/lib/spirv/version.cl
+@@ -0,0 +1,12 @@
++//===----------------------------------------------------------------------===//
++//
++// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
++// See https://llvm.org/LICENSE.txt for license information.
++// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
++//
++//===----------------------------------------------------------------------===//
++
++#include <clc/opencl/opencl-base.h>
++
++/* XXYYZZPP */
++_CLC_DEF uint __clc_mesa_libclc_version() { return 0x23010000; }
+--
+2.47.3
+
diff --git a/package/llvm-project/libclc/0004-libclc-disable-fp16-version-of-atan2-and-atan2pi.patch b/package/llvm-project/libclc/0004-libclc-disable-fp16-version-of-atan2-and-atan2pi.patch
new file mode 100644
index 0000000000..23314a990e
--- /dev/null
+++ b/package/llvm-project/libclc/0004-libclc-disable-fp16-version-of-atan2-and-atan2pi.patch
@@ -0,0 +1,56 @@
+From cd0452f7a695165706fe5df85073f86baa46abd4 Mon Sep 17 00:00:00 2001
+From: Karol Herbst <kherbst@redhat.com>
+Date: Wed, 22 Jul 2026 17:00:36 +0200
+Subject: [PATCH] libclc: disable fp16 version of atan2 and atan2pi
+
+Fixes math_brute_force/test_bruteforce atan2 atan2pi for half
+
+Upstream: https://gitlab.freedesktop.org/karolherbst/mesa-libclc/-/commit/cd0452f7a695165706fe5df85073f86baa46abd4
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ libclc/opencl/lib/generic/math/atan2.cl | 8 ++++++++
+ libclc/opencl/lib/generic/math/atan2pi.cl | 8 ++++++++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/libclc/opencl/lib/generic/math/atan2.cl b/libclc/opencl/lib/generic/math/atan2.cl
+index 2bbac43..640e5a3 100644
+--- a/libclc/opencl/lib/generic/math/atan2.cl
++++ b/libclc/opencl/lib/generic/math/atan2.cl
+@@ -8,6 +8,14 @@
+
+ #include "clc/math/clc_atan2.h"
+
++#define __CLC_FLOAT_ONLY
++#define __CLC_FUNCTION atan2
++#define __CLC_BODY "clc/shared/binary_def.inc"
++
++#include "clc/math/gentype.inc"
++
++#undef __CLC_FLOAT_ONLY
++#define __CLC_DOUBLE_ONLY
+ #define __CLC_FUNCTION atan2
+ #define __CLC_BODY "clc/shared/binary_def.inc"
+
+diff --git a/libclc/opencl/lib/generic/math/atan2pi.cl b/libclc/opencl/lib/generic/math/atan2pi.cl
+index 2d37e01..be848ae 100644
+--- a/libclc/opencl/lib/generic/math/atan2pi.cl
++++ b/libclc/opencl/lib/generic/math/atan2pi.cl
+@@ -8,6 +8,14 @@
+
+ #include "clc/math/clc_atan2pi.h"
+
++#define __CLC_FLOAT_ONLY
++#define __CLC_FUNCTION atan2pi
++#define __CLC_BODY "clc/shared/binary_def.inc"
++
++#include "clc/math/gentype.inc"
++
++#undef __CLC_FLOAT_ONLY
++#define __CLC_DOUBLE_ONLY
+ #define __CLC_FUNCTION atan2pi
+ #define __CLC_BODY "clc/shared/binary_def.inc"
+
+--
+2.47.3
+
diff --git a/package/llvm-project/libclc/0005-libclc-Revert-libclc-Update-remquo-187998.patch b/package/llvm-project/libclc/0005-libclc-Revert-libclc-Update-remquo-187998.patch
new file mode 100644
index 0000000000..64de3b2125
--- /dev/null
+++ b/package/llvm-project/libclc/0005-libclc-Revert-libclc-Update-remquo-187998.patch
@@ -0,0 +1,595 @@
+From 9b54a3b2c09228b3c3269c5c62ca2f3128ec6501 Mon Sep 17 00:00:00 2001
+From: Karol Herbst <kherbst@redhat.com>
+Date: Wed, 1 Apr 2026 02:44:30 +0200
+Subject: [PATCH] libclc: Revert "libclc: Update remquo (#187998)"
+
+Fixes math_brute_force/test_bruteforce remainder remquo
+
+This reverts commit 1a9fe1769a0f9684dc9ecfcb7a2cec2d66077cc3.
+
+Upstream: https://gitlab.freedesktop.org/karolherbst/mesa-libclc/-/commit/9b54a3b2c09228b3c3269c5c62ca2f3128ec6501
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ libclc/clc/include/clc/math/remquo_decl.inc | 34 +--
+ libclc/clc/lib/generic/math/clc_remquo.cl | 56 ++---
+ libclc/clc/lib/generic/math/clc_remquo.inc | 273 ++++++++++++++++++++--
+ libclc/clc/lib/generic/math/clc_remquo_stret.inc | 158 -------------
+ 4 files changed, 287 insertions(+), 234 deletions(-)
+ delete mode 100644 clc/lib/generic/math/clc_remquo_stret.inc
+
+diff --git a/libclc/clc/include/clc/math/remquo_decl.inc b/libclc/clc/include/clc/math/remquo_decl.inc
+index 8ba6011..cba28a7 100644
+--- a/libclc/clc/include/clc/math/remquo_decl.inc
++++ b/libclc/clc/include/clc/math/remquo_decl.inc
+@@ -6,29 +6,19 @@
+ //
+ //===----------------------------------------------------------------------===//
+
+-typedef struct __CLC_XCONCAT(__clc_remquo_ret_, __CLC_GENTYPE) {
+- __CLC_GENTYPE rem;
+- __CLC_INTN quo;
+-} __CLC_XCONCAT(__clc_remquo_ret_, __CLC_GENTYPE);
++_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x,
++ __CLC_GENTYPE y,
++ private __CLC_INTN *q);
+
+-#define __CLC_REMQUO_RET_GENTYPE __CLC_XCONCAT(__clc_remquo_ret_, __CLC_GENTYPE)
++_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x,
++ __CLC_GENTYPE y,
++ global __CLC_INTN *q);
+
+-_CLC_OVERLOAD _CLC_DECL __CLC_REMQUO_RET_GENTYPE
+-__clc_remquo_stret(__CLC_GENTYPE x, __CLC_GENTYPE y);
+-
+-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __clc_remquo(__CLC_GENTYPE x,
+- __CLC_GENTYPE y,
+- private __CLC_INTN *q);
+-
+-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __clc_remquo(__CLC_GENTYPE x,
+- __CLC_GENTYPE y,
+- global __CLC_INTN *q);
+-
+-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __clc_remquo(__CLC_GENTYPE x,
+- __CLC_GENTYPE y,
+- local __CLC_INTN *q);
++_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x,
++ __CLC_GENTYPE y,
++ local __CLC_INTN *q);
+ #if _CLC_GENERIC_AS_SUPPORTED
+-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __clc_remquo(__CLC_GENTYPE x,
+- __CLC_GENTYPE y,
+- generic __CLC_INTN *q);
++_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x,
++ __CLC_GENTYPE y,
++ generic __CLC_INTN *q);
+ #endif
+diff --git a/libclc/clc/lib/generic/math/clc_remquo.cl b/libclc/clc/lib/generic/math/clc_remquo.cl
+index 502b9e5..e254093 100644
+--- a/libclc/clc/lib/generic/math/clc_remquo.cl
++++ b/libclc/clc/lib/generic/math/clc_remquo.cl
+@@ -6,58 +6,32 @@
+ //
+ //===----------------------------------------------------------------------===//
+
+-#include "clc/math/clc_remquo.h"
+-
+ #include "clc/clc_convert.h"
+-#include "clc/float/definitions.h"
+ #include "clc/integer/clc_clz.h"
+-#include "clc/math/clc_copysign.h"
+-#include "clc/math/clc_fabs.h"
++#include "clc/internal/clc.h"
++#include "clc/math/clc_floor.h"
+ #include "clc/math/clc_flush_if_daz.h"
+ #include "clc/math/clc_fma.h"
+-#include "clc/math/clc_frexp.h"
+ #include "clc/math/clc_ldexp.h"
+-#include "clc/math/clc_mad.h"
+-#include "clc/math/clc_recip_fast.h"
+-#include "clc/math/clc_rint.h"
+ #include "clc/math/clc_subnormal_config.h"
+ #include "clc/math/clc_trunc.h"
+ #include "clc/math/math.h"
+-#include "clc/relational/clc_isfinite.h"
+-#include "clc/relational/clc_isnan.h"
+-#include "clc/relational/clc_signbit.h"
+-
+-#define __CLC_FUNCTION __clc_remquo_stret
+-#define __CLC_BODY "clc_remquo_stret.inc"
+-#include "clc/math/gentype.inc"
+-#undef __CLC_FUNCTION
+-
+-#define __CLC_FUNCTION __clc_remquo
+-#define __CLC_BODY "clc_remquo.inc"
+-#include "clc/math/gentype.inc"
++#include "clc/shared/clc_max.h"
+
+-#define __CLC_OUT_ARG3_SCALAR_TYPE int
+-#define __CLC_OUT_ARG3_ADDRESS_SPACE __private
+-#define __CLC_BODY "clc/shared/binary_with_out_arg_scalarize.inc"
+-#include "clc/math/gentype.inc"
+-#undef __CLC_OUT_ARG3_ADDRESS_SPACE
++#define __CLC_ADDRESS_SPACE private
++#include "clc_remquo.inc"
++#undef __CLC_ADDRESS_SPACE
+
+-#define __CLC_OUT_ARG3_SCALAR_TYPE int
+-#define __CLC_OUT_ARG3_ADDRESS_SPACE __local
+-#define __CLC_BODY "clc/shared/binary_with_out_arg_scalarize.inc"
+-#include "clc/math/gentype.inc"
+-#undef __CLC_OUT_ARG3_ADDRESS_SPACE
++#define __CLC_ADDRESS_SPACE global
++#include "clc_remquo.inc"
++#undef __CLC_ADDRESS_SPACE
+
+-#define __CLC_OUT_ARG3_SCALAR_TYPE int
+-#define __CLC_OUT_ARG3_ADDRESS_SPACE __global
+-#define __CLC_BODY "clc/shared/binary_with_out_arg_scalarize.inc"
+-#include "clc/math/gentype.inc"
+-#undef __CLC_OUT_ARG3_ADDRESS_SPACE
++#define __CLC_ADDRESS_SPACE local
++#include "clc_remquo.inc"
++#undef __CLC_ADDRESS_SPACE
+
+ #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
+-#define __CLC_OUT_ARG3_SCALAR_TYPE int
+-#define __CLC_OUT_ARG3_ADDRESS_SPACE
+-#define __CLC_BODY "clc/shared/binary_with_out_arg_scalarize.inc"
+-#include "clc/math/gentype.inc"
+-#undef __CLC_OUT_ARG3_ADDRESS_SPACE
++#define __CLC_ADDRESS_SPACE generic
++#include "clc_remquo.inc"
++#undef __CLC_ADDRESS_SPACE
+ #endif
+diff --git a/libclc/clc/lib/generic/math/clc_remquo.inc b/libclc/clc/lib/generic/math/clc_remquo.inc
+index 649bdd9..79ce0fe 100644
+--- a/libclc/clc/lib/generic/math/clc_remquo.inc
++++ b/libclc/clc/lib/generic/math/clc_remquo.inc
+@@ -6,19 +6,266 @@
+ //
+ //===----------------------------------------------------------------------===//
+
+-#ifdef __CLC_SCALAR
+-#define __CLC_REMQUO_DEF(addrspace) \
+- _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_remquo( \
+- __CLC_GENTYPE x, __CLC_GENTYPE y, addrspace __CLC_INTN *quo_out) { \
+- __CLC_REMQUO_RET_GENTYPE result = __clc_remquo_stret(x, y); \
+- *quo_out = result.quo; \
+- return result.rem; \
++_CLC_DEF _CLC_OVERLOAD float __clc_remquo(float x, float y,
++ __CLC_ADDRESS_SPACE int *quo) {
++ x = __clc_flush_if_daz(x);
++ y = __clc_flush_if_daz(y);
++ int ux = __clc_as_int(x);
++ int ax = ux & EXSIGNBIT_SP32;
++ float xa = __clc_as_float(ax);
++ int sx = ux ^ ax;
++ int ex = ax >> EXPSHIFTBITS_SP32;
++
++ int uy = __clc_as_int(y);
++ int ay = uy & EXSIGNBIT_SP32;
++ float ya = __clc_as_float(ay);
++ int sy = uy ^ ay;
++ int ey = ay >> EXPSHIFTBITS_SP32;
++
++ float xr = __clc_as_float(0x3f800000 | (ax & 0x007fffff));
++ float yr = __clc_as_float(0x3f800000 | (ay & 0x007fffff));
++ int c;
++ int k = ex - ey;
++
++ uint q = 0;
++
++ while (k > 0) {
++ c = xr >= yr;
++ q = (q << 1) | c;
++ xr -= c ? yr : 0.0f;
++ xr += xr;
++ --k;
++ }
++
++ c = xr > yr;
++ q = (q << 1) | c;
++ xr -= c ? yr : 0.0f;
++
++ int lt = ex < ey;
++
++ q = lt ? 0 : q;
++ xr = lt ? xa : xr;
++ yr = lt ? ya : yr;
++
++ c = (yr < 2.0f * xr) | ((yr == 2.0f * xr) & ((q & 0x1) == 0x1));
++ xr -= c ? yr : 0.0f;
++ q += c;
++
++ float s = __clc_as_float(ey << EXPSHIFTBITS_SP32);
++ xr *= lt ? 1.0f : s;
++
++ int qsgn = sx == sy ? 1 : -1;
++ int quot = (q & 0x7f) * qsgn;
++
++ c = ax == ay;
++ quot = c ? qsgn : quot;
++ xr = c ? 0.0f : xr;
++
++ xr = __clc_as_float(sx ^ __clc_as_int(xr));
++
++ c = ax > PINFBITPATT_SP32 | ay > PINFBITPATT_SP32 | ax == PINFBITPATT_SP32 |
++ ay == 0;
++ quot = c ? 0 : quot;
++ xr = c ? __clc_as_float(QNANBITPATT_SP32) : xr;
++
++ *quo = quot;
++
++ return xr;
++}
++
++// remquo signature is special, we don't have macro for this
++#define __CLC_VEC_REMQUO(TYPE, VEC_SIZE, HALF_VEC_SIZE) \
++ _CLC_DEF _CLC_OVERLOAD TYPE##VEC_SIZE __clc_remquo( \
++ TYPE##VEC_SIZE x, TYPE##VEC_SIZE y, \
++ __CLC_ADDRESS_SPACE int##VEC_SIZE *quo) { \
++ int##HALF_VEC_SIZE lo, hi; \
++ TYPE##VEC_SIZE ret; \
++ ret.lo = __clc_remquo(x.lo, y.lo, &lo); \
++ ret.hi = __clc_remquo(x.hi, y.hi, &hi); \
++ (*quo).lo = lo; \
++ (*quo).hi = hi; \
++ return ret; \
+ }
+
+-__CLC_REMQUO_DEF(private)
+-__CLC_REMQUO_DEF(local)
+-__CLC_REMQUO_DEF(global)
+-#if _CLC_DISTINCT_GENERIC_AS_SUPPORTED
+-__CLC_REMQUO_DEF(generic)
++#define __CLC_VEC3_REMQUO(TYPE) \
++ _CLC_DEF _CLC_OVERLOAD TYPE##3 __clc_remquo( \
++ TYPE##3 x, TYPE##3 y, __CLC_ADDRESS_SPACE int##3 * quo) { \
++ int2 lo; \
++ int hi; \
++ TYPE##3 ret; \
++ ret.s01 = __clc_remquo(x.s01, y.s01, &lo); \
++ ret.s2 = __clc_remquo(x.s2, y.s2, &hi); \
++ (*quo).s01 = lo; \
++ (*quo).s2 = hi; \
++ return ret; \
++ }
++__CLC_VEC_REMQUO(float, 2, )
++__CLC_VEC3_REMQUO(float)
++__CLC_VEC_REMQUO(float, 4, 2)
++__CLC_VEC_REMQUO(float, 8, 4)
++__CLC_VEC_REMQUO(float, 16, 8)
++
++#ifdef cl_khr_fp64
++
++#pragma OPENCL EXTENSION cl_khr_fp64 : enable
++
++_CLC_DEF _CLC_OVERLOAD double __clc_remquo(double x, double y,
++ __CLC_ADDRESS_SPACE int *pquo) {
++ ulong ux = __clc_as_ulong(x);
++ ulong ax = ux & ~SIGNBIT_DP64;
++ ulong xsgn = ux ^ ax;
++ double dx = __clc_as_double(ax);
++ int xexp = __clc_convert_int(ax >> EXPSHIFTBITS_DP64);
++ int xexp1 = 11 - (int)__clc_clz(ax & MANTBITS_DP64);
++ xexp1 = xexp < 1 ? xexp1 : xexp;
++
++ ulong uy = __clc_as_ulong(y);
++ ulong ay = uy & ~SIGNBIT_DP64;
++ double dy = __clc_as_double(ay);
++ int yexp = __clc_convert_int(ay >> EXPSHIFTBITS_DP64);
++ int yexp1 = 11 - (int)__clc_clz(ay & MANTBITS_DP64);
++ yexp1 = yexp < 1 ? yexp1 : yexp;
++
++ int qsgn = ((ux ^ uy) & SIGNBIT_DP64) == 0UL ? 1 : -1;
++
++ // First assume |x| > |y|
++
++ // Set ntimes to the number of times we need to do a
++ // partial remainder. If the exponent of x is an exact multiple
++ // of 53 larger than the exponent of y, and the mantissa of x is
++ // less than the mantissa of y, ntimes will be one too large
++ // but it doesn't matter - it just means that we'll go round
++ // the loop below one extra time.
++ int ntimes = __clc_max(0, (xexp1 - yexp1) / 53);
++ double w = __clc_ldexp(dy, ntimes * 53);
++ w = ntimes == 0 ? dy : w;
++ double scale = ntimes == 0 ? 1.0 : 0x1.0p-53;
++
++ // Each time round the loop we compute a partial remainder.
++ // This is done by subtracting a large multiple of w
++ // from x each time, where w is a scaled up version of y.
++ // The subtraction must be performed exactly in quad
++ // precision, though the result at each stage can
++ // fit exactly in a double precision number.
++ int i;
++ double t, v, p, pp;
++
++ for (i = 0; i < ntimes; i++) {
++ // Compute integral multiplier
++ t = __clc_trunc(dx / w);
++
++ // Compute w * t in quad precision
++ p = w * t;
++ pp = __clc_fma(w, t, -p);
++
++ // Subtract w * t from dx
++ v = dx - p;
++ dx = v + (((dx - v) - p) - pp);
++
++ // If t was one too large, dx will be negative. Add back one w.
++ dx += dx < 0.0 ? w : 0.0;
++
++ // Scale w down by 2^(-53) for the next iteration
++ w *= scale;
++ }
++
++ // One more time
++ // Variable todd says whether the integer t is odd or not
++ t = __clc_floor(dx / w);
++ long lt = (long)t;
++ int todd = lt & 1;
++
++ p = w * t;
++ pp = __clc_fma(w, t, -p);
++ v = dx - p;
++ dx = v + (((dx - v) - p) - pp);
++ i = dx < 0.0;
++ todd ^= i;
++ dx += i ? w : 0.0;
++
++ lt -= i;
++
++ // At this point, dx lies in the range [0,dy)
++
++ // For the remainder function, we need to adjust dx
++ // so that it lies in the range (-y/2, y/2] by carefully
++ // subtracting w (== dy == y) if necessary. The rigmarole
++ // with todd is to get the correct sign of the result
++ // when x/y lies exactly half way between two integers,
++ // when we need to choose the even integer.
++
++ int al = (2.0 * dx > w) | (todd & (2.0 * dx == w));
++ double dxl = dx - (al ? w : 0.0);
++
++ int ag = (dx > 0.5 * w) | (todd & (dx == 0.5 * w));
++ double dxg = dx - (ag ? w : 0.0);
++
++ dx = dy < 0x1.0p+1022 ? dxl : dxg;
++ lt += dy < 0x1.0p+1022 ? al : ag;
++ int quo = ((int)lt & 0x7f) * qsgn;
++
++ double ret = __clc_as_double(xsgn ^ __clc_as_ulong(dx));
++ dx = __clc_as_double(ax);
++
++ // Now handle |x| == |y|
++ int c = dx == dy;
++ t = __clc_as_double(xsgn);
++ quo = c ? qsgn : quo;
++ ret = c ? t : ret;
++
++ // Next, handle |x| < |y|
++ c = dx < dy;
++ quo = c ? 0 : quo;
++ ret = c ? x : ret;
++
++ c &= (yexp<1023 & 2.0 * dx> dy) | (dx > 0.5 * dy);
++ quo = c ? qsgn : quo;
++ // we could use a conversion here instead since qsgn = +-1
++ p = qsgn == 1 ? -1.0 : 1.0;
++ t = __clc_fma(y, p, x);
++ ret = c ? t : ret;
++
++ // We don't need anything special for |x| == 0
++
++ // |y| is 0
++ c = dy == 0.0;
++ quo = c ? 0 : quo;
++ ret = c ? __clc_as_double(QNANBITPATT_DP64) : ret;
++
++ // y is +-Inf, NaN
++ c = yexp > BIASEDEMAX_DP64;
++ quo = c ? 0 : quo;
++ t = y == y ? x : y;
++ ret = c ? t : ret;
++
++ // x is +=Inf, NaN
++ c = xexp > BIASEDEMAX_DP64;
++ quo = c ? 0 : quo;
++ ret = c ? __clc_as_double(QNANBITPATT_DP64) : ret;
++
++ *pquo = quo;
++ return ret;
++}
++__CLC_VEC_REMQUO(double, 2, )
++__CLC_VEC3_REMQUO(double)
++__CLC_VEC_REMQUO(double, 4, 2)
++__CLC_VEC_REMQUO(double, 8, 4)
++__CLC_VEC_REMQUO(double, 16, 8)
++
++#endif
++
++#ifdef cl_khr_fp16
++
++#pragma OPENCL EXTENSION cl_khr_fp16 : enable
++
++_CLC_OVERLOAD _CLC_DEF half __clc_remquo(half x, half y,
++ __CLC_ADDRESS_SPACE int *pquo) {
++ return (half)__clc_remquo((float)x, (float)y, pquo);
++}
++__CLC_VEC_REMQUO(half, 2, )
++__CLC_VEC3_REMQUO(half)
++__CLC_VEC_REMQUO(half, 4, 2)
++__CLC_VEC_REMQUO(half, 8, 4)
++__CLC_VEC_REMQUO(half, 16, 8)
++
+ #endif
+-#endif // __CLC_SCALAR
+diff --git a/libclc/clc/lib/generic/math/clc_remquo_stret.inc b/libclc/clc/lib/generic/math/clc_remquo_stret.inc
+deleted file mode 100644
+index eecc255..0000000
+--- a/libclc/clc/lib/generic/math/clc_remquo_stret.inc
++++ /dev/null
+@@ -1,158 +0,0 @@
+-//===----------------------------------------------------------------------===//
+-//
+-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+-// See https://llvm.org/LICENSE.txt for license information.
+-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+-//
+-//===----------------------------------------------------------------------===//
+-
+-#ifdef __CLC_SCALAR
+-
+-#if __CLC_FPSIZE == 32 || __CLC_FPSIZE == 64
+-#define __CLC_REMQUO_EVAL_TYPE __CLC_GENTYPE
+-#define __CLC_CONVERT_REMQUO_EVAL_TYPE __CLC_CONVERT_GENTYPE
+-#define __CLC_S_EVAL_TYPE __CLC_S_GENTYPE
+-#define __CLC_CONVERT_S_EVAL_TYPE __CLC_CONVERT_S_GENTYPE
+-#elif __CLC_FPSIZE == 16
+-#define __CLC_REMQUO_EVAL_TYPE __CLC_FLOATN
+-#define __CLC_CONVERT_REMQUO_EVAL_TYPE __CLC_CONVERT_FLOATN
+-#define __CLC_S_EVAL_TYPE __CLC_INTN
+-#define __CLC_CONVERT_S_EVAL_TYPE __CLC_CONVERT_INTN
+-#endif
+-
+-_CLC_DEF _CLC_OVERLOAD _CLC_CONST __CLC_REMQUO_RET_GENTYPE
+-__clc_remquo_stret(__CLC_GENTYPE x, __CLC_GENTYPE y) {
+- // How many bits of the quotient per iteration
+-
+-#if __CLC_FPSIZE == 32
+- const __CLC_INTN bits = 12;
+- const __CLC_GENTYPE max_exp = 0x1.0p+127f;
+-#elif __CLC_FPSIZE == 64
+- const __CLC_INTN bits = 26;
+- const __CLC_GENTYPE max_exp = 0x1.0p+1023;
+-#elif __CLC_FPSIZE == 16
+- const __CLC_INTN bits = 11;
+- const __CLC_GENTYPE max_exp = 0x1.0p+15h;
+-#endif
+-
+- // Track low 7 bits of the integral quotient.
+- __CLC_INTN q7;
+-
+- __CLC_REMQUO_EVAL_TYPE ax = __CLC_CONVERT_REMQUO_EVAL_TYPE(__clc_fabs(x));
+- __CLC_REMQUO_EVAL_TYPE ay = __CLC_CONVERT_REMQUO_EVAL_TYPE(__clc_fabs(y));
+-
+- __CLC_GENTYPE ret;
+-
+- if (ax > ay) {
+- __CLC_INTN ex, ey;
+-
+- __CLC_REMQUO_EVAL_TYPE mx = __clc_frexp(ax, &ex);
+- --ex;
+-
+- __CLC_REMQUO_EVAL_TYPE my = __clc_frexp(ay, &ey);
+- --ey;
+-
+- ax = __clc_ldexp(mx, bits);
+- ay = __clc_ldexp(my, 1);
+-
+- __CLC_INTN nb = ex - ey;
+- __CLC_REMQUO_EVAL_TYPE ayinv = __clc_recip_fast(ay);
+-
+- __CLC_INTN qacc = 0;
+-
+- while (nb > bits) {
+- __CLC_REMQUO_EVAL_TYPE q = __clc_rint(ax * ayinv);
+-
+-#if __CLC_FPSIZE == 16
+- ax = __clc_mad(-q, ay, ax);
+-#else
+- ax = __clc_fma(-q, ay, ax);
+-#endif
+- __CLC_S_GENTYPE clt = ax < (__CLC_REMQUO_EVAL_TYPE)0.0;
+- __CLC_REMQUO_EVAL_TYPE axp = ax + ay;
+- ax = clt ? axp : ax;
+- ax = __clc_ldexp(ax, bits);
+-
+- __CLC_INTN iq = __CLC_CONVERT_INTN(q);
+- iq -= __CLC_CONVERT_INTN(clt) ? 1 : 0;
+- qacc = (qacc << bits) | iq;
+-
+- nb -= bits;
+- }
+-
+- ax = __clc_ldexp(ax, nb - bits + 1);
+-
+- __CLC_INTN is_odd;
+-
+- // Final iteration
+- {
+- __CLC_REMQUO_EVAL_TYPE q = __clc_rint(ax * ayinv);
+-#if __CLC_FPSIZE == 16
+- ax = __clc_mad(-q, ay, ax);
+-#else
+- ax = __clc_fma(-q, ay, ax);
+-#endif
+-
+- __CLC_S_GENTYPE clt = ax < (__CLC_REMQUO_EVAL_TYPE)0.0;
+- __CLC_REMQUO_EVAL_TYPE axp = ax + ay;
+- ax = clt ? axp : ax;
+- __CLC_INTN iq = __CLC_CONVERT_INTN(q);
+- iq -= __CLC_CONVERT_INTN(clt) ? 1 : 0;
+-
+- qacc = (qacc << (nb + 1)) | iq;
+- is_odd = (iq & 1) != 0;
+- }
+-
+- // Adjust ax so that it is the range (-y/2, y/2]
+- // We need to choose the even integer when x/y is midway between two
+- // integers
+- __CLC_S_EVAL_TYPE aq = ((__CLC_REMQUO_EVAL_TYPE)2.0 * ax > ay) |
+- (__CLC_CONVERT_S_EVAL_TYPE(is_odd) &
+- ((__CLC_REMQUO_EVAL_TYPE)2.0 * ax == ay));
+- ax = ax - (aq ? ay : (__CLC_REMQUO_EVAL_TYPE)0.0);
+-
+- ax = __clc_ldexp(ax, ey);
+- qacc += aq ? 1 : 0;
+-
+- __CLC_S_GENTYPE qneg = __clc_signbit(x) ^ __clc_signbit(y) ? -1 : 0;
+- q7 = ((qacc & 0x7f) ^ qneg) - qneg;
+-
+- ret = __clc_signbit(x) ? -ax : ax;
+- } else {
+- __CLC_S_EVAL_TYPE c = (ax > (__CLC_REMQUO_EVAL_TYPE)0.5 * ay);
+- if (__CLC_FPSIZE != 16)
+- c |= (ay < max_exp && (__CLC_REMQUO_EVAL_TYPE)2.0 * ax > ay);
+-
+- __CLC_CHARN qsgn = __CLC_CONVERT_CHARN(__clc_signbit(x) == __clc_signbit(y))
+- ? (__CLC_CHARN)1
+- : (__CLC_CHARN)-1;
+-
+- __CLC_GENTYPE t = __clc_mad(y, -__CLC_CONVERT_GENTYPE(qsgn), x);
+- ret = c ? t : __clc_flush_if_daz(x);
+- q7 = c ? qsgn : 0;
+-
+- __CLC_GENTYPE zero = __clc_copysign(__CLC_FP_LIT(0.0), x);
+- ret = ax == ay ? zero : ret;
+- q7 = ax == ay ? qsgn : q7;
+- }
+-
+- ret = y == __CLC_FP_LIT(0.0) ? __CLC_GENTYPE_NAN : ret;
+- q7 = y == __CLC_FP_LIT(0.0) ? 0 : q7;
+-
+- __CLC_S_GENTYPE finite = !__clc_isnan(y) && __clc_isfinite(x);
+-
+- // A defined 0 result for quo with a nan result is an additional OpenCL
+- // requirement beyond standard C.
+- __CLC_REMQUO_RET_GENTYPE result;
+- result.quo = finite ? q7 : 0;
+- result.rem = finite ? ret : __CLC_GENTYPE_NAN;
+-
+- return result;
+-}
+-
+-#undef __CLC_REMQUO_EVAL_TYPE
+-#undef __CLC_CONVERT_REMQUO_EVAL_TYPE
+-#undef __CLC_S_EVAL_TYPE
+-#undef __CLC_CONVERT_S_EVAL_TYPE
+-
+-#endif // __CLC_SCALAR
+--
+2.47.3
+
diff --git a/package/llvm-project/libclc/0006-libclc-Revert-libclc-Update-hypot-implementation-185.patch b/package/llvm-project/libclc/0006-libclc-Revert-libclc-Update-hypot-implementation-185.patch
new file mode 100644
index 0000000000..eb68b65b8e
--- /dev/null
+++ b/package/llvm-project/libclc/0006-libclc-Revert-libclc-Update-hypot-implementation-185.patch
@@ -0,0 +1,171 @@
+From 931f02ef3281fa7bcf14362a7f90edec40825aaf Mon Sep 17 00:00:00 2001
+From: Karol Herbst <kherbst@redhat.com>
+Date: Wed, 22 Jul 2026 18:06:52 +0200
+Subject: [PATCH] libclc: Revert "libclc: Update hypot implementation
+ (#185873)"
+
+Fixes math_brute_force/test_bruteforce hypot
+
+This reverts commit 3da14eeacb90b5298805197b96f92551b7759a1d.
+
+Upstream: https://gitlab.freedesktop.org/karolherbst/mesa-libclc/-/commit/931f02ef3281fa7bcf14362a7f90edec40825aaf
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ libclc/clc/lib/generic/math/clc_hypot.cl | 14 ++--
+ libclc/clc/lib/generic/math/clc_hypot.inc | 101 ++++++++++++++++++++---------
+ 2 files changed, 75 insertions(+), 40 deletions(-)
+
+diff --git a/libclc/clc/lib/generic/math/clc_hypot.cl b/libclc/clc/lib/generic/math/clc_hypot.cl
+index b609d68..8eef0a5 100644
+--- a/libclc/clc/lib/generic/math/clc_hypot.cl
++++ b/libclc/clc/lib/generic/math/clc_hypot.cl
+@@ -7,17 +7,15 @@
+ //===----------------------------------------------------------------------===//
+
+ #include "clc/clc_convert.h"
+-#include "clc/float/definitions.h"
++#include "clc/integer/clc_abs.h"
+ #include "clc/internal/clc.h"
+-#include "clc/math/clc_fabs.h"
+-#include "clc/math/clc_fmax.h"
+-#include "clc/math/clc_frexp_exp.h"
+-#include "clc/math/clc_ldexp.h"
++#include "clc/math/clc_fma.h"
+ #include "clc/math/clc_mad.h"
+-#include "clc/math/clc_sqrt_fast.h"
++#include "clc/math/clc_sqrt.h"
++#include "clc/math/clc_subnormal_config.h"
+ #include "clc/math/math.h"
+-#include "clc/relational/clc_isinf.h"
+-#include "clc/relational/clc_isunordered.h"
++#include "clc/relational/clc_isnan.h"
++#include "clc/shared/clc_clamp.h"
+
+ #define __CLC_BODY "clc_hypot.inc"
+ #include "clc/math/gentype.inc"
+diff --git a/libclc/clc/lib/generic/math/clc_hypot.inc b/libclc/clc/lib/generic/math/clc_hypot.inc
+index 2321fb3..2fa9162 100644
+--- a/libclc/clc/lib/generic/math/clc_hypot.inc
++++ b/libclc/clc/lib/generic/math/clc_hypot.inc
+@@ -10,48 +10,85 @@
+ // warrants it
+
+ #if __CLC_FPSIZE == 32
+-_CLC_OVERLOAD _CLC_DEF _CLC_CONST __CLC_GENTYPE __clc_hypot(__CLC_GENTYPE x,
+- __CLC_GENTYPE y) {
+- __CLC_GENTYPE a = __clc_fabs(x);
+- __CLC_GENTYPE b = __clc_fabs(y);
+- __CLC_GENTYPE t = __clc_fmax(a, b);
+- __CLC_INTN e = __clc_frexp_exp(t);
+-
+- a = __clc_ldexp(a, -e);
+- b = __clc_ldexp(b, -e);
+- __CLC_GENTYPE ret = __clc_ldexp(__clc_sqrt_fast(__clc_mad(a, a, b * b)), e);
+-
+- return __clc_isinf(t) ? __CLC_GENTYPE_INF : ret;
++_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_hypot(__CLC_GENTYPE x,
++ __CLC_GENTYPE y) {
++ __CLC_UINTN ux = __CLC_AS_UINTN(x);
++ __CLC_UINTN aux = ux & EXSIGNBIT_SP32;
++ __CLC_UINTN uy = __CLC_AS_UINTN(y);
++ __CLC_UINTN auy = uy & EXSIGNBIT_SP32;
++ __CLC_INTN c = aux > auy;
++ ux = c ? aux : auy;
++ uy = c ? auy : aux;
++
++ __CLC_INTN xexp = __clc_clamp(
++ __CLC_AS_INTN(ux >> EXPSHIFTBITS_SP32) - EXPBIAS_SP32, -126, 126);
++ __CLC_GENTYPE fx_exp =
++ __CLC_AS_GENTYPE((xexp + EXPBIAS_SP32) << EXPSHIFTBITS_SP32);
++ __CLC_GENTYPE fi_exp =
++ __CLC_AS_GENTYPE((-xexp + EXPBIAS_SP32) << EXPSHIFTBITS_SP32);
++ __CLC_GENTYPE fx = __CLC_AS_GENTYPE(ux) * fi_exp;
++ __CLC_GENTYPE fy = __CLC_AS_GENTYPE(uy) * fi_exp;
++
++ __CLC_GENTYPE retval = __clc_sqrt(__clc_mad(fx, fx, fy * fy)) * fx_exp;
++
++ retval = (ux > PINFBITPATT_SP32 || uy == 0) ? __CLC_AS_GENTYPE(ux) : retval;
++ retval = (ux == PINFBITPATT_SP32 || uy == PINFBITPATT_SP32)
++ ? __CLC_AS_GENTYPE((__CLC_UINTN)PINFBITPATT_SP32)
++ : retval;
++ return retval;
+ }
+
+ #elif __CLC_FPSIZE == 64
+
+-_CLC_OVERLOAD _CLC_DEF _CLC_CONST __CLC_GENTYPE __clc_hypot(__CLC_GENTYPE x,
+- __CLC_GENTYPE y) {
+- __CLC_GENTYPE a = __clc_fabs(x);
+- __CLC_GENTYPE b = __clc_fabs(y);
+- __CLC_GENTYPE t = __clc_fmax(a, b);
+- __CLC_INTN e = __clc_frexp_exp(t);
++_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_hypot(__CLC_GENTYPE x,
++ __CLC_GENTYPE y) {
++ __CLC_ULONGN ux = __CLC_AS_ULONGN(x) & ~SIGNBIT_DP64;
++ __CLC_INTN xexp = __CLC_CONVERT_INTN(ux >> EXPSHIFTBITS_DP64);
++ x = __CLC_AS_GENTYPE(ux);
+
+- a = __clc_ldexp(a, -e);
+- b = __clc_ldexp(b, -e);
+- __CLC_GENTYPE ret = __clc_ldexp(__clc_sqrt_fast(__clc_mad(a, a, b * b)), e);
++ __CLC_ULONGN uy = __CLC_AS_ULONGN(y) & ~SIGNBIT_DP64;
++ __CLC_INTN yexp = __CLC_CONVERT_INTN(uy >> EXPSHIFTBITS_DP64);
++ y = __CLC_AS_GENTYPE(uy);
+
+- ret = __clc_isunordered(x, y) ? __CLC_GENTYPE_NAN : ret;
+- return __clc_isinf(x) || __clc_isinf(y) ? __CLC_GENTYPE_INF : ret;
+-}
++ __CLC_LONGN c = __CLC_CONVERT_LONGN(xexp > EXPBIAS_DP64 + 500 ||
++ yexp > EXPBIAS_DP64 + 500);
++ __CLC_GENTYPE preadjust = c ? 0x1.0p-600 : 1.0;
++ __CLC_GENTYPE postadjust = c ? 0x1.0p+600 : 1.0;
+
+-#elif __CLC_FPSIZE == 16
++ c = __CLC_CONVERT_LONGN(xexp < EXPBIAS_DP64 - 500 ||
++ yexp < EXPBIAS_DP64 - 500);
++ preadjust = c ? 0x1.0p+600 : preadjust;
++ postadjust = c ? 0x1.0p-600 : postadjust;
++
++ __CLC_GENTYPE ax = x * preadjust;
++ __CLC_GENTYPE ay = y * preadjust;
+
+-_CLC_OVERLOAD _CLC_DEF _CLC_CONST __CLC_GENTYPE __clc_hypot(__CLC_GENTYPE x,
+- __CLC_GENTYPE y) {
+- __CLC_FLOATN fx = __CLC_CONVERT_FLOATN(x);
+- __CLC_FLOATN fy = __CLC_CONVERT_FLOATN(y);
+- __CLC_FLOATN d2 = __clc_mad(fx, fx, fy * fy);
++ // The post adjust may overflow, but this can't be avoided in any case
++ __CLC_GENTYPE r = __clc_sqrt(__clc_fma(ax, ax, ay * ay)) * postadjust;
+
+- __CLC_GENTYPE ret = __CLC_CONVERT_HALFN(__clc_sqrt_fast(d2));
++ // If the difference in exponents between x and y is large
++ __CLC_GENTYPE s = x + y;
++ c = __CLC_CONVERT_LONGN(__clc_abs(xexp - yexp) > MANTLENGTH_DP64 + 1);
++ r = c ? s : r;
++
++ // Check for NaN
++ c = __clc_isnan(x) || __clc_isnan(y);
++ r = c ? __CLC_AS_GENTYPE((__CLC_ULONGN)QNANBITPATT_DP64) : r;
++
++ // If either is Inf, we must return Inf
++ c = x == __CLC_AS_GENTYPE((__CLC_ULONGN)PINFBITPATT_DP64) ||
++ y == __CLC_AS_GENTYPE((__CLC_ULONGN)PINFBITPATT_DP64);
++ r = c ? __CLC_AS_GENTYPE((__CLC_ULONGN)PINFBITPATT_DP64) : r;
++
++ return r;
++}
++
++#elif __CLC_FPSIZE == 16
+
+- return __clc_isinf(x) || __clc_isinf(y) ? __CLC_GENTYPE_INF : ret;
++_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_hypot(__CLC_GENTYPE x,
++ __CLC_GENTYPE y) {
++ return __CLC_CONVERT_GENTYPE(
++ __clc_hypot(__CLC_CONVERT_FLOATN(x), __CLC_CONVERT_FLOATN(y)));
+ }
+
+ #endif
+--
+2.47.3
+
diff --git a/package/llvm-project/libclc/0007-libclc-Partly-revert-libclc-Update-trigpi-functions-.patch b/package/llvm-project/libclc/0007-libclc-Partly-revert-libclc-Update-trigpi-functions-.patch
new file mode 100644
index 0000000000..062ec0e5a6
--- /dev/null
+++ b/package/llvm-project/libclc/0007-libclc-Partly-revert-libclc-Update-trigpi-functions-.patch
@@ -0,0 +1,173 @@
+From 1e379e04c3fc1457a80d47e0da2a6e242237094c Mon Sep 17 00:00:00 2001
+From: Karol Herbst <kherbst@redhat.com>
+Date: Wed, 1 Apr 2026 02:55:52 +0200
+Subject: [PATCH] libclc: Partly revert "libclc: Update trigpi functions
+ (#187579)"
+
+The initial commit broke sinpi
+
+This partly reverts commit 421bf13e4bf1c19a0cc48fbb0af63b902d3118b1
+
+Upstream: https://gitlab.freedesktop.org/karolherbst/mesa-libclc/-/commit/1e379e04c3fc1457a80d47e0da2a6e242237094c
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ .../clc/math/clc_sincos_helpers_fp64_decl.inc | 5 +
+ libclc/clc/lib/generic/math/clc_sinpi.cl | 8 +-
+ libclc/clc/lib/generic/math/clc_sinpi.inc | 106 +++++++++++++++++-
+ 3 files changed, 115 insertions(+), 4 deletions(-)
+
+diff --git a/libclc/clc/include/clc/math/clc_sincos_helpers_fp64_decl.inc b/libclc/clc/include/clc/math/clc_sincos_helpers_fp64_decl.inc
+index 22081d9..d638d72 100644
+--- a/libclc/clc/include/clc/math/clc_sincos_helpers_fp64_decl.inc
++++ b/libclc/clc/include/clc/math/clc_sincos_helpers_fp64_decl.inc
+@@ -22,6 +22,11 @@ _CLC_DEF _CLC_OVERLOAD __CLC_DOUBLEN __clc_tan_reduced_eval(__CLC_DOUBLEN x,
+ __CLC_DOUBLEN y,
+ __CLC_INTN is_odd);
+
++_CLC_DECL _CLC_OVERLOAD void __clc_sincos_piby4(__CLC_DOUBLEN x,
++ __CLC_DOUBLEN xx,
++ private __CLC_DOUBLEN *sinval,
++ private __CLC_DOUBLEN *cosval);
++
+ _CLC_DECL _CLC_OVERLOAD __CLC_INTN __clc_remainder_piby2_small(
+ __CLC_DOUBLEN x, private __CLC_DOUBLEN *r, private __CLC_DOUBLEN *rr);
+
+diff --git a/libclc/clc/lib/generic/math/clc_sinpi.cl b/libclc/clc/lib/generic/math/clc_sinpi.cl
+index bf57dc4..f9bed7e 100644
+--- a/libclc/clc/lib/generic/math/clc_sinpi.cl
++++ b/libclc/clc/lib/generic/math/clc_sinpi.cl
+@@ -6,8 +6,12 @@
+ //
+ //===----------------------------------------------------------------------===//
+
+-#include "clc/math/clc_sincospi.h"
+-#include "clc/math/clc_sinpi.h"
++#include "clc/clc_convert.h"
++#include "clc/float/definitions.h"
++#include "clc/internal/clc.h"
++#include "clc/math/clc_fabs.h"
++#include "clc/math/clc_sincos_helpers.h"
++#include "clc/math/math.h"
+
+ #define __CLC_BODY "clc_sinpi.inc"
+ #include "clc/math/gentype.inc"
+diff --git a/libclc/clc/lib/generic/math/clc_sinpi.inc b/libclc/clc/lib/generic/math/clc_sinpi.inc
+index a6e5ee7..264609a 100644
+--- a/libclc/clc/lib/generic/math/clc_sinpi.inc
++++ b/libclc/clc/lib/generic/math/clc_sinpi.inc
+@@ -6,7 +6,109 @@
+ //
+ //===----------------------------------------------------------------------===//
+
++#if __CLC_FPSIZE == 32
++
+ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_sinpi(__CLC_GENTYPE x) {
+- __CLC_GENTYPE unused_cos;
+- return __clc_sincospi(x, &unused_cos);
++ __CLC_INTN ix = __CLC_AS_INTN(x);
++ __CLC_INTN xsgn = ix & (__CLC_INTN)0x80000000;
++ ix ^= xsgn;
++ __CLC_GENTYPE absx = __clc_fabs(x);
++ __CLC_INTN iax = __CLC_CONVERT_INTN(absx);
++ __CLC_GENTYPE r = absx - __CLC_CONVERT_GENTYPE(iax);
++ __CLC_INTN xodd =
++ xsgn ^ ((iax & 0x1) != 0 ? (__CLC_INTN)0x80000000 : (__CLC_INTN)0);
++
++ // Initialize with return for +-Inf and NaN
++ __CLC_INTN ir = QNANBITPATT_SP32;
++
++ // 2^23 <= |x| < Inf, the result is always integer
++ ir = ix < PINFBITPATT_SP32 ? xsgn : ir;
++
++ // 0x1.0p-7 <= |x| < 2^23, result depends on which 0.25 interval
++
++ // r < 1.0
++ __CLC_GENTYPE a = 1.0f - r;
++ __CLC_INTN e = 0;
++
++ // r <= 0.75
++ __CLC_INTN c = r <= 0.75f;
++ a = c ? r - 0.5f : a;
++ e = c ? 1 : e;
++
++ // r < 0.5
++ c = r < 0.5f;
++ a = c ? 0.5f - r : a;
++
++ // 0 < r <= 0.25
++ c = r <= 0.25f;
++ a = c ? r : a;
++ e = c ? 0 : e;
++
++ __CLC_GENTYPE sinval, cosval;
++ __clc_sincos_piby4(a * M_PI_F, &sinval, &cosval);
++ __CLC_INTN jr = xodd ^ __CLC_AS_INTN(e != 0 ? cosval : sinval);
++
++ ir = ix < 0x4b000000 ? jr : ir;
++
++ return __CLC_AS_GENTYPE(ir);
+ }
++
++#elif __CLC_FPSIZE == 64
++
++_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_sinpi(__CLC_GENTYPE x) {
++ __CLC_LONGN ix = __CLC_AS_LONGN(x);
++ __CLC_LONGN xsgn = ix & (__CLC_LONGN)0x8000000000000000L;
++ ix ^= xsgn;
++ __CLC_GENTYPE absx = __clc_fabs(x);
++ __CLC_LONGN iax = __CLC_CONVERT_LONGN(absx);
++ __CLC_GENTYPE r = absx - __CLC_CONVERT_GENTYPE(iax);
++ __CLC_LONGN xodd =
++ xsgn ^
++ ((iax & 0x1L) != 0 ? (__CLC_LONGN)0x8000000000000000L : (__CLC_LONGN)0L);
++
++ // Initialize with return for +-Inf and NaN
++ __CLC_LONGN ir = QNANBITPATT_DP64;
++
++ // 2^23 <= |x| < Inf, the result is always integer
++ ir = ix < PINFBITPATT_DP64 ? xsgn : ir;
++
++ // 0x1.0p-7 <= |x| < 2^23, result depends on which 0.25 interval
++
++ // r < 1.0
++ __CLC_GENTYPE a = 1.0 - r;
++ __CLC_LONGN e = 0;
++
++ // r <= 0.75
++ __CLC_LONGN c = r <= 0.75;
++ __CLC_GENTYPE t = r - 0.5;
++ a = c ? t : a;
++ e = c ? 1 : e;
++
++ // r < 0.5
++ c = r < 0.5;
++ t = 0.5 - r;
++ a = c ? t : a;
++
++ // r <= 0.25
++ c = r <= 0.25;
++ a = c ? r : a;
++ e = c ? 0 : e;
++
++ __CLC_GENTYPE api = a * M_PI;
++
++ __CLC_GENTYPE sinval, cosval;
++ __clc_sincos_piby4(api, 0.0, &sinval, &cosval);
++ __CLC_LONGN jr = xodd ^ __CLC_AS_LONGN(e != 0 ? cosval : sinval);
++
++ ir = absx < 0x1.0p+52 ? jr : ir;
++
++ return __CLC_AS_GENTYPE(ir);
++}
++
++#elif __CLC_FPSIZE == 16
++
++_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_sinpi(__CLC_GENTYPE x) {
++ return __CLC_CONVERT_GENTYPE(__clc_sinpi(__CLC_CONVERT_FLOATN(x)));
++}
++
++#endif
+--
+2.47.3
+
diff --git a/package/llvm-project/libclc/0008-libclc-fix-tgamma-precision-issues-due-to-lack-of-fm.patch b/package/llvm-project/libclc/0008-libclc-fix-tgamma-precision-issues-due-to-lack-of-fm.patch
new file mode 100644
index 0000000000..301d8918e1
--- /dev/null
+++ b/package/llvm-project/libclc/0008-libclc-fix-tgamma-precision-issues-due-to-lack-of-fm.patch
@@ -0,0 +1,80 @@
+From 298976d4ddad1c7e0472647bcb50e1336a1bfd1a Mon Sep 17 00:00:00 2001
+From: Karol Herbst <kherbst@redhat.com>
+Date: Sat, 25 Jul 2026 18:03:18 +0200
+Subject: [PATCH] libclc: fix tgamma precision issues due to lack of fma
+
+The current tgamma implementation isn't precise enough when certain mads
+are implemented as unfused.
+
+Upstream: https://gitlab.freedesktop.org/karolherbst/mesa-libclc/-/commit/298976d4ddad1c7e0472647bcb50e1336a1bfd1a
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ libclc/clc/lib/generic/math/clc_tgamma.cl | 1 +
+ libclc/clc/lib/generic/math/clc_tgamma.inc | 14 +++++++-------
+ 2 files changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/libclc/clc/lib/generic/math/clc_tgamma.cl b/libclc/clc/lib/generic/math/clc_tgamma.cl
+index 7e34ac6..c474b68 100644
+--- a/libclc/clc/lib/generic/math/clc_tgamma.cl
++++ b/libclc/clc/lib/generic/math/clc_tgamma.cl
+@@ -13,6 +13,7 @@
+ #include "clc/math/clc_copysign.h"
+ #include "clc/math/clc_exp.h"
+ #include "clc/math/clc_fabs.h"
++#include "clc/math/clc_fma.h"
+ #include "clc/math/clc_mad.h"
+ #include "clc/math/clc_powr.h"
+ #include "clc/math/clc_recip_fast.h"
+diff --git a/libclc/clc/lib/generic/math/clc_tgamma.inc b/libclc/clc/lib/generic/math/clc_tgamma.inc
+index 0b8c354..e49540c 100644
+--- a/libclc/clc/lib/generic/math/clc_tgamma.inc
++++ b/libclc/clc/lib/generic/math/clc_tgamma.inc
+@@ -30,14 +30,14 @@ _CLC_DEF _CLC_OVERLOAD _CLC_CONST __CLC_GENTYPE __clc_tgamma(__CLC_FLOATN x) {
+ n = 1.0f;
+
+ while (y > 2.5f) {
+- n = __clc_mad(n, y, -n);
++ n = __clc_fma(n, y, -n);
+ y = y - 1.0f;
+- n = __clc_mad(n, y, -n);
++ n = __clc_fma(n, y, -n);
+ y = y - 1.0f;
+ }
+
+ if (y > 1.5f) {
+- n = __clc_mad(n, y, -n);
++ n = __clc_fma(n, y, -n);
+ y = y - 1.0f;
+ }
+
+@@ -49,14 +49,14 @@ _CLC_DEF _CLC_OVERLOAD _CLC_CONST __CLC_GENTYPE __clc_tgamma(__CLC_FLOATN x) {
+ d = x;
+
+ while (y < -1.5f) {
+- d = __clc_mad(d, y, d);
++ d = __clc_fma(d, y, d);
+ y = y + 1.0f;
+- d = __clc_mad(d, y, d);
++ d = __clc_fma(d, y, d);
+ y = y + 1.0f;
+ }
+
+ if (y < -0.5f) {
+- d = __clc_mad(d, y, d);
++ d = __clc_fma(d, y, d);
+ y = y + 1.0f;
+ }
+
+@@ -70,7 +70,7 @@ _CLC_DEF _CLC_OVERLOAD _CLC_CONST __CLC_GENTYPE __clc_tgamma(__CLC_FLOATN x) {
+ __CLC_FLOATN p4 = __clc_mad(y, p3, -0x1.4fcfd6p-1f);
+ __CLC_FLOATN qt = __clc_mad(y, p4, 0x1.2788ccp-1f);
+
+- ret = n / __clc_mad(d, y * qt, d);
++ ret = n / __clc_fma(d, y * qt, d);
+ ret = x == 0.0f ? __clc_copysign(__CLC_GENTYPE_INF, x) : ret;
+ ret = (x < 0.0f && __clc_fract_is_zero(x)) ? FLT_NAN : ret;
+ } else {
+--
+2.47.3
+
diff --git a/package/llvm-project/libclc/0009-revert-10644a1-v3.patch b/package/llvm-project/libclc/0009-revert-10644a1-v3.patch
new file mode 100644
index 0000000000..ad5eb1b98e
--- /dev/null
+++ b/package/llvm-project/libclc/0009-revert-10644a1-v3.patch
@@ -0,0 +1,37 @@
+Restore libclc.pc
+
+Revert the upstream removal of libclc.pc
+https://github.com/llvm/llvm-project/pull/185654
+
+which is needed by mesa3d to detect libclc.
+
+Upstream: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40601#note_3639151
+
+Downloaded from
+https://aur.archlinux.org/cgit/aur.git/tree/revert-10644a1-v3.patch?h=libclc-minimal-git
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+
+diff -uraN llvm-project/libclc/CMakeLists.txt llvm-project.new/libclc/CMakeLists.txt
+--- llvm-project/libclc/CMakeLists.txt 2026-06-05 23:42:11.119610382 +0200
++++ llvm-project.new/libclc/CMakeLists.txt 2026-06-05 23:43:45.639449958 +0200
+@@ -123,6 +123,9 @@
+ endif()
+ endforeach()
+
++configure_file( libclc.pc.in libclc.pc @ONLY )
++install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig" )
++
+ # Determine the clang target triple.
+ set(clang_triple ${LIBCLC_TARGET})
+
+diff -uraN llvm-project/libclc/libclc.pc.in llvm-project.new/libclc/libclc.pc.in
+--- llvm-project/libclc/libclc.pc.in 1970-01-01 01:00:00.000000000 +0100
++++ llvm-project.new/libclc/libclc.pc.in 2026-06-05 23:21:12.849811269 +0200
+@@ -0,0 +1,6 @@
++libexecdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATADIR@/clc
++
++Name: libclc
++Description: Library requirements of the OpenCL C programming language
++Version: @PROJECT_VERSION@
++Libs: -L${libexecdir}
diff --git a/package/llvm-project/libclc/libclc.mk b/package/llvm-project/libclc/libclc.mk
index ff00871747..2f59ca3dec 100644
--- a/package/llvm-project/libclc/libclc.mk
+++ b/package/llvm-project/libclc/libclc.mk
@@ -36,13 +36,18 @@ LIBCLC_CONF_OPTS = \
-DCMAKE_EXE_LINKER_FLAGS="$(HOST_LDFLAGS)" \
-DCMAKE_SHARED_LINKER_FLAGS="$(HOST_LDFLAGS)" \
-DCMAKE_MODULE_LINKER_FLAGS="$(HOST_LDFLAGS)" \
- -DCMAKE_C_COMPILER="$(CMAKE_HOST_C_COMPILER)" \
- -DCMAKE_CXX_COMPILER="$(CMAKE_HOST_CXX_COMPILER)" \
+ -DCMAKE_C_COMPILER="$(HOST_DIR)/bin/clang" \
+ -DCMAKE_CXX_COMPILER="$(HOST_DIR)/bin/clang" \
-DLLVM_CMAKE_DIR="$(HOST_DIR)/lib/cmake/llvm" \
+ -DLIBCLC_TARGET=spirv64-unknown-unknown \
-DLIBCLC_CUSTOM_LLVM_TOOLS_BINARY_DIR="$(HOST_DIR)/bin"
HOST_LIBCLC_CONF_OPTS = \
- -DLIBCLC_TARGETS_TO_BUILD=spirv64-mesa3d-
+ -DCMAKE_C_COMPILER_FORCED=ON \
+ -DCMAKE_CXX_COMPILER_FORCED=ON \
+ -DCMAKE_C_COMPILER="$(HOST_DIR)/bin/clang" \
+ -DCMAKE_CXX_COMPILER="$(HOST_DIR)/bin/clang" \
+ -DLIBCLC_TARGET=spirv64-unknown-unknown
$(eval $(cmake-package))
$(eval $(host-cmake-package))
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread* [Buildroot] [PATCH v2 2/6] package/mesa3d: rework OpenCL handling
2026-09-20 21:39 [Buildroot] [PATCH v2 1/6] package/llvm-project/libclc: apply mesa-libclc patch set Bernd Kuhls
@ 2026-09-20 21:39 ` Bernd Kuhls
2026-09-20 21:39 ` [Buildroot] [PATCH v2 3/6] package/mesa3d: precomp-compiler does not need target llvm Bernd Kuhls
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Bernd Kuhls @ 2026-09-20 21:39 UTC (permalink / raw)
To: buildroot
Cc: Daniel Lang, El Mehdi YOUNES, Joseph Kogut, Romain Naour,
Valentin Korenblit
Mesa3D removed the old Clover OpenCL implementation in version 25.2.0
and kept only RustiCL:
https://lists.freedesktop.org/archives/mesa-announce/2025-August/000815.html
"[...] the Clover OpenCL implementation has been deleted. RustiCL is now
the only OpenCL implementation available [...]"
Since then the option BR2_PACKAGE_MESA3D_OPENCL served no other purpose
than allowing access to the RustiCL sub-option. This commit merges both
options and their dependencies.
Fixes https://gitlab.com/buildroot.org/buildroot/-/work_items/180#note_3501740032
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
v2: removed code left-over (Romain)
Config.in.legacy | 9 ++++++
package/mesa3d/Config.in | 32 +++++---------------
package/mesa3d/mesa3d.mk | 8 ++---
support/testing/tests/package/test_mesa3d.py | 1 -
4 files changed, 19 insertions(+), 31 deletions(-)
diff --git a/Config.in.legacy b/Config.in.legacy
index bb6257f532..e3824ca927 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -146,6 +146,15 @@ endif
comment "Legacy options removed in 2026.11"
+config BR2_PACKAGE_MESA3D_OPENCL
+ bool "Mesa3D OpenCL support is now provided by RustiCL"
+ select BR2_LEGACY
+ help
+ Mesa3D removed the old Clover OpenCL implementation and
+ replaced it by RustiCL. This option served no other purpose
+ than allowing access to the RustiCL sub-option which was moved
+ to the main options section.
+
config BR2_PACKAGE_LIBCPPRESTSDK
bool "libcpprestsdk has been removed"
select BR2_LEGACY
diff --git a/package/mesa3d/Config.in b/package/mesa3d/Config.in
index e184039150..cb86e6a2a4 100644
--- a/package/mesa3d/Config.in
+++ b/package/mesa3d/Config.in
@@ -23,7 +23,6 @@ config BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS
config BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
bool
- select BR2_PACKAGE_MESA3D_OPENCL
select BR2_PACKAGE_SPIRV_LLVM_TRANSLATOR
select BR2_PACKAGE_SPIRV_TOOLS
@@ -56,35 +55,20 @@ config BR2_PACKAGE_MESA3D_LEGACY_BIND_WAYLAND_DISPLAY
help
Legacy Wayland EGL_WL_bind_wayland_display support.
-menuconfig BR2_PACKAGE_MESA3D_OPENCL
- bool "OpenCL support"
- depends on BR2_PACKAGE_MESA3D_LLVM
- depends on BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600 || \
- BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_PANFROST || \
- BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI || \
- BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS || \
- BR2_PACKAGE_MESA3D_VULKAN_DRIVER_AMD || \
- BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL || \
- BR2_PACKAGE_MESA3D_VULKAN_DRIVER_IMAGINATION || \
- BR2_PACKAGE_MESA3D_VULKAN_DRIVER_PANFROST || \
- (BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS && \
- BR2_PACKAGE_MESA3D_RUSTICL_SUPPORTED_DRIVER)
- select BR2_PACKAGE_LLVM_RTTI
- select BR2_PACKAGE_CLANG
- select BR2_PACKAGE_LIBCLC
- select BR2_PACKAGE_HAS_LIBOPENCL
-if BR2_PACKAGE_MESA3D_OPENCL
-# libclc dependency is satisfied by
-# BR2_PACKAGE_MESA3D_LLVM
config BR2_PACKAGE_MESA3D_RUSTICL
- bool "RustiCL"
+ bool "RustiCL OpenCL support"
+ depends on BR2_PACKAGE_MESA3D_LLVM
depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
depends on BR2_PACKAGE_MESA3D_RUSTICL_SUPPORTED_DRIVER
select BR2_PACKAGE_HOST_RUSTC
select BR2_PACKAGE_LLVM_DUMP
+ select BR2_PACKAGE_LLVM_RTTI
+ select BR2_PACKAGE_CLANG
+ select BR2_PACKAGE_LIBCLC
select BR2_PACKAGE_SPIRV_TOOLS
select BR2_PACKAGE_SPIRV_LLVM_TRANSLATOR
select BR2_PACKAGE_OPENCL_ICD_LOADER
+ select BR2_PACKAGE_HAS_LIBOPENCL
help
RustiCL is an OpenCL implementation written in Rust.
By default, devices are disabled in RustiCL. If you want
@@ -93,8 +77,6 @@ config BR2_PACKAGE_MESA3D_RUSTICL
https://docs.mesa3d.org/envvars.html#envvar-RUSTICL_ENABLE
-endif # BR2_PACKAGE_MESA3D_OPENCL
-
config BR2_PACKAGE_MESA3D_RUSTICL_SUPPORTED_DRIVER
bool
@@ -554,7 +536,7 @@ config BR2_PACKAGE_PROVIDES_LIBGLES
default "mesa3d" if BR2_PACKAGE_MESA3D_OPENGL_ES && !BR2_PACKAGE_LIBGLVND
config BR2_PACKAGE_PROVIDES_LIBOPENCL
- default "mesa3d" if BR2_PACKAGE_MESA3D_OPENCL
+ default "mesa3d" if BR2_PACKAGE_MESA3D_RUSTICL
endif # BR2_PACKAGE_MESA3D
diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk
index 87c7f427e4..c103345e86 100644
--- a/package/mesa3d/mesa3d.mk
+++ b/package/mesa3d/mesa3d.mk
@@ -50,13 +50,11 @@ else
MESA3D_CONF_OPTS += -Dllvm=disabled
endif
-ifeq ($(BR2_PACKAGE_MESA3D_OPENCL),y)
-MESA3D_PROVIDES += libopencl
-MESA3D_DEPENDENCIES += clang libclc
-endif
-
ifeq ($(BR2_PACKAGE_MESA3D_RUSTICL),y)
+MESA3D_PROVIDES += libopencl
MESA3D_DEPENDENCIES += \
+ clang \
+ libclc \
host-rustc \
host-rust-bindgen \
spirv-tools \
diff --git a/support/testing/tests/package/test_mesa3d.py b/support/testing/tests/package/test_mesa3d.py
index 24fc6df59e..193aa7a373 100644
--- a/support/testing/tests/package/test_mesa3d.py
+++ b/support/testing/tests/package/test_mesa3d.py
@@ -17,7 +17,6 @@ class TestMesa3DRusticl(infra.basetest.BRTest):
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config"
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_LLVM=y
- BR2_PACKAGE_MESA3D_OPENCL=y
BR2_PACKAGE_MESA3D_RUSTICL=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_LLVMPIPE=y
BR2_PACKAGE_CLINFO=y
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread* [Buildroot] [PATCH v2 3/6] package/mesa3d: precomp-compiler does not need target llvm
2026-09-20 21:39 [Buildroot] [PATCH v2 1/6] package/llvm-project/libclc: apply mesa-libclc patch set Bernd Kuhls
2026-09-20 21:39 ` [Buildroot] [PATCH v2 2/6] package/mesa3d: rework OpenCL handling Bernd Kuhls
@ 2026-09-20 21:39 ` Bernd Kuhls
2026-09-20 21:39 ` [Buildroot] [PATCH v2 4/6] package/mesa3d: crocus Gallium driver needs precomp-compiler Bernd Kuhls
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Bernd Kuhls @ 2026-09-20 21:39 UTC (permalink / raw)
To: buildroot
Cc: Daniel Lang, El Mehdi YOUNES, Joseph Kogut, Romain Naour,
Valentin Korenblit
Inspired by and fixes
https://gitlab.com/buildroot.org/buildroot/-/work_items/180
To build binaries provided by the host-mesa3d package we do not need to
build llvm packages for the target arch.
Added configure options for rtti support to fix build error when
BR2_PACKAGE_LLVM_RTTI is not enabled:
output/build/host-mesa3d-26.2.3/meson.build:2042:8: ERROR: Problem
encountered: LLVM was built without RTTI, so Mesa must also disable
RTTI. Use an LLVM built with LLVM_ENABLE_RTTI or add cpp_rtti=false.
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
v2: added note about new rtti configure options (Romain)
package/mesa3d/Config.in | 46 +++++++++++++++++++++++-----------------
package/mesa3d/mesa3d.mk | 8 ++++++-
2 files changed, 33 insertions(+), 21 deletions(-)
diff --git a/package/mesa3d/Config.in b/package/mesa3d/Config.in
index cb86e6a2a4..feed6b68fe 100644
--- a/package/mesa3d/Config.in
+++ b/package/mesa3d/Config.in
@@ -23,8 +23,7 @@ config BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS
config BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
bool
- select BR2_PACKAGE_SPIRV_LLVM_TRANSLATOR
- select BR2_PACKAGE_SPIRV_TOOLS
+ select BR2_HOST_CMAKE_AT_LEAST_3_20 # host-llvm
config BR2_PACKAGE_MESA3D_LLVM
bool "llvm support"
@@ -147,15 +146,17 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_I915
config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS
bool "Gallium iris driver"
- depends on BR2_PACKAGE_MESA3D_LLVM
+ depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # host-llvm
+ depends on BR2_HOST_GCC_AT_LEAST_7 # host-llvm
select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
select BR2_PACKAGE_MESA3D_RUSTICL_SUPPORTED_DRIVER
help
Mesa driver for iris-based Intel GPUs.
-comment "iris driver needs llvm"
- depends on !BR2_PACKAGE_MESA3D_LLVM
+comment "iris driver needs host gcc >= 7"
+ depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+ depends on !BR2_HOST_GCC_AT_LEAST_7
config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_LIMA
bool "Gallium lima driver"
@@ -189,15 +190,17 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_NOUVEAU
config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_PANFROST
bool "Gallium panfrost driver"
depends on BR2_TOOLCHAIN_HAS_SYNC_4 || !BR2_PACKAGE_XORG7 # libxshmfence
- depends on BR2_PACKAGE_MESA3D_LLVM
+ depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # host-llvm
+ depends on BR2_HOST_GCC_AT_LEAST_7 # host-llvm
select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
select BR2_PACKAGE_MESA3D_RUSTICL_SUPPORTED_DRIVER
help
Mesa driver for ARM Mali Midgard and Bifrost GPUs.
-comment "panfrost driver needs llvm"
- depends on !BR2_PACKAGE_MESA3D_LLVM
+comment "panfrost driver needs host gcc >= 7"
+ depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+ depends on !BR2_HOST_GCC_AT_LEAST_7
config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R300
bool "Gallium Radeon R300 driver"
@@ -360,46 +363,49 @@ config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_IMAGINATION
bool "Vulkan imagination driver"
depends on BR2_arm || BR2_aarch64
depends on BR2_TOOLCHAIN_HAS_SYNC_4 || !BR2_PACKAGE_XORG7 # libxshmfence
- depends on BR2_PACKAGE_MESA3D_LLVM
+ depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # host-llvm
+ depends on BR2_HOST_GCC_AT_LEAST_7 # host-llvm
select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
select BR2_PACKAGE_MESA3D_VULKAN_DRIVER
help
Vulkan imagination driver.
-comment "imagination vulkan needs llvm"
- depends on !BR2_PACKAGE_MESA3D_LLVM
+comment "imagination vulkan driver needs host gcc >= 7"
+ depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+ depends on !BR2_HOST_GCC_AT_LEAST_7
config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL
bool "Vulkan Intel driver"
depends on BR2_TOOLCHAIN_HAS_SYNC_4 || !BR2_PACKAGE_XORG7 # libxshmfence
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 # memfd.h
depends on BR2_TOOLCHAIN_USES_GLIBC # ifunc, static_assert
- depends on BR2_PACKAGE_MESA3D_LLVM
+ depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # host-llvm
+ depends on BR2_HOST_GCC_AT_LEAST_7 # host-llvm
select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
select BR2_PACKAGE_MESA3D_VULKAN_DRIVER
help
Vulkan driver for Intel hardware from Ivy Bridge onward.
-comment "intel vulkan needs llvm"
- depends on !BR2_PACKAGE_MESA3D_LLVM
-
-comment "intel vulkan needs a glibc toolchain w/ headers >= 3.17"
+comment "intel vulkan driver needs a glibc toolchain w/ headers >= 3.17, host gcc >= 7"
depends on BR2_TOOLCHAIN_HAS_SYNC_4 || !BR2_PACKAGE_XORG7
+ depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 || \
- !BR2_TOOLCHAIN_USES_GLIBC
+ !BR2_TOOLCHAIN_USES_GLIBC || !BR2_HOST_GCC_AT_LEAST_7
config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_PANFROST
bool "Vulkan panfrost driver"
depends on BR2_TOOLCHAIN_HAS_SYNC_4 || !BR2_PACKAGE_XORG7 # libxshmfence
- depends on BR2_PACKAGE_MESA3D_LLVM
+ depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # host-llvm
+ depends on BR2_HOST_GCC_AT_LEAST_7 # host-llvm
select BR2_PACKAGE_LLVM_RTTI if BR2_PACKAGE_MESA3D_LLVM
select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
select BR2_PACKAGE_MESA3D_VULKAN_DRIVER
help
Vulkan panfrost driver.
-comment "panfrost vulkan needs llvm"
- depends on !BR2_PACKAGE_MESA3D_LLVM
+comment "panfrost vulkan driver needs host gcc >= 7"
+ depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+ depends on !BR2_HOST_GCC_AT_LEAST_7
config BR2_PACKAGE_MESA3D_VULKAN_DRIVER_SWRAST
bool "Vulkan swrast driver"
diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk
index c103345e86..04112eea8e 100644
--- a/package/mesa3d/mesa3d.mk
+++ b/package/mesa3d/mesa3d.mk
@@ -178,7 +178,7 @@ endif
ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER),y)
MESA3D_CONF_OPTS += -Dmesa-clc=system -Dprecomp-compiler=system
-MESA3D_DEPENDENCIES += host-mesa3d spirv-llvm-translator spirv-tools
+MESA3D_DEPENDENCIES += host-mesa3d
endif
ifeq ($(BR2_PACKAGE_MESA3D_VULKAN_DRIVER),)
@@ -347,6 +347,12 @@ HOST_MESA3D_CONF_OPTS = \
-Dglx=disabled \
-Dvulkan-drivers=""
+ifeq ($(BR2_PACKAGE_LLVM_RTTI),y)
+HOST_MESA3D_CONF_OPTS += -Dcpp_rtti=true
+else
+HOST_MESA3D_CONF_OPTS += -Dcpp_rtti=false
+endif
+
HOST_MESA3D_DEPENDENCIES = \
host-libclc \
host-libdrm \
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread* [Buildroot] [PATCH v2 4/6] package/mesa3d: crocus Gallium driver needs precomp-compiler
2026-09-20 21:39 [Buildroot] [PATCH v2 1/6] package/llvm-project/libclc: apply mesa-libclc patch set Bernd Kuhls
2026-09-20 21:39 ` [Buildroot] [PATCH v2 2/6] package/mesa3d: rework OpenCL handling Bernd Kuhls
2026-09-20 21:39 ` [Buildroot] [PATCH v2 3/6] package/mesa3d: precomp-compiler does not need target llvm Bernd Kuhls
@ 2026-09-20 21:39 ` Bernd Kuhls
2026-09-20 21:39 ` [Buildroot] [PATCH v2 5/6] package/mesa3d: i915 Gallium driver needs llvm Bernd Kuhls
2026-09-20 21:39 ` [Buildroot] [PATCH v2 6/6] package/{mesa3d, mesa3d-headers}: bump version to 26.2.3 Bernd Kuhls
4 siblings, 0 replies; 7+ messages in thread
From: Bernd Kuhls @ 2026-09-20 21:39 UTC (permalink / raw)
To: buildroot
Cc: Daniel Lang, El Mehdi YOUNES, Joseph Kogut, Romain Naour,
Valentin Korenblit
Buildroot commit 59ed1137e9bb8c0157be3dc91a1cc462211dd3c7 bumped the
package to 26.0.0 which added upstream commit
https://gitlab.freedesktop.org/mesa/mesa/-/commit/b72d347d1c3b9e829971fbdabf993b68776083c1
requiring the precomp-compiler for the crocus driver.
Add the necessary dependencies to fix a configure error:
../output-1/build/mesa3d-26.1.8/meson.build:945:3: ERROR:
Feature llvm cannot be disabled: CLC requires LLVM
caused by
https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-26.1.8/meson.build?ref_type=tags#L945
which checks the value in the variable with_clc.
When the precomp-compiler is not provided by host-mesa3d the meson
configure option mesa-clc does not contain 'system' causing
https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-26.1.8/meson.build?ref_type=tags#L939
the variable with_clc to be filled, among others, with the content of with_driver_using_cl:
https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-26.1.8/meson.build?ref_type=tags#L939
which contains 'true' when the crocus driver is enabled:
https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-26.1.8/meson.build?ref_type=tags#L925
So we need to provide the precomp-compiler also for the crocus driver.
Fixes:
https://autobuild.buildroot.org/results/baa718e140264a9aa64c3a8f4114ca1b05f740e3/
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
v2: no changes
package/mesa3d/Config.in | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/package/mesa3d/Config.in b/package/mesa3d/Config.in
index feed6b68fe..e18d25eb8e 100644
--- a/package/mesa3d/Config.in
+++ b/package/mesa3d/Config.in
@@ -110,10 +110,18 @@ comment "Gallium drivers"
config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_CROCUS
bool "Gallium crocus driver"
depends on BR2_i386 || BR2_x86_64
+ depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # host-llvm
+ depends on BR2_HOST_GCC_AT_LEAST_7 # host-llvm
select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
+ select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
+ select BR2_PACKAGE_MESA3D_RUSTICL_SUPPORTED_DRIVER
help
Mesa driver for gen4-7 Intel GPUs.
+comment "crocus driver needs host gcc >= 7"
+ depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+ depends on !BR2_HOST_GCC_AT_LEAST_7
+
config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV
bool "Gallium Etnaviv driver"
depends on BR2_TOOLCHAIN_HAS_SYNC_4 || !BR2_PACKAGE_XORG7 # libxshmfence
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread* [Buildroot] [PATCH v2 5/6] package/mesa3d: i915 Gallium driver needs llvm
2026-09-20 21:39 [Buildroot] [PATCH v2 1/6] package/llvm-project/libclc: apply mesa-libclc patch set Bernd Kuhls
` (2 preceding siblings ...)
2026-09-20 21:39 ` [Buildroot] [PATCH v2 4/6] package/mesa3d: crocus Gallium driver needs precomp-compiler Bernd Kuhls
@ 2026-09-20 21:39 ` Bernd Kuhls
2026-09-20 21:39 ` [Buildroot] [PATCH v2 6/6] package/{mesa3d, mesa3d-headers}: bump version to 26.2.3 Bernd Kuhls
4 siblings, 0 replies; 7+ messages in thread
From: Bernd Kuhls @ 2026-09-20 21:39 UTC (permalink / raw)
To: buildroot
Cc: Daniel Lang, El Mehdi YOUNES, Joseph Kogut, Romain Naour,
Valentin Korenblit
Buildroot commit 3e296a151195f9d32dbfd62d6c75d08b822be6dd bumped the
package to 25.3.0 which includes upstream commit
https://gitlab.freedesktop.org/mesa/mesa/-/commit/b8b38d38b1c14b60de0324ac2f98ff7f1f4cc3c5
that enforces llvm for the i915 gallium driver causing configure errors
in buildroot:
../output-1/build/mesa3d-26.1.6/meson.build:241:3: ERROR: Feature llvm
cannot be disabled: i915 Gallium driver requires LLVM for vertex shaders
Please note that
https://gitlab.freedesktop.org/mesa/mesa/-/commit/4235c39a9a8378f1e2dc0899dd4c3c941f27b887
later removed the llvm dependency for the r300 driver introduced by the
commit mentioned above so we only need to add the dependency to the i915
driver.
The configure option draw-use-llvm is disabled by default when llvm is
not available:
https://gitlab.freedesktop.org/mesa/mesa/-/commit/37c7d19e46a4863c120186a99ac0344c2dd31260
Fixes:
https://autobuild.buildroot.org/results/acd9039901cf4168e6318c62252ddae6ea0ec93d/
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
v2: no changes
package/mesa3d/Config.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/package/mesa3d/Config.in b/package/mesa3d/Config.in
index e18d25eb8e..f45a675445 100644
--- a/package/mesa3d/Config.in
+++ b/package/mesa3d/Config.in
@@ -147,11 +147,15 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_FREEDRENO
config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_I915
bool "Gallium i915 driver"
depends on BR2_i386 || BR2_x86_64
+ depends on BR2_PACKAGE_MESA3D_LLVM
select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
select BR2_PACKAGE_LIBDRM_INTEL
help
Support for i915-based Intel GPUs.
+comment "i915 driver needs llvm"
+ depends on !BR2_PACKAGE_MESA3D_LLVM
+
config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS
bool "Gallium iris driver"
depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # host-llvm
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread* [Buildroot] [PATCH v2 6/6] package/{mesa3d, mesa3d-headers}: bump version to 26.2.3
2026-09-20 21:39 [Buildroot] [PATCH v2 1/6] package/llvm-project/libclc: apply mesa-libclc patch set Bernd Kuhls
` (3 preceding siblings ...)
2026-09-20 21:39 ` [Buildroot] [PATCH v2 5/6] package/mesa3d: i915 Gallium driver needs llvm Bernd Kuhls
@ 2026-09-20 21:39 ` Bernd Kuhls
2026-10-03 21:19 ` Julien Olivain via buildroot
4 siblings, 1 reply; 7+ messages in thread
From: Bernd Kuhls @ 2026-09-20 21:39 UTC (permalink / raw)
To: buildroot
Cc: Daniel Lang, El Mehdi YOUNES, Joseph Kogut, Romain Naour,
Valentin Korenblit
https://lists.freedesktop.org/archives/mesa-announce/2026-September/000869.html
https://lists.freedesktop.org/archives/mesa-announce/2026-September/000868.html
https://lists.freedesktop.org/archives/mesa-announce/2026-August/000867.html
https://lists.freedesktop.org/archives/mesa-announce/2026-August/000863.html
Removed patch which was applied to fix a build error with gcc < 13 seen
with mesa 26.1.x.
Upstream commit
https://gitlab.freedesktop.org/mesa/mesa/-/commit/3f9451b54c42a37b41246de3ceea991111389c37
added rusticl to the variable with_driver_using_cl which creates a new
dependency to the precomp-compiler:
https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-26.2.2/meson.build?ref_type=tags#L973
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
v2: bumped to 26.2.3
| 2 +-
...er-jay-jay_ir.h-do-not-used-typed-en.patch | 41 -------------------
package/mesa3d/Config.in | 1 +
package/mesa3d/mesa3d.hash | 6 +--
package/mesa3d/mesa3d.mk | 2 +-
5 files changed, 6 insertions(+), 46 deletions(-)
delete mode 100644 package/mesa3d/0005-src-intel-compiler-jay-jay_ir.h-do-not-used-typed-en.patch
--git a/package/mesa3d-headers/mesa3d-headers.mk b/package/mesa3d-headers/mesa3d-headers.mk
index fd715b5f84..42c34f08d9 100644
--- a/package/mesa3d-headers/mesa3d-headers.mk
+++ b/package/mesa3d-headers/mesa3d-headers.mk
@@ -12,7 +12,7 @@ endif
# Not possible to directly refer to mesa3d variables, because of
# first/second expansion trickery...
-MESA3D_HEADERS_VERSION = 26.1.8
+MESA3D_HEADERS_VERSION = 26.2.3
MESA3D_HEADERS_SOURCE = mesa-$(MESA3D_HEADERS_VERSION).tar.xz
MESA3D_HEADERS_SITE = https://archive.mesa3d.org
MESA3D_HEADERS_DL_SUBDIR = mesa3d
diff --git a/package/mesa3d/0005-src-intel-compiler-jay-jay_ir.h-do-not-used-typed-en.patch b/package/mesa3d/0005-src-intel-compiler-jay-jay_ir.h-do-not-used-typed-en.patch
deleted file mode 100644
index af066287e2..0000000000
--- a/package/mesa3d/0005-src-intel-compiler-jay-jay_ir.h-do-not-used-typed-en.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 345ccf93e9d00dfd0f71085832a7df0170b74f74 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex@linutronix.de>
-Date: Sun, 14 Jun 2026 17:42:19 +0200
-Subject: [PATCH] src/intel/compiler/jay/jay_ir.h: do not used typed enum
-
-This is a C23 feature and not supported by gcc < 13, which
-many host distros still have (e.g. Debian 12).
-
-Upstream-Status: Inappropriate [yocto host distro requirements]
-Signed-off-by: Alexander Kanavin <alex@linutronix.de>
-Upstream: N/A, code completely changed upstream
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
----
- src/intel/compiler/jay/jay_ir.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/intel/compiler/jay/jay_ir.h b/src/intel/compiler/jay/jay_ir.h
-index 8307044ef8a..abf175a71bf 100644
---- a/src/intel/compiler/jay/jay_ir.h
-+++ b/src/intel/compiler/jay/jay_ir.h
-@@ -579,7 +579,7 @@ jay_type_is_any_float(enum jay_type t)
- return jay_base_type(t) == JAY_TYPE_F || jay_base_type(t) == JAY_TYPE_BF;
- }
-
--enum jay_predication : uint8_t {
-+enum jay_predication {
- /** No predication. */
- JAY_NOT_PREDICATED = 0,
-
-@@ -634,7 +634,7 @@ typedef struct jay_inst {
- bool decrement_dep:1;
- unsigned padding :12;
-
-- enum jay_predication predication;
-+ uint8_t predication;
- enum jay_conditional_mod conditional_mod;
-
- jay_def cond_flag; /**< conditional flag */
---
-2.55.0
-
diff --git a/package/mesa3d/Config.in b/package/mesa3d/Config.in
index f45a675445..d1b6a38858 100644
--- a/package/mesa3d/Config.in
+++ b/package/mesa3d/Config.in
@@ -64,6 +64,7 @@ config BR2_PACKAGE_MESA3D_RUSTICL
select BR2_PACKAGE_LLVM_RTTI
select BR2_PACKAGE_CLANG
select BR2_PACKAGE_LIBCLC
+ select BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER
select BR2_PACKAGE_SPIRV_TOOLS
select BR2_PACKAGE_SPIRV_LLVM_TRANSLATOR
select BR2_PACKAGE_OPENCL_ICD_LOADER
diff --git a/package/mesa3d/mesa3d.hash b/package/mesa3d/mesa3d.hash
index dc7776488a..fc79ced55c 100644
--- a/package/mesa3d/mesa3d.hash
+++ b/package/mesa3d/mesa3d.hash
@@ -1,6 +1,6 @@
-# From https://lists.freedesktop.org/archives/mesa-announce/2026-August/000865.html
-sha256 b320f65874fd9653ac6c0bd1616605387344e1247411a50c797b5f3fb9dc0b55 mesa-26.1.8.tar.xz
-sha512 eb3d46ae9aaba70fdd908486cef24041fec9264ddf586eaebbba65ce55e716d306ef9e91be83e742dfaec4dfc94105a5cd3a36b29bf56614febcbcf6c1f8b516 mesa-26.1.8.tar.xz
+# From https://lists.freedesktop.org/archives/mesa-announce/2026-September/000869.html
+sha256 1628058a8d2c0615975de5a15ab7bbb9638c50000b5bed9456ff423ea034a81f mesa-26.2.3.tar.xz
+sha512 ec621735ae4679762ea27b979a5314c7aecfdd4165afea19c8c55f933d79b40f01fa041a95874fc4347e732ac565786d9b616a9aa8856a422204d9ecc9a12ec4 mesa-26.2.3.tar.xz
# License
sha256 0d1a0472ecc81830e75c20d59b0ea02841e3db21255e0ebad97ab682c54d6615 docs/license.rst
sha256 323c587d0ccf10e376f8bf9a7f31fb4ca6078105194b42e0b1e0ee2bc9bde71f licenses/MIT
diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk
index 04112eea8e..d68988ff22 100644
--- a/package/mesa3d/mesa3d.mk
+++ b/package/mesa3d/mesa3d.mk
@@ -5,7 +5,7 @@
################################################################################
# When updating the version, please also update mesa3d-headers
-MESA3D_VERSION = 26.1.8
+MESA3D_VERSION = 26.2.3
MESA3D_SOURCE = mesa-$(MESA3D_VERSION).tar.xz
MESA3D_SITE = https://archive.mesa3d.org
MESA3D_LICENSE = MIT, SGI, Khronos
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [Buildroot] [PATCH v2 6/6] package/{mesa3d, mesa3d-headers}: bump version to 26.2.3
2026-09-20 21:39 ` [Buildroot] [PATCH v2 6/6] package/{mesa3d, mesa3d-headers}: bump version to 26.2.3 Bernd Kuhls
@ 2026-10-03 21:19 ` Julien Olivain via buildroot
0 siblings, 0 replies; 7+ messages in thread
From: Julien Olivain via buildroot @ 2026-10-03 21:19 UTC (permalink / raw)
To: Bernd Kuhls
Cc: buildroot, Daniel Lang, El Mehdi YOUNES, Joseph Kogut,
Romain Naour, Valentin Korenblit
Hi Bernd,
Thanks for the patch.
On 20/09/2026 23:39, Bernd Kuhls wrote:
> https://lists.freedesktop.org/archives/mesa-announce/2026-September/000869.html
> https://lists.freedesktop.org/archives/mesa-announce/2026-September/000868.html
> https://lists.freedesktop.org/archives/mesa-announce/2026-August/000867.html
> https://lists.freedesktop.org/archives/mesa-announce/2026-August/000863.html
>
> Removed patch which was applied to fix a build error with gcc < 13 seen
> with mesa 26.1.x.
>
> Upstream commit
> https://gitlab.freedesktop.org/mesa/mesa/-/commit/3f9451b54c42a37b41246de3ceea991111389c37
> added rusticl to the variable with_driver_using_cl which creates a new
> dependency to the precomp-compiler:
> https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-26.2.2/meson.build?ref_type=tags#L973
>
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
> ---
[...]
> diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk
> index 04112eea8e..d68988ff22 100644
> --- a/package/mesa3d/mesa3d.mk
> +++ b/package/mesa3d/mesa3d.mk
> @@ -5,7 +5,7 @@
>
> ################################################################################
>
> # When updating the version, please also update mesa3d-headers
> -MESA3D_VERSION = 26.1.8
> +MESA3D_VERSION = 26.2.3
The mesa3d runtime test (which is testing Rusticl) is failing
with this series. The issue can be reproduced with the command:
utils/docker-run support/testing/run-tests \
-k -d dl -o output_folder \
tests.package.test_mesa3d
The test fail at runtime because the opencl driver cannot loaded.
There is warnings in the execution log:
RUSTICL_ENABLE=llvmpipe clinfo
Libclc failed to load. Please make sure it is installed and provides
spirv-mesa3d-.spv and/or spirv64-mesa3d-.spv
and:
ICD loader properties
[...]
ICD loader Profile OpenCL 3.0
NOTE: your OpenCL library only supports OpenCL 3.0,
but some installed platforms support OpenCL 3.1.
Programs using 3.1 features may crash
or behave unexpectedly
Note that other tests using mesa3d, such as test_weston, are working.
Could you have a look please?
> MESA3D_SOURCE = mesa-$(MESA3D_VERSION).tar.xz
> MESA3D_SITE = https://archive.mesa3d.org
> MESA3D_LICENSE = MIT, SGI, Khronos
> --
> 2.47.3
Best regards,
Julien.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-10-03 21:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-20 21:39 [Buildroot] [PATCH v2 1/6] package/llvm-project/libclc: apply mesa-libclc patch set Bernd Kuhls
2026-09-20 21:39 ` [Buildroot] [PATCH v2 2/6] package/mesa3d: rework OpenCL handling Bernd Kuhls
2026-09-20 21:39 ` [Buildroot] [PATCH v2 3/6] package/mesa3d: precomp-compiler does not need target llvm Bernd Kuhls
2026-09-20 21:39 ` [Buildroot] [PATCH v2 4/6] package/mesa3d: crocus Gallium driver needs precomp-compiler Bernd Kuhls
2026-09-20 21:39 ` [Buildroot] [PATCH v2 5/6] package/mesa3d: i915 Gallium driver needs llvm Bernd Kuhls
2026-09-20 21:39 ` [Buildroot] [PATCH v2 6/6] package/{mesa3d, mesa3d-headers}: bump version to 26.2.3 Bernd Kuhls
2026-10-03 21:19 ` Julien Olivain via buildroot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.