mesa: use host wayland-scanner for protocol codegen (fix exit 127)

meson 26.1.4 resolves wayland-scanner from the target wayland-scanner.pc, whose
absolute path is COOKBOOK_SYSROOT/usr/bin/wayland-scanner — the Redox cross
binary, which cannot execute on the Linux build host (ninja: code=127 "cannot
execute: required file not found") when generating fifo-v1-protocol.c etc. The
$WAYLAND_SCANNER env / PATH symlink do not help (meson uses the .pc absolute
path). Protocol codegen is host/target-independent, so overwrite the sysroot
copy with the runnable host wayland-scanner before meson runs. Next Redox mesa
port gap after alloca.
This commit is contained in:
2026-07-24 16:21:09 +09:00
parent 3de4a53b61
commit db186fe906
+10
View File
@@ -53,6 +53,16 @@ ln -sf "$(command -v "${LLVM_CONFIG}")" .cookbook-tools/llvm-config
if [ -x "/usr/bin/wayland-scanner" ]; then
ln -sf "/usr/bin/wayland-scanner" .cookbook-tools/wayland-scanner
fi
# meson 26.1.4 resolves wayland-scanner from the TARGET wayland-scanner.pc, which
# hardcodes ${COOKBOOK_SYSROOT}/usr/bin/wayland-scanner — but that is the Redox
# (cross) binary and CANNOT execute on the Linux build host (ninja fails with
# code=127 "cannot execute: required file not found"). The generated protocol C
# is host/target-independent, so replace the sysroot copy with the runnable host
# wayland-scanner. PATH/$WAYLAND_SCANNER overrides do not help because meson uses
# the .pc's absolute path.
if [ -x "/usr/bin/wayland-scanner" ] && [ -e "${COOKBOOK_SYSROOT}/usr/bin/wayland-scanner" ]; then
cp -f "/usr/bin/wayland-scanner" "${COOKBOOK_SYSROOT}/usr/bin/wayland-scanner"
fi
for tool in gcc-ar gcc-ranlib g++ gcc cpp c++; do
src="$(command -v "${TARGET}-${tool}" 2>/dev/null)"
if [ -n "$src" ]; then