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.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65fe9dca1874a0e82695d1f6e3fcf5885f8562e8 commit 65fe9dca1874a0e82695d1f6e3fcf5885f8562e8 Author: David Michael <fedora.dm0@gmail.com> AuthorDate: 2021-03-22 10:06:28 +0000 Commit: David Seifert <soap@gentoo.org> CommitDate: 2021-03-22 10:06:28 +0000 app-emulation/qemu: fix cross-compiling Closes: https://bugs.gentoo.org/766546 Package-Manager: Portage-3.0.13, Repoman-3.0.2 Signed-off-by: David Michael <fedora.dm0@gmail.com> Signed-off-by: David Seifert <soap@gentoo.org> app-emulation/qemu/qemu-5.2.0-r1.ebuild | 3 +++ app-emulation/qemu/qemu-5.2.0-r2.ebuild | 3 +++ app-emulation/qemu/qemu-5.2.0-r3.ebuild | 3 +++ app-emulation/qemu/qemu-9999.ebuild | 3 +++ 4 files changed, 12 insertions(+)