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
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Cross compilation support
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-01-22 13:46 UTC by David Michael
Modified: 2021-03-22 10:06 UTC (History)
4 users (show)

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


Attachments

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'
../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.
Comment 1 Ionen Wolkens gentoo-dev 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.
Comment 2 Larry the Git Cow gentoo-dev 2021-03-22 10:06:57 UTC
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(+)