diff mbox series

[PATCHv2,5/7] package/qemu: add support for overridden KERNEL_ARCH=x86_64

Message ID 20220115200306.14037-6-patrickdepinguin@gmail.com
State Rejected
Headers show
Series Basic support for 64-bit kernel and 32-bit userland | expand

Commit Message

Thomas De Schampheleire Jan. 15, 2022, 8:03 p.m. UTC
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>

When the kernel architecture is overridden via BR2_KERNEL_ARCH_OVERRIDE,
this has an impact on the required architecture for qemu-system.

The correct architecture for Qemu is currently determined based on ARCH, not
KERNEL_ARCH. For example, while KERNEL_ARCH is 'powerpc' for all PowerPC
variants, ARCH may be powerpc, powerpc64 or powerpc64le. And this translates
to ppc, ppc64 and ppc64le for Qemu.

This means that it is not generically possible to determine the Qemu
architecture based on KERNEL_ARCH alone.

For now, already handle the case of x86_64.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 package/qemu/qemu.mk | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index e69e813059..bcf684e615 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -302,6 +302,9 @@  endif
 ifeq ($(HOST_QEMU_ARCH),sh4aeb)
 HOST_QEMU_ARCH = sh4eb
 endif
+ifeq ($(call qstrip,$(BR2_KERNEL_ARCH_OVERRIDE)),x86_64)
+HOST_QEMU_SYS_ARCH = x86_64
+endif
 HOST_QEMU_SYS_ARCH ?= $(HOST_QEMU_ARCH)
 
 HOST_QEMU_CFLAGS = $(HOST_CFLAGS)