public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Quentin Schulz <foss+yocto@0leil.net>
To: openembedded-core@lists.openembedded.org
Cc: Quentin Schulz <quentin.schulz@cherry.de>,
	 Ross Burton <ross.burton@arm.com>
Subject: [PATCH 6/7] add mesa-tools native-only recipe
Date: Fri, 06 Feb 2026 18:23:58 +0100	[thread overview]
Message-ID: <20260206-mesa-tools-native-v1-6-166935b0e379@cherry.de> (raw)
In-Reply-To: <20260206-mesa-tools-native-v1-0-166935b0e379@cherry.de>

From: Quentin Schulz <quentin.schulz@cherry.de>

libclc is required for some drivers (asahi, panfrost and intel at the
very least).

libclc brings very expensive dependencies such as llvm (through its
spirv-llvm-translator dependency) and clang.

Building clang and llvm for each target architecture is very expensive,
but mesa allows to depend on prebuilt host binaries (mesa-clc and
precomp-compiler). Those are built by mesa as well, but can be compiled
in mesa-native instead of mesa, making the dependency expensive but only
once regardless of the number of target architectures to build for.
Ideally the mesa-clc and precomp-compiler would only be compiled in
mesa-native if target mesa requires libclc support, however this is not
possible as a target recipe cannot impact or depend on a native recipe's
configuration. We thus have two choices, always build libclc in
mesa-native with its heavy dependencies and impact every build, or force
the user to modify the mesa-native recipe in a custom layer (as a native
recipe cannot use target's OVERRIDES). The latter is unacceptable so the
former seems to be the only option. Another big downside is that
mesa-native currently builds drivers (amd, nouveau, svga) which we may
have absolutely no interest in building, increasing the build time and
possibly dependencies list.

A third choice is to spin-off the native mesa recipe with libclc support
into a new recipe without drivers and only what's necessary to build
mesa-clc and precomp-compiler binaries.
This allows to keep a "clean" mesa-native recipe for whoever needs those
drivers built-in (e.g. for testing, for qemu-native, or whatever else)
and only bring the libclc dependency when required by the target recipe.

This is the native mesa tool recipe from the third choice. The next
commit will make use of it in the mesa recipes.

Suggested-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
 meta/conf/distro/include/maintainers.inc        |  1 +
 meta/recipes-graphics/mesa/mesa-tools-native.bb | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index b231daf485..40b1c45a4f 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -525,6 +525,7 @@ RECIPE_MAINTAINER:pn-menu-cache = "Ross Burton <ross.burton@arm.com>"
 RECIPE_MAINTAINER:pn-mesa = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-mesa-demos = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-mesa-gl = "Unassigned <unassigned@yoctoproject.org>"
+RECIPE_MAINTAINER:pn-mesa-tools-native = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-meson = "Trevor Gamblin <tgamblin@baylibre.com>"
 RECIPE_MAINTAINER:pn-meta-environment-${MACHINE} = "Richard Purdie <richard.purdie@linuxfoundation.org>"
 RECIPE_MAINTAINER:pn-meta-environment-extsdk-${MACHINE} = "Richard Purdie <richard.purdie@linuxfoundation.org>"
diff --git a/meta/recipes-graphics/mesa/mesa-tools-native.bb b/meta/recipes-graphics/mesa/mesa-tools-native.bb
new file mode 100644
index 0000000000..50d2f5cbb0
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-tools-native.bb
@@ -0,0 +1,19 @@
+require mesa.inc
+inherit_defer native
+
+SUMMARY += " (tools only)"
+
+PACKAGECONFIG = "tools asahi panfrost"
+# llvm required for libclc
+PACKAGECONFIG += "gallium-llvm"
+# Doesn't compile without wayland-scanner if PLATFORMS has wayland in, and,
+# doesn't compile at all if PLATFORMS is empty so add x11 and wayland
+# 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"
+
+EXTRA_OEMESON += " \
+    -Dmesa-clc=enabled -Dinstall-mesa-clc=true -Dmesa-clc-bundle-headers=enabled \
+    -Dprecomp-compiler=enabled -Dinstall-precomp-compiler=true \
+"

-- 
2.53.0



  parent reply	other threads:[~2026-02-06 17:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 17:23 [PATCH 0/7] mesa: bump + lighten mesa libclc dependency Quentin Schulz
2026-02-06 17:23 ` [PATCH 1/7] mesa: upgrade 25.3.3 -> 25.3.4 Quentin Schulz
2026-02-06 17:23 ` [PATCH 2/7] mesa: update patch status Quentin Schulz
2026-02-06 17:23 ` [PATCH 3/7] mesa: make expat dependency a PACKAGECONFIG Quentin Schulz
2026-02-06 17:23 ` [PATCH 4/7] mesa: make zlib " Quentin Schulz
2026-02-06 17:23 ` [PATCH 5/7] mesa: remove libxml2-native dependency Quentin Schulz
2026-02-06 17:23 ` Quentin Schulz [this message]
2026-02-06 17:31   ` Patchtest results for [PATCH 6/7] add mesa-tools native-only recipe patchtest
2026-02-06 17:23 ` [PATCH 7/7] mesa: depend on mesa-tools-native for less expensive libclc dependency Quentin Schulz
2026-03-20 15:26   ` ernestvanhoecke
2026-03-20 15:57     ` Quentin Schulz
2026-03-26 11:10       ` [OE-core] " Quentin Schulz
2026-03-26 17:34         ` Ernest Van Hoecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260206-mesa-tools-native-v1-6-166935b0e379@cherry.de \
    --to=foss+yocto@0leil.net \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=quentin.schulz@cherry.de \
    --cc=ross.burton@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox