The build system does not detect cross-compilation properly since 5.2 and fails while trying to execute target binaries. Reproducible: Always Steps to Reproduce: 1. cross-emerge -v app-emulation/qemu Actual Results: The Meson build system Version: 0.55.3 Source dir: /var/tmp/portage/app-emulation/qemu-5.2.0-r1/work/qemu-5.2.0 Build dir: /var/tmp/portage/app-emulation/qemu-5.2.0-r1/work/qemu-5.2.0/softmmu-build Build type: native build Using 'PKG_CONFIG_PATH' from environment with value: '/var/tmp/portage/app-emulation/qemu-5.2.0-r1/temp/python3.8/pkgconfig' Using 'PKG_CONFIG_PATH' from environment with value: '/var/tmp/portage/app-emulation/qemu-5.2.0-r1/temp/python3.8/pkgconfig' Project name: qemu Project version: 5.2.0 Using 'CFLAGS' from environment with value: '-O2 -pipe -ggdb -flto -mcpu=7450 -maltivec -mabi=altivec -ftree-vectorize' Using 'LDFLAGS' from environment with value: '-Wl,-O1 -Wl,--as-needed' ../meson.build:1:0: ERROR: Could not invoke sanity test executable: [Errno 8] Exec format error: '/var/tmp/portage/app-emulation/qemu-5.2.0-r1/work/qemu-5.2.0/softmmu-build/meson-private/sanitycheckc.exe'. Expected Results: It should build and install. The custom configure script does not attempt to use a meson cross-file in subprojects unless cross_prefix is non-empty (which the ebuild does not define), so setting this in the environment can make it build: EXTRA_CONF_QEMU=--cross-prefix=${CHOST}- I haven't reviewed all the meson subprojects, but the self-generated cross-file is rather brief, so it could be missing things that are provided by the meson.eclass cross-file.
Yeah I can reproduce attempting arm64 cross-emerge (both 5.2.0 and -9999), haven't checked much but mentioned extra conf did let it build.