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 \