Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 766546 - app-emulation/qemu-5.2.0: broken cross-compilation
Summary: app-emulation/qemu-5.2.0: broken cross-compilation
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Cross compilation support
Depends on:
Reported: 2021-01-22 13:46 UTC by David Michael
Modified: 2021-01-22 14:19 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description David Michael 2021-01-22 13:46:03 UTC
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'
../ 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.
Comment 1 Ionen Wolkens 2021-01-22 14:19:05 UTC
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.