Skip to contentSkip to conversation

package/llvm-project/libclc: apply mesa-libclc patch set

PATCH In review Bernd Kuhls 2 participants 7 messages Sep 20 – Oct 3

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/6 package/llvm-project/libclc: apply mesa-libclc patch set

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.

---
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
package/llvm-project/libclc/0001-libclc-disable-use-of-SPV_KHR_fma-extension.patch new file +36 -0
new file mode 100644
index 0000000000..482d61dbff
@@ -0,0 +1,36 @@
+From 0fdefef847d704b0162cacdbafe01350f4531a61 Mon Sep 17 00:00:00 2001
+From: Karol Herbst <[email protected]>
+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 <[email protected]>
+---
+ 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
+
package/llvm-project/libclc/0002-libclc-restore-old-fma-behavior.patch new file +65 -0

65 lines not on this page · raw message

package/llvm-project/libclc/0003-libclc-add-__clc_mesa_libclc_version.patch new file +49 -0

49 lines not on this page · raw message

package/llvm-project/libclc/0004-libclc-disable-fp16-version-of-atan2-and-atan2pi.patch new file +56 -0

56 lines not on this page · raw message

package/llvm-project/libclc/0005-libclc-Revert-libclc-Update-remquo-187998.patch new file +595 -0

595 lines not on this page · raw message

package/llvm-project/libclc/0006-libclc-Revert-libclc-Update-hypot-implementation-185.patch new file +171 -0

171 lines not on this page · raw message

package/llvm-project/libclc/0007-libclc-Partly-revert-libclc-Update-trigpi-functions-.patch new file +173 -0

173 lines not on this page · raw message

package/llvm-project/libclc/0008-libclc-fix-tgamma-precision-issues-due-to-lack-of-fm.patch new file +80 -0

80 lines not on this page · raw message

package/llvm-project/libclc/0009-revert-10644a1-v3.patch new file +37 -0
new file mode 100644
index 0000000000..ad5eb1b98e
@@ -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 <[email protected]>
+
+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}
package/llvm-project/libclc/libclc.mk +8 -3
index ff00871747..2f59ca3dec 100644
@@ -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))
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH v2 2/6 package/mesa3d: rework OpenCL handling

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

---
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(-)
Config.in.legacy +9 -0
index bb6257f532..e3824ca927 100644
@@ -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
package/mesa3d/Config.in +7 -25
index e184039150..cb86e6a2a4 100644
@@ -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
 
package/mesa3d/mesa3d.mk +3 -5
index 87c7f427e4..c103345e86 100644
@@ -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 \
support/testing/tests/package/test_mesa3d.py +0 -1
index 24fc6df59e..193aa7a373 100644
@@ -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
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

PATCH v2 3/6 package/mesa3d: precomp-compiler does not need target llvm

In reply to Bernd Kuhls

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.

---
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(-)
package/mesa3d/Config.in +26 -20
index cb86e6a2a4..feed6b68fe 100644
@@ -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"
package/mesa3d/mesa3d.mk +7 -1
index c103345e86..04112eea8e 100644
@@ -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 \
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH v2 4/6 package/mesa3d: crocus Gallium driver needs precomp-compiler

In reply to Bernd Kuhls

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/

---
v2: no changes

 package/mesa3d/Config.in | 8 ++++++++
 1 file changed, 8 insertions(+)
package/mesa3d/Config.in +8 -0
index feed6b68fe..e18d25eb8e 100644
@@ -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
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

PATCH v2 5/6 package/mesa3d: i915 Gallium driver needs llvm

In reply to Bernd Kuhls

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/

---
v2: no changes

 package/mesa3d/Config.in | 4 ++++
 1 file changed, 4 insertions(+)
package/mesa3d/Config.in +4 -0
index e18d25eb8e..f45a675445 100644
@@ -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
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

PATCH v2 6/6 package/{mesa3d, mesa3d-headers}: bump version to 26.2.3

In reply to Bernd Kuhls

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

---
v2: bumped to 26.2.3

 package/mesa3d-headers/mesa3d-headers.mk      |  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
package/mesa3d-headers/mesa3d-headers.mk +1 -1
index fd715b5f84..42c34f08d9 100644
@@ -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
package/mesa3d/0005-src-intel-compiler-jay-jay_ir.h-do-not-used-typed-en.patch deleted +0 -41

41 lines not on this page · raw message

package/mesa3d/Config.in +1 -0
index f45a675445..d1b6a38858 100644
@@ -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
package/mesa3d/mesa3d.hash +3 -3
index dc7776488a..fc79ced55c 100644
@@ -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
package/mesa3d/mesa3d.mk +1 -1
index 04112eea8e..d68988ff22 100644
@@ -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
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw

Re: [Buildroot] [PATCH v2 6/6] package/{mesa3d, mesa3d-headers}: bump version to 26.2.3

Hi Bernd,

Thanks for the patch.

Quoted 16 lines · Bernd Kuhls

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

---

[...]

package/mesa3d/mesa3d.mk line 9

Quoted 11 lines
package/mesa3d/mesa3d.mk +1 -1
index 04112eea8e..d68988ff22 100644
@@ -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?

Quoted 5 lines
package/mesa3d/mesa3d.mk +0 -0
 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
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot