mbox series

[0/8] mesa: upgrade to 25.0.2

Message ID 20250327135520.3920189-1-dmitry.baryshkov@oss.qualcomm.com
Headers show
Series mesa: upgrade to 25.0.2 | expand

Message

Dmitry Baryshkov March 27, 2025, 1:55 p.m. UTC
libclc is required in order to build Intel drivers in Mesa 24.1 and
later. Thus OE-Core is currently locked to the 24.0.x branch, which is
no longer maintained, having last release in June 2024.

A clean solution is to package Clang, then use it to build libclc and
SPIRV-LLVM-Translator (required for Mesa OpenCL support). However
creating proper recipes for Clang is a long process (ongoing by Khem
Raj).

This patchset attempts to solve the issue in a simpler way: by building
libclc and SPIRV-LLVM-Translator together with the LLVM. This way we
don't have to create target Clang recipes, there is no extra toolchain
to support, etc. Clang binaries are creted as a part of the build
process (in order to support building target packages), however it only
hits the LLVM sysroot-native and is only used by the LLVM target build.

Future work by Khem (once Clang is properly supported in OE-Core) should
allow us to create proper recipes for libclc and spirv-llvm-translator
and drop them from the llvm / clang recipe.

I think this approach provides a good balance between OE-Core being
stuck with the outdated Mesa release and being able to upgrade it,
bringing support for new hardware.

Last two patches of the series bring in RustiCL support, a new OpenCL
implementation within Mesa. They are optional for the sake of the
upgrade and can be dropped if there is any issue with those. RustiCL
support is mostly compile-tested at this point.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

Dmitry Baryshkov (7):
  llvm: move libLLVM.so.N.M to llvm-libllvm package
  llvm: use OECMAKE_SOURCEPATH to specify cmake dir
  llvm: support building libclc
  llvm: import YOCTO_ALTERNATE_LIBDIR patch from meta-clang
  llvm: add SPIRV-LLVM-Translator support
  mesa: upgrade 24.0.7 -> 25.0.2
  bindgen-cli: a tool to generate Rust bindings

Zoltán Böszörményi (1):
  mesa: add support for RustiCL under PACKAGECONFIG "opencl"

 meta/conf/distro/include/maintainers.inc      |   1 +
 .../bindgen-cli/bindgen-cli-crates.inc        | 186 ++++++++++++++++++
 .../bindgen-cli/bindgen-cli_0.71.1.bb         |  19 ++
 ...ossCompile-pass-SPIR-V-headers-path-.patch |  40 ++++
 ...-llvm-allow-env-override-of-exe-path.patch |  41 +++-
 .../llvm/llvm/fix-native-compilation.patch    |  67 +++++++
 meta/recipes-devtools/llvm/llvm/llvm-config   |   7 +
 .../llvm/llvm/spirv-internal-build.patch      |  27 +++
 meta/recipes-devtools/llvm/llvm_20.1.0.bb     |  76 ++++++-
 ...-meson-do-not-pull-in-clc-for-clover.patch |  53 -----
 ...lude-missing-llvm-IR-header-Module.h.patch |  41 ----
 .../0001-drisw-fix-build-without-dri3.patch   |  58 ------
 ...on-t-encode-build-path-into-binaries.patch |  46 ++++-
 ...son-use-target-path-for-Clang-libdir.patch |  42 ++++
 ...cross-compilation-arguments-to-LLVM-.patch |  64 ++++++
 ...on-t-try-zink-if-not-enabled-in-mesa.patch |  42 ----
 meta/recipes-graphics/mesa/mesa.inc           | 103 +++++-----
 17 files changed, 656 insertions(+), 257 deletions(-)
 create mode 100644 meta/recipes-devtools/bindgen-cli/bindgen-cli-crates.inc
 create mode 100644 meta/recipes-devtools/bindgen-cli/bindgen-cli_0.71.1.bb
 create mode 100644 meta/recipes-devtools/llvm/llvm/0001-cmake-modules-CrossCompile-pass-SPIR-V-headers-path-.patch
 create mode 100644 meta/recipes-devtools/llvm/llvm/fix-native-compilation.patch
 create mode 100644 meta/recipes-devtools/llvm/llvm/spirv-internal-build.patch
 delete mode 100644 meta/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch
 delete mode 100644 meta/recipes-graphics/mesa/files/0001-amd-Include-missing-llvm-IR-header-Module.h.patch
 delete mode 100644 meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch
 create mode 100644 meta/recipes-graphics/mesa/files/0001-meson-use-target-path-for-Clang-libdir.patch
 create mode 100644 meta/recipes-graphics/mesa/files/0001-rusticl-provide-cross-compilation-arguments-to-LLVM-.patch
 delete mode 100644 meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch

Comments

Mathieu Dubois-Briand March 27, 2025, 4:49 p.m. UTC | #1
On Thu Mar 27, 2025 at 2:55 PM CET, Dmitry Baryshkov via lists.openembedded.org wrote:
> libclc is required in order to build Intel drivers in Mesa 24.1 and
> later. Thus OE-Core is currently locked to the 24.0.x branch, which is
> no longer maintained, having last release in June 2024.
>
> A clean solution is to package Clang, then use it to build libclc and
> SPIRV-LLVM-Translator (required for Mesa OpenCL support). However
> creating proper recipes for Clang is a long process (ongoing by Khem
> Raj).
>
> This patchset attempts to solve the issue in a simpler way: by building
> libclc and SPIRV-LLVM-Translator together with the LLVM. This way we
> don't have to create target Clang recipes, there is no extra toolchain
> to support, etc. Clang binaries are creted as a part of the build
> process (in order to support building target packages), however it only
> hits the LLVM sysroot-native and is only used by the LLVM target build.
>
> Future work by Khem (once Clang is properly supported in OE-Core) should
> allow us to create proper recipes for libclc and spirv-llvm-translator
> and drop them from the llvm / clang recipe.
>
> I think this approach provides a good balance between OE-Core being
> stuck with the outdated Mesa release and being able to upgrade it,
> bringing support for new hardware.
>
> Last two patches of the series bring in RustiCL support, a new OpenCL
> implementation within Mesa. They are optional for the sake of the
> upgrade and can be dropped if there is any issue with those. RustiCL
> support is mostly compile-tested at this point.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

Hi Dmitry,

Thanks for your patch.

It looks like this is breaking some builds on the autobuilder, with
following error:

| --- stdout ---
|
| --- stderr ---
| <built-in>:1:10: fatal error: 'opencl-c-base.h' file not found
| Error executing LLVM compilation action.
|

This one did happen in a lot of builds, here are the first ones:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/2/builds/1284
https://autobuilder.yoctoproject.org/valkyrie/#/builders/4/builds/1283
https://autobuilder.yoctoproject.org/valkyrie/#/builders/6/builds/1298

Another one, maybe related to musl:

| /srv/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/hosttools/ld: /srv/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/work/core2-64-poky-linux-musl/llvm/20.1.0/recipe-sysroot-native/usr/lib/libzstd.so: undefined reference to `pthread_join@GLIBC_2.34'
| /srv/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/hosttools/ld: /srv/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/work/core2-64-poky-linux-musl/llvm/20.1.0/recipe-sysroot-native/usr/lib/libzstd.so: undefined reference to `pthread_create@GLIBC_2.34'
| collect2: error: ld returned 1 exit status

https://autobuilder.yoctoproject.org/valkyrie/#/builders/3/builds/1320

And another one:

| ../mesa-25.0.2/src/compiler/spirv/meson.build:85:22: ERROR: Tried to mix a host machine library ("vtn") with a build machine target "vtn_bindgen" This is not possible in a cross build.

https://autobuilder.yoctoproject.org/valkyrie/#/builders/11/builds/1251

Best regards,
Mathieu