Skip to contentSkip to conversation

mesa: Upgrade to 26.1.5

PATCH In review Zoltán Böszörményi 2 participants 7 messages Jul 19 – Jul 22

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 mesa: Upgrade to 26.1.5

See the announcement:
https://lists.freedesktop.org/archives/mesa-dev/2026-July/226671.html

---
 meta/recipes-graphics/mesa/mesa.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-graphics/mesa/mesa.inc +2 -2
index bb071e2411..15d56c804d 100644
@@ -23,8 +23,8 @@ SRC_URI = "https://archive.mesa3d.org/mesa-${PV}.tar.xz \
            file://0001-src-util-u_math.c-do-not-use-arm-fpu-instructions-if.patch \
            "
 
-SRC_URI[sha256sum] = "072705caa9adf4740f1489194b13e278ad959166863b5271fe423a86353c9ab6"
-PV = "26.1.4"
+SRC_URI[sha256sum] = "79e421c7ce18cd9e790b8375920325779f10798630bf30e0b22f1a21c8617122"
+PV = "26.1.5"
 
 UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)"
 
Signature · 1 line
2.55.0
#1 lore raw

PATCH v2 2/3 mesa-libclc: New recipe for forking libclc for Rusticl purposes in Mesa

See the reasoning and discussion at
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/43020

TL;DR: LLVM constantly introduces breaking changes that cause regressions for running OpenCL CTS with Rusticl and finally Karol Herbst had enough.

This fork is from the LLVM 22 version of libclc and contains the necessary fixes to make Rusticl pass OpenCL CTS.

---
 meta/conf/distro/include/maintainers.inc      |  1 +
 meta/recipes-graphics/mesa/mesa-libclc_git.bb | 27 +++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 meta/recipes-graphics/mesa/mesa-libclc_git.bb
meta/conf/distro/include/maintainers.inc +1 -0
index 4c6307086c..927318e7f1 100644
@@ -523,6 +523,7 @@ RECIPE_MAINTAINER:pn-menu-cache = "Ross Burton <[email protected]>"
 RECIPE_MAINTAINER:pn-mesa = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-mesa-demos = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-mesa-gl = "Unassigned <[email protected]>"
+RECIPE_MAINTAINER:pn-mesa-libclc = "Zoltán Böszörményi <[email protected]>"
 RECIPE_MAINTAINER:pn-mesa-tools-native = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-meson = "Trevor Gamblin <[email protected]>"
 RECIPE_MAINTAINER:pn-meta-environment-${MACHINE} = "Richard Purdie <[email protected]>"
meta/recipes-graphics/mesa/mesa-libclc_git.bb new file +27 -0
new file mode 100644
index 0000000000..8a3a78d051
@@ -0,0 +1,27 @@
+SUMMARY = "Mesa fork of libclc: Implementation of the library requirements of the OpenCL C programming language."
+HOMEPAGE = "https://gitlab.freedesktop.org/karolherbst/mesa-libclc/"
+SECTION = "devel"
+LICENSE = "Apache-2.0-with-LLVM-exception"
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=7cc795f6cbb2d801d84336b83c8017db"
+
+SRC_URI = "git://gitlab.freedesktop.org/karolherbst/mesa-libclc.git;protocol=https;branch=llvm_22"
+
+SRCREV = "b1934c37694714352edc19232e23480feaf18ab4"
+PV = "0.1.0"
+
+inherit cmake pkgconfig
+
+# Depend explicitly on clang-native instead of using TOOLCHAIN as the build
+# objects from this recipe are build explicitly using clang for GPU targets.
+# We could INHIBIT_DEFAULT_DEPS to avoid any other toolchain but then we need
+# to wrestle CMake to configure without a toolchain.
+DEPENDS += "clang-native spirv-llvm-translator-native"
+
+# Semicolon-separated list of targets to build
+LIBCLC_TARGETS ?= "all"
+
+EXTRA_OECMAKE += "-DLIBCLC_TARGETS_TO_BUILD='${LIBCLC_TARGETS}'"
+
+FILES:${PN} += "${datadir}/mesa-clc"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.55.0
#2 lore raw

Re: [OE-core] [PATCH v2 2/3] mesa-libclc: New recipe for forking libclc for Rusticl purposes in Mesa

Hi Zoltan, everybody,

Quoted 10 lines · Zoltan Boszormenyi via lists.openembedded.org

See the reasoning and discussion at
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/43020

TL;DR: LLVM constantly introduces breaking changes that cause regressions for running OpenCL CTS with Rusticl and finally Karol Herbst had enough.

This fork is from the LLVM 22 version of libclc and contains the necessary fixes to make Rusticl pass OpenCL CTS.

I think this may be too early as this is still pending upstream and is currently not receiving support from at least one person involved there.

Also, aren't we going to have an issue if we have libclc AND mesa-libclc built at the same time?

Cheers,
Quentin

#3 lore raw

Re: [OE-core] [PATCH v2 2/3] mesa-libclc: New recipe for forking libclc for Rusticl purposes in Mesa

2026. 07. 20. 16:43 keltezéssel, Quentin Schulz írta:

Quoted 10 lines

Hi Zoltan, everybody,

Quoted 7 lines · Zoltan Boszormenyi via lists.openembedded.org

See the reasoning and discussion at
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/43020

TL;DR: LLVM constantly introduces breaking changes that cause regressions for running OpenCL CTS with Rusticl and finally Karol Herbst had enough.

Quoted 5 lines
Quoted 3 lines

This fork is from the LLVM 22 version of libclc and contains the necessary fixes to make Rusticl pass OpenCL CTS.

I think this may be too early as this is still pending upstream and is currently not receiving support from at least one person involved there.

That one person's objection is now alleviated by not requiring the mesa-libclc dependency exclusively. It was replaced by a runtime check and a warning when not running this fork.

As a result, the mesa-libclc repo was rebased twice since I posted this recipe.

So the MR is still definitely in flux.

Hopefully, by 26.2.0, it plays out and gets backported.

Quoted 1 line

Also, aren't we going to have an issue if we have libclc AND mesa-libclc built at the same time?

No, because they install differently names files or into different locations. For mesa-libclc, the pkgconfig file is renamed and the install path is ${datadir}/mesa-clc.

#4 lore raw

Re: [OE-core] [PATCH v2 2/3] mesa-libclc: New recipe for forking libclc for Rusticl purposes in Mesa

Hi Zoltán,

Quoted 15 lines · Böszörményi Zoltán

2026. 07. 20. 16:43 keltezéssel, Quentin Schulz írta:

Quoted 14 lines

Hi Zoltan, everybody,

Quoted 10 lines · Zoltan Boszormenyi via lists.openembedded.org

See the reasoning and discussion at
https://eur02.safelinks.protection.outlook.com/? url=https%3A%2F%2Fgitlab.freedesktop.org%2Fmesa%2Fmesa%2F- %2Fmerge_requests%2F43020&data=05%7C02%7Cquentin.schulz%40cherry.de%7Cebbe0f4e8df54c2c252b08dee6ddba7e%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C639202037154557993%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=JWuaPEkNjN6Y5zTeDBao%2Fk0bDR1FKZsaOgDck4evP2E%3D&reserved=0

TL;DR: LLVM constantly introduces breaking changes that cause regressions for running OpenCL CTS with Rusticl and finally Karol Herbst had enough.

This fork is from the LLVM 22 version of libclc and contains the necessary fixes to make Rusticl pass OpenCL CTS.

Quoted 8 lines
Quoted 1 line

I think this may be too early as this is still pending upstream and is currently not receiving support from at least one person involved there.

That one person's objection is now alleviated by not requiring the mesa-libclc dependency exclusively. It was replaced by a runtime check and a warning when not running this fork.

As a result, the mesa-libclc repo was rebased twice since I posted this recipe.

Rebasing is a big issue for us. I'm assuming Karol knows better and won't do it once it's actually used by mesa officially.

Quoted 4 lines

So the MR is still definitely in flux.

Hopefully, by 26.2.0, it plays out and gets backported.

Not sure they will want to backport it but let's see. I'm assuming they will not do releases on that fork, are we expected to always update whenever there's a new commit? How do we make sure we use a version of libclc they are expecting us to use with mesa? (e.g. not forget to bump mesa-libclc when we update mesa).

Quoted 6 lines
Quoted 1 line

Also, aren't we going to have an issue if we have libclc AND mesa- libclc built at the same time?

No, because they install differently names files or into different locations. For mesa-libclc, the pkgconfig file is renamed and the install path is ${datadir}/mesa-clc.

ACK.

Cheers,
Quentin

#5 lore raw

Re: [OE-core] [PATCH v2 2/3] mesa-libclc: New recipe for forking libclc for Rusticl purposes in Mesa

2026. 07. 21. 11:01 keltezéssel, Quentin Schulz írta:

Quoted 27 lines

Hi Zoltán,

Quoted 15 lines · Böszörményi Zoltán

2026. 07. 20. 16:43 keltezéssel, Quentin Schulz írta:

Quoted 14 lines

Hi Zoltan, everybody,

Quoted 10 lines · Zoltan Boszormenyi via lists.openembedded.org

See the reasoning and discussion at
https://eur02.safelinks.protection.outlook.com/? url=https%3A%2F%2Fgitlab.freedesktop.org%2Fmesa%2Fmesa%2F- %2Fmerge_requests%2F43020&data=05%7C02%7Cquentin.schulz%40cherry.de%7Cebbe0f4e8df54c2c252b08dee6ddba7e%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C639202037154557993%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=JWuaPEkNjN6Y5zTeDBao%2Fk0bDR1FKZsaOgDck4evP2E%3D&reserved=0

TL;DR: LLVM constantly introduces breaking changes that cause regressions for running OpenCL CTS with Rusticl and finally Karol Herbst had enough.

This fork is from the LLVM 22 version of libclc and contains the necessary fixes to make Rusticl pass OpenCL CTS.

Quoted 8 lines
Quoted 1 line

I think this may be too early as this is still pending upstream and is currently not receiving support from at least one person involved there.

That one person's objection is now alleviated by not requiring the mesa-libclc dependency exclusively. It was replaced by a runtime check and a warning when not running this fork.

As a result, the mesa-libclc repo was rebased twice since I posted this recipe.

Quoted 8 lines

Rebasing is a big issue for us. I'm assuming Karol knows better and won't do it once it's actually used by mesa officially.

Quoted 4 lines

So the MR is still definitely in flux.

Hopefully, by 26.2.0, it plays out and gets backported.

Not sure they will want to backport it but let's see.

Two out of the three commits have the "Backport-to: *" line. So if this MR happens to get merged before 26.1 is EOL, they will get into that version, too, in a slightly different form, as the first one changes the context for the two later commits.

Quoted 1 line

 I'm assuming they will not do releases on that fork, are we expected to always update whenever there's a new commit? How do we make sure we use a version of libclc they are expecting us to use with mesa? (e.g. not forget to bump mesa-libclc when we update mesa).

I will keep an open eye on the mesa-libclc project.

Eventually I would like to see Rusticl replace intel-compute-runtime, of which the legacy version (requiring LLVM 14!) is carried forward in my meta-clang-revival layer, forked from an older meta-intel branch.

Quoted 12 lines
Quoted 7 lines
Quoted 2 lines

Also, aren't we going to have an issue if we have libclc AND mesa- libclc built at the same time?

No, because they install differently names files or into different locations. For mesa-libclc, the pkgconfig file is renamed and the install path is ${datadir}/mesa-clc.

ACK.

Cheers,
Quentin

#6 lore raw

PATCH v2 3/3 mesa, mesa-tools-native: Use mesa-libclc

In reply to Zoltán Böszörményi

Backport two patches from
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/43020
to use mesa-libclc, which makes Rusticl's OpenCL C more correct.

---
 ...-optional-for-configs-not-needing-it.patch | 123 ++++++++++++++++++
 ...lc-use-our-downstream-fork-of-libclc.patch |  43 ++++++
 .../mesa/mesa-tools-native.bb                 |   2 +-
 meta/recipes-graphics/mesa/mesa.inc           |   6 +-
 4 files changed, 171 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-graphics/mesa/files/0001-clc-make-libclc-optional-for-configs-not-needing-it.patch
 create mode 100644 meta/recipes-graphics/mesa/files/0002-clc-use-our-downstream-fork-of-libclc.patch
meta/recipes-graphics/mesa/files/0001-clc-make-libclc-optional-for-configs-not-needing-it.patch new file +123 -0
new file mode 100644
index 0000000000..a52931dbf5
@@ -0,0 +1,123 @@
+From 5df2fb59c32fd6e3ad53bdaf98afccfddbdd14fc Mon Sep 17 00:00:00 2001
+From: Karol Herbst <[email protected]>
+Date: Fri, 17 Jul 2026 17:45:45 +0200
+Subject: [PATCH 1/2] clc: make libclc optional for configs not needing it
+
+Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/43020]
+---
+ meson.build                  |  2 +-
+ src/compiler/clc/meson.build | 73 +++++++++++++++++++-----------------
+ 2 files changed, 39 insertions(+), 36 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 1eca91fc940..68bbb942b99 100644
+--- a/meson.build
++++ b/meson.build
+@@ -949,7 +949,7 @@ with_poly = [
+ ].contains(true)
+ 
+ dep_clc = null_dep
+-if with_clc
++if with_gallium_rusticl or with_microsoft_clc
+   dep_clc = dependency('libclc')
+ endif
+ 
+diff --git a/src/compiler/clc/meson.build b/src/compiler/clc/meson.build
+index 9ff61440f0d..249fd31f478 100644
+--- a/src/compiler/clc/meson.build
++++ b/src/compiler/clc/meson.build
+@@ -4,7 +4,6 @@
+ files_libmesaclc = files(
+   'clc.c',
+   'clc_helpers.cpp',
+-  'nir_load_libclc.c',
+ )
+ 
+ _libmesaclc_c_args = []
+@@ -41,45 +40,49 @@ if not _shared_llvm or \
+   _libmesaclc_cpp_args += ['-DUSE_STATIC_OPENCL_C_H=1']
+ endif
+ 
+-_basedir = dep_clc.get_variable(pkgconfig : 'libexecdir')
++if dep_clc.found()
++  files_libmesaclc += 'nir_load_libclc.c'
+ 
+-_static_libclc = get_option('static-libclc')
+-if _static_libclc.length() > 0
+-  if _static_libclc.contains('all')
+-    _static_libclc = ['spirv', 'spirv64']
+-  endif
+-  prog_zstd = find_program('zstd', required : false, native : true)
+-  _zstd_static_libclc = dep_zstd.found() and prog_zstd.found()
+-  if _zstd_static_libclc
+-    _libmesaclc_c_args += '-DHAVE_STATIC_LIBCLC_ZSTD'
+-  endif
+-  foreach s : _static_libclc
+-    _libmesaclc_c_args += '-DHAVE_STATIC_LIBCLC_@0@'.format(s.to_upper())
+-    f = '@[email protected]'.format(s)
+-    _libclc_file = _basedir / f
++  _basedir = dep_clc.get_variable(pkgconfig : 'libexecdir')
++
++  _static_libclc = get_option('static-libclc')
++  if _static_libclc.length() > 0
++    if _static_libclc.contains('all')
++      _static_libclc = ['spirv', 'spirv64']
++    endif
++    prog_zstd = find_program('zstd', required : false, native : true)
++    _zstd_static_libclc = dep_zstd.found() and prog_zstd.found()
+     if _zstd_static_libclc
+-      _libclc_file = custom_target(
+-        '@[email protected]'.format(f),
+-        command : [prog_zstd, '-f', '@INPUT@', '-o', '@OUTPUT@'],
++      _libmesaclc_c_args += '-DHAVE_STATIC_LIBCLC_ZSTD'
++    endif
++    foreach s : _static_libclc
++      _libmesaclc_c_args += '-DHAVE_STATIC_LIBCLC_@0@'.format(s.to_upper())
++      f = '@[email protected]'.format(s)
++      _libclc_file = _basedir / f
++      if _zstd_static_libclc
++        _libclc_file = custom_target(
++          '@[email protected]'.format(f),
++          command : [prog_zstd, '-f', '@INPUT@', '-o', '@OUTPUT@'],
++          input : [_libclc_file],
++          output : '@[email protected]'.format(f),
++        )
++      endif
++      files_libmesaclc += custom_target(
++        '@[email protected]'.format(f),
++        command : [
++          prog_python, files_xxd, '-b', '@INPUT@', '@OUTPUT@',
++          '-n', 'libclc_@0@_mesa3d_spv'.format(s),
++        ],
+         input : [_libclc_file],
+-        output : '@[email protected]'.format(f),
++        output : '@[email protected]'.format(f),
++        depend_files : files_xxd,
+       )
++    endforeach
++  else
++    _libmesaclc_c_args += ['-DDYNAMIC_LIBCLC_PATH="@0@/"'.format(_basedir)]
++    if not cc.has_function('mmap')
++      error('mmap required for dynamic libCLC loading')
+     endif
+-    files_libmesaclc += custom_target(
+-      '@[email protected]'.format(f),
+-      command : [
+-        prog_python, files_xxd, '-b', '@INPUT@', '@OUTPUT@',
+-        '-n', 'libclc_@0@_mesa3d_spv'.format(s),
+-      ],
+-      input : [_libclc_file],
+-      output : '@[email protected]'.format(f),
+-      depend_files : files_xxd,
+-    )
+-  endforeach
+-else
+-  _libmesaclc_c_args += ['-DDYNAMIC_LIBCLC_PATH="@0@/"'.format(_basedir)]
+-  if not cc.has_function('mmap')
+-    error('mmap required for dynamic libCLC loading')
+   endif
+ endif
+ 
+-- 
+2.55.0
+
meta/recipes-graphics/mesa/files/0002-clc-use-our-downstream-fork-of-libclc.patch new file +43 -0

43 lines not on this page · raw message

meta/recipes-graphics/mesa/mesa-tools-native.bb +1 -1
index 20207450bf..c495d2e8a8 100644
@@ -11,7 +11,7 @@ PACKAGECONFIG += "gallium-llvm"
 # to PACKAGECONFIG like in mesa.inc
 PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'x11 wayland', d)}"
 
-DEPENDS += "libclc-native spirv-tools-native spirv-llvm-translator-native"
+DEPENDS += "mesa-libclc-native spirv-tools-native spirv-llvm-translator-native"
 
 EXTRA_OEMESON += " \
     -Dmesa-clc=enabled -Dinstall-mesa-clc=true -Dmesa-clc-bundle-headers=enabled \
meta/recipes-graphics/mesa/mesa.inc +4 -2
index 15d56c804d..dea7a8295f 100644
@@ -21,6 +21,8 @@ SRC_URI = "https://archive.mesa3d.org/mesa-${PV}.tar.xz \
            file://0001-src-intel-compiler-jay-jay_ir.h-do-not-used-typed-en.patch \
            file://0001-src-intel-compiler-jay-fix-GCC-10-case-label-declara.patch \
            file://0001-src-util-u_math.c-do-not-use-arm-fpu-instructions-if.patch \
+           file://0001-clc-make-libclc-optional-for-configs-not-needing-it.patch \
+           file://0002-clc-use-our-downstream-fork-of-libclc.patch \
            "
 
 SRC_URI[sha256sum] = "79e421c7ce18cd9e790b8375920325779f10798630bf30e0b22f1a21c8617122"
@@ -110,7 +112,7 @@ PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false"
 
 # "opencl" also requires libclc and gallium-llvm to be present in PACKAGECONFIG!
 # Be sure to enable them both for the target and for the native build.
-PACKAGECONFIG[opencl] = "-Dgallium-rusticl=true -Dmesa-clc-bundle-headers=enabled, -Dgallium-rusticl=false, bindgen-cli-native clang libclc spirv-tools spirv-llvm-translator"
+PACKAGECONFIG[opencl] = "-Dgallium-rusticl=true -Dmesa-clc-bundle-headers=enabled, -Dgallium-rusticl=false, bindgen-cli-native clang mesa-libclc spirv-tools spirv-llvm-translator"
 
 X11_DEPS = "xorgproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes xrandr xorgproto libxshmfence"
 # "x11" requires "opengl"
@@ -254,7 +256,7 @@ RPROVIDES:libopencl-mesa += "virtual-opencl-icd"
 RPROVIDES:libgles2-mesa += "libgles3-mesa"
 RPROVIDES:libgles2-mesa-dev += "libgles3-mesa-dev"
 
-RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'libclc', '', d)}"
+RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'mesa-libclc', '', d)}"
 
 PACKAGES =+ "libegl-mesa libegl-mesa-dev \
              libgallium \
Signature · 1 line
2.55.0