From e35feb1dbe6df6eb38ad15039dcf3e747d4b4fdc Mon Sep 17 00:00:00 2001 From: vasilito Date: Fri, 31 Jul 2026 15:47:56 +0300 Subject: [PATCH] mesa: consume native mesa-clc host tools (-Dmesa-clc=system -Dprecomp-compiler=system) Add the mesa-clc dependency, put its staged usr/bin on PATH so meson's find_program(native) resolves mesa_clc/vtn_bindgen2, and pass -Dmesa-clc=system -Dprecomp-compiler=system. This resolves the cross-build structural error where vtn_bindgen2 (native) linked target libs; with_clc now flips false so the cross build no longer builds the in-tree CLC infra. Verified: cross mesa finds both tools YES and passes every dependency + CLC gate (next blocker is the Redox gallium winsys port). --- local/recipes/libs/mesa/recipe.toml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/local/recipes/libs/mesa/recipe.toml b/local/recipes/libs/mesa/recipe.toml index 6495fb1600..7e5f1b311c 100644 --- a/local/recipes/libs/mesa/recipe.toml +++ b/local/recipes/libs/mesa/recipe.toml @@ -46,6 +46,10 @@ dependencies = [ "libwayland", "linux-kpi", "llvm21", + # Native host shader-precompile tools (mesa_clc, vtn_bindgen2) consumed via + # -Dmesa-clc=system -Dprecomp-compiler=system (the cross build can't run + # Redox target tools on the host). + "mesa-clc", # with_clc also links clang's C++ libraries: Mesa resolves clang via # cpp.find_library('clang-cpp', dirs: llvm-config --libdir), and the # llvm-config wrapper rewrites libdir to Mesa's target sysroot/lib. So the @@ -118,7 +122,17 @@ else COOKBOOK_MESON_FLAGS+=(-Dshared-llvm=disabled) fi +# The build-time shader compilers (mesa_clc, vtn_bindgen2) cannot be run as +# Redox target binaries on the host, so we consume the natively-built host tools +# from the mesa-clc dependency (staged into usr/bin) via -Dmesa-clc=system +# -Dprecomp-compiler=system. Put them on PATH so meson's find_program(native) +# resolves them. This also flips with_clc to false, so the cross build no longer +# links the in-tree CLC infra (LLVMSPIRVLib/SPIRV-Tools/clang). +export PATH="${COOKBOOK_SYSROOT}/usr/bin:${PATH}" + cookbook_meson \ + -Dmesa-clc=system \ + -Dprecomp-compiler=system \ -Ddri-drivers-path=/usr/lib/dri \ -Degl=enabled \ -Dgbm=enabled \