Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
From 67d9845d3583053baaae73883be73ca257bfcf20 Mon Sep 17 00:00:00 2001
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Date: Tue, 30 Apr 2024 09:40:55 +0200
Subject: [PATCH] tests/fp/meson: don't build fp-bench test if fenv.h is
missing
The fp-bench test (i. e. tests/fp/fp-bench.c) use fenv.h that is not
always provided by the libc (uClibc). The patch disables its compilation
in case the header is not available.
The patch is based on a suggestion from Paolo Bonzini, which you can
find at the following link.
Link: https://lists.nongnu.org/archive/html/qemu-devel/2021-03/msg00492.html
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
[Dario: make the patch to be applied with fuzz factor 0]
Upstream: https://patchwork.ozlabs.org/project/qemu-devel/patch/20240430164752.645521-1-dario.binacchi@amarulasolutions.com/
[Romain: rebase on Qemu 9.2.0]
Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
tests/fp/meson.build | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/tests/fp/meson.build b/tests/fp/meson.build
index 9059a24752..2b290f83e7 100644
--- a/tests/fp/meson.build
+++ b/tests/fp/meson.build
@@ -139,12 +139,14 @@ test('fp-test-mulAdd', fptest,
timeout: slow_fp_tests.get('mulAdd', 30),
suite: ['softfloat-slow', 'softfloat-ops-slow', 'slow'])
-executable(
- 'fp-bench',
- ['fp-bench.c', '../../fpu/softfloat.c'],
- dependencies: [qemuutil, libtestfloat, libsoftfloat],
- c_args: fpcflags,
-)
+if cc.has_header('fenv.h')
+ executable(
+ 'fp-bench',
+ ['fp-bench.c', '../../fpu/softfloat.c'],
+ dependencies: [qemuutil, libtestfloat, libsoftfloat],
+ c_args: fpcflags,
+ )
+endif
fptestlog2 = executable(
'fp-test-log2',
--
2.47.1

403
package/qemu/Config.in Normal file
View File

@@ -0,0 +1,403 @@
config BR2_PACKAGE_QEMU_ARCH_SUPPORTS_TARGET
bool
# Only tested on these architectures
default y if BR2_aarch64
default y if BR2_powerpc64
default y if BR2_powerpc64le
default y if BR2_RISCV_64
default y if BR2_s390x
default y if BR2_x86_64
comment "QEMU requires a toolchain with wchar, threads, gcc >= 8"
depends on BR2_PACKAGE_QEMU_ARCH_SUPPORTS_TARGET
depends on BR2_USE_MMU
depends on !(BR2_TOOLCHAIN_HAS_THREADS && BR2_USE_WCHAR) || \
!BR2_TOOLCHAIN_GCC_AT_LEAST_8
menuconfig BR2_PACKAGE_QEMU
bool "QEMU"
depends on BR2_PACKAGE_QEMU_ARCH_SUPPORTS_TARGET
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_USE_WCHAR # gettext
depends on BR2_USE_MMU # fork()
select BR2_PACKAGE_LIBGLIB2
select BR2_PACKAGE_ZLIB
help
QEMU is a generic and open source machine emulator and
virtualizer.
When used as a machine emulator, QEMU can run OSes and
programs made for one machine (e.g. an ARM board) on a
different machine (e.g. your own PC). By using dynamic
translation, it achieves very good performance.
When used as a virtualizer, QEMU achieves near native
performances by executing the guest code directly on the
host CPU. QEMU supports virtualization when executing under
the Xen hypervisor or using the KVM kernel module in
Linux. When using KVM, QEMU can virtualize x86, server and
embedded PowerPC, and S390 guests.
https://www.qemu.org/
if BR2_PACKAGE_QEMU
comment "Emulators selection"
config BR2_PACKAGE_QEMU_SYSTEM
bool "Enable systems emulation"
depends on !BR2_STATIC_LIBS # dtc
select BR2_PACKAGE_PIXMAN
select BR2_PACKAGE_QEMU_FDT if !BR2_PACKAGE_QEMU_CHOOSE_TARGETS
# Make sure at least one of tcg or kvm is enabled
select BR2_PACKAGE_QEMU_SYSTEM_TCG if !BR2_PACKAGE_QEMU_SYSTEM_KVM
help
Say 'y' to build system emulators/virtualisers.
if BR2_PACKAGE_QEMU_SYSTEM
config BR2_PACKAGE_QEMU_SYSTEM_KVM
bool "Enable KVM system virtualisation"
default y
help
Say 'y' here to enable a QEMU with KVM support.
If unsure, say 'y'
config BR2_PACKAGE_QEMU_SYSTEM_TCG
bool "Enable TCG system emulation"
default y
help
Say 'y' here to enable QEMU binaries which can emulate foreign
architectures using the TCG JIT.
config BR2_PACKAGE_QEMU_BLOBS
bool "Install binary blobs"
default y
help
Say 'y' here (the default) to install binary blobs (such as
BIOS or firmwares for the different machines simulated by
QEMU). Say 'n' to not install those blobs.
Note: Some machines may be unbootable without those blobs.
If unsure, say 'y'.
config BR2_PACKAGE_QEMU_SLIRP
bool "Enable user mode networking (SLIRP)"
select BR2_PACKAGE_SLIRP
help
Enable user mode network stack, which is the default
networking backend. It requires no administrator privileges
and generally is the easiest to use but has some
limitations:
- there is a lot of overhead so the performance is poor;
- in general ICMP does not work (can't ping from/to a guest)
- on Linux hosts, ping does work from within the guest, but it
needs initial setup by root (once per host)
- the guest is not directly accessible from the host or the
external network
User Networking is implemented using "slirp", which provides a
full TCP/IP stack within QEMU and uses that stack to implement
a virtual NAT'd network.
Notice that this option does not disable other networking
modes.
config BR2_PACKAGE_QEMU_SDL
bool "Enable SDL frontend"
select BR2_PACKAGE_SDL2
help
Say 'y' to enable the SDL frontend, that is, a graphical
window presenting the VM's display.
config BR2_PACKAGE_QEMU_OPENGL
bool "Enable OpenGL"
depends on BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL
select BR2_PACKAGE_LIBEPOXY
help
Say 'y' to enable OpenGL accelerated display frontend support.
This is necessary to efficiently display frames rendered in a
guest on the host.
Run qemu with `-display sdl,gl=on`
comment "OpenGL support needs an OpenGL and/or OpenGL EGL backend"
depends on !(BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL)
config BR2_PACKAGE_QEMU_VIRGLRENDERER
bool "Enable virglrenderer"
depends on BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL
select BR2_PACKAGE_QEMU_OPENGL
select BR2_PACKAGE_VIRGLRENDERER
help
Say 'y' to enable qemu support for virglrenderer.
virglrenderer backends such as virgl, venus, or DRM native
context are configured under the virglrenderer package.
Run qemu with `-device virtio-gpu-gl`
https://qemu.readthedocs.io/en/v10.0.3/system/devices/virtio-gpu.html#virtio-gpu-virglrenderer
comment "virglrenderer needs OpenGL accelerated display frontend support"
depends on !(BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL)
comment "virglrenderer needs virgl, venus, or a DRM backend for guest acceleration"
depends on BR2_PACKAGE_QEMU_VIRGLRENDERER
depends on !BR2_PACKAGE_VIRGLRENDERER_HAS_BACKEND
config BR2_PACKAGE_QEMU_FDT
bool "Enable FDT"
select BR2_PACKAGE_DTC
help
Say 'y' here to have QEMU capable of constructing Device
Trees, and passing them to the VMs.
config BR2_PACKAGE_QEMU_TRACING
bool "Enable tracing"
help
Say 'y' to enable the "log" tracing infrastructure in QEMU,
used for debugging, profiling, and observing execution. For
detailed documentation, see
https://www.qemu.org/docs/master/devel/tracing.html
endif # BR2_PACKAGE_QEMU_SYSTEM
comment "systems emulation needs a toolchain w/ dynamic library"
depends on BR2_STATIC_LIBS
config BR2_PACKAGE_QEMU_LINUX_USER
bool "Enable Linux user-land emulation"
help
Say 'y' to build Linux user-land emulators.
# Note: bsd-user can not be build on Linux
config BR2_PACKAGE_QEMU_CHOOSE_TARGETS
bool "Select individual emulator targets"
depends on BR2_PACKAGE_QEMU_SYSTEM_TCG || BR2_PACKAGE_QEMU_LINUX_USER
help
By default, all targets system targets are built. If you
only need a subset of the emulated targets, say 'y' here and
enable at least one target, below.
if BR2_PACKAGE_QEMU_CHOOSE_TARGETS
config BR2_PACKAGE_QEMU_TARGET_AARCH64
bool "aarch64"
select BR2_PACKAGE_QEMU_FDT if BR2_PACKAGE_QEMU_SYSTEM
help
ARM 64-bit architecture.
config BR2_PACKAGE_QEMU_TARGET_AARCH64_BE
bool "aarch64_be (linux-user, only)"
depends on BR2_PACKAGE_QEMU_LINUX_USER
help
ARM 64-bit architecture, big-endian.
config BR2_PACKAGE_QEMU_TARGET_ALPHA
bool "alpha"
help
DEC Alpha 64-bit RISC architecture.
config BR2_PACKAGE_QEMU_TARGET_ARM
bool "arm"
select BR2_PACKAGE_QEMU_FDT if BR2_PACKAGE_QEMU_SYSTEM
help
ARM EABI architecture, little-endian.
config BR2_PACKAGE_QEMU_TARGET_ARMEB
bool "armeb (linux-user, only)"
depends on BR2_PACKAGE_QEMU_LINUX_USER
help
ARM EABI architecture, big-endian.
config BR2_PACKAGE_QEMU_TARGET_AVR
bool "avr (system, only)"
depends on BR2_PACKAGE_QEMU_SYSTEM
help
AVR 8-bit microcontroller architecture.
config BR2_PACKAGE_QEMU_TARGET_HEXAGON
bool "hexagon (linux-user, only)"
depends on BR2_PACKAGE_QEMU_LINUX_USER
help
Qualcomm's Hexagon VLSI DSP architecture.
config BR2_PACKAGE_QEMU_TARGET_HPPA
bool "hppa"
help
HP PA-RISC architecture.
config BR2_PACKAGE_QEMU_TARGET_I386
bool "i386"
select BR2_PACKAGE_QEMU_FDT if BR2_PACKAGE_QEMU_SYSTEM
help
Intel i386 32-bit architecture.
config BR2_PACKAGE_QEMU_TARGET_LOONGARCH64
bool "loongarch64"
select BR2_PACKAGE_QEMU_FDT if BR2_PACKAGE_QEMU_SYSTEM
help
Loongson 64-bit RISC architecture.
config BR2_PACKAGE_QEMU_TARGET_M68K
bool "m68k"
help
Motorola 68000 architecture.
config BR2_PACKAGE_QEMU_TARGET_MICROBLAZE
bool "microblaze"
select BR2_PACKAGE_QEMU_FDT if BR2_PACKAGE_QEMU_SYSTEM
help
Xilinx MicroBlaze soft processor.
config BR2_PACKAGE_QEMU_TARGET_MIPS
bool "mips"
help
MIPS 32-bit architecture.
config BR2_PACKAGE_QEMU_TARGET_MIPSEL
bool "mipsel"
help
MIPS 32-bit architecture, little-endian.
config BR2_PACKAGE_QEMU_TARGET_MIPS64
bool "mips64"
help
MIPS 64-bit architecture.
config BR2_PACKAGE_QEMU_TARGET_MIPS64EL
bool "mips64el"
select BR2_PACKAGE_QEMU_FDT if BR2_PACKAGE_QEMU_SYSTEM
help
MIPS 64-bit architecture, little-endian.
config BR2_PACKAGE_QEMU_TARGET_MIPSN32
bool "mipsn32 (linux-user, only)"
depends on BR2_PACKAGE_QEMU_LINUX_USER
help
MIPS N32 architecture.
config BR2_PACKAGE_QEMU_TARGET_MIPSN32EL
bool "mipsn32el (linux-user, only)"
depends on BR2_PACKAGE_QEMU_LINUX_USER
help
MIPS N32 architecture, little-endian.
config BR2_PACKAGE_QEMU_TARGET_OR1K
bool "or1k"
select BR2_PACKAGE_QEMU_FDT if BR2_PACKAGE_QEMU_SYSTEM
help
OpenRISC 1000 architecture.
config BR2_PACKAGE_QEMU_TARGET_PPC
bool "ppc"
select BR2_PACKAGE_QEMU_FDT if BR2_PACKAGE_QEMU_SYSTEM
help
PoewerPC 32-bit architecture.
config BR2_PACKAGE_QEMU_TARGET_PPC64
bool "ppc64"
select BR2_PACKAGE_QEMU_FDT if BR2_PACKAGE_QEMU_SYSTEM
help
PoewerPC 64-bit architecture.
config BR2_PACKAGE_QEMU_TARGET_PPC64LE
bool "ppc64le (linux-user, only)"
depends on BR2_PACKAGE_QEMU_LINUX_USER
help
PoewerPC 64-bit architecture, little-endian.
config BR2_PACKAGE_QEMU_TARGET_RISCV32
bool "riscv32"
select BR2_PACKAGE_QEMU_FDT if BR2_PACKAGE_QEMU_SYSTEM
help
RISC-V 32-bit architecture.
config BR2_PACKAGE_QEMU_TARGET_RISCV64
bool "riscv64"
select BR2_PACKAGE_QEMU_FDT if BR2_PACKAGE_QEMU_SYSTEM
help
RISC-V 64-bit architecture.
config BR2_PACKAGE_QEMU_TARGET_RX
bool "rx (system-only)"
depends on BR2_PACKAGE_QEMU_SYSTEM
select BR2_PACKAGE_QEMU_FDT if BR2_PACKAGE_QEMU_SYSTEM
help
Renesas Electronics RX 32-bit architecture.
config BR2_PACKAGE_QEMU_TARGET_S390X
bool "s390x"
help
IBM z/Architecture 64-bit mainframe (s390x)
config BR2_PACKAGE_QEMU_TARGET_SH4
bool "sh4"
help
Super-H 32-bit RISC architecture.
config BR2_PACKAGE_QEMU_TARGET_SH4EB
bool "sh4eb"
help
Super-H EB 32-bit RISC architecture.
config BR2_PACKAGE_QEMU_TARGET_SPARC
bool "sparc"
help
SPARC 32-bit RISC architecture.
config BR2_PACKAGE_QEMU_TARGET_SPARC32PLUS
bool "sparc32plus (linux-user, only)"
depends on BR2_PACKAGE_QEMU_LINUX_USER
help
SPARC 32-bit RISC architecture (Sun's v8plus).
config BR2_PACKAGE_QEMU_TARGET_SPARC64
bool "sparc64"
help
SPARC 64-bit RISC architecture.
config BR2_PACKAGE_QEMU_TARGET_TRICORE
bool "tricore (system, only)"
depends on BR2_PACKAGE_QEMU_SYSTEM
help
Infineon TriCore 32-bit RISC architecture.
config BR2_PACKAGE_QEMU_TARGET_X86_64
bool "x86_64"
select BR2_PACKAGE_QEMU_FDT if BR2_PACKAGE_QEMU_SYSTEM
help
Intel x86 64-bit architecture.
config BR2_PACKAGE_QEMU_TARGET_XTENSA
bool "xtensa"
help
Xtensa 32-bit RISC architecture.
config BR2_PACKAGE_QEMU_TARGET_XTENSAEB
bool "xtensaeb"
help
Xtensa 32-bit RISC architecture, big-endian.
endif # BR2_PACKAGE_QEMU_CHOOSE_TARGETS
comment "Tools selection"
config BR2_PACKAGE_QEMU_TOOLS
bool "Enable tools"
help
Say 'y' here to include tools packaged with QEMU
(e.g. qemu-img).
config BR2_PACKAGE_QEMU_GUEST_AGENT
bool "Enable guest agent"
help
Say 'y' here to include an agent to run on guests, which
communicates with the host over a virtio-serial channel
named "org.qemu.guest_agent.0".
endif # BR2_PACKAGE_QEMU

106
package/qemu/Config.in.host Normal file
View File

@@ -0,0 +1,106 @@
config BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
bool
default y if BR2_arm
default y if BR2_armeb
default y if BR2_aarch64
default y if BR2_hppa
default y if BR2_i386
default y if BR2_loongarch64
default y if BR2_m68k
default y if BR2_microblazeel
default y if BR2_microblazebe
default y if BR2_mips
default y if BR2_mipsel
default y if BR2_or1k
default y if BR2_powerpc
default y if BR2_powerpc64
default y if BR2_powerpc64le
default y if BR2_riscv
default y if BR2_s390x
default y if BR2_sh
default y if BR2_sparc
default y if BR2_sparc64
default y if BR2_xtensa
default y if BR2_x86_64
depends on !BR2_x86_steamroller && !BR2_x86_core_avx2
depends on !BR2_powerpc_620 && !BR2_powerpc_630
config BR2_PACKAGE_HOST_QEMU_SYSTEM_ARCH_SUPPORTS
bool
default y if BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
default y if BR2_mips64
default y if BR2_mips64el
config BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
bool
default y if BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
comment "host-qemu needs a host gcc >= 8"
depends on BR2_PACKAGE_HOST_QEMU_SYSTEM_ARCH_SUPPORTS || \
BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORT
depends on !BR2_HOST_GCC_AT_LEAST_8
config BR2_PACKAGE_HOST_QEMU
bool "host qemu"
depends on BR2_PACKAGE_HOST_QEMU_SYSTEM_ARCH_SUPPORTS || BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
depends on BR2_HOST_GCC_AT_LEAST_8
select BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE \
if !BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE && BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
select BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE \
if !BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
help
QEMU is a generic and open source machine emulator and
virtualizer.
This option builds an emulator for your selected architecture.
http://www.qemu.org
if BR2_PACKAGE_HOST_QEMU
comment "Emulators selection"
config BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE
bool "Enable system emulation"
depends on BR2_PACKAGE_HOST_QEMU_SYSTEM_ARCH_SUPPORTS
help
Enables the build of the system emulator, which allows to
boot an entire system in Qemu.
config BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
bool "Enable Linux user-land emulation"
depends on BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
help
Enables the build of the user-land emulator, which allows to
run user-space applications.
Note that system calls made by the emulated user-land are
serviced by the running host kernel. Therefore, if the
kernel headers used by your target are more recent than
the running host kernel, you may run into invalid system
calls, which may yield surprising effects.
config BR2_PACKAGE_HOST_QEMU_USER_MODE_ARGS
string
default "-cpu Nehalem,check=false" if BR2_x86_corei7
config BR2_PACKAGE_HOST_QEMU_VDE2
bool "VDE2 support"
help
Enables VDE2 support. VDE2 stands for Virtual Distributed
Ethernet and can be used to create virtual switches to
"plug" both physical and virtual machines in them.
config BR2_PACKAGE_HOST_QEMU_VIRTFS
bool "Virtual filesystem support"
depends on BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE
help
Enables support for virtual filesystem in Qemu allowing
shared filesystem between Qemu and its emulated target.
config BR2_PACKAGE_HOST_QEMU_USB
bool "USB passthrough support"
help
Enables USB passthrough support from guest to host.
endif

4
package/qemu/qemu.hash Normal file
View File

@@ -0,0 +1,4 @@
# Locally computed, tarball verified with GPG signature
sha256 c04ca36012653f32d11c674d370cf52a710e7d3f18c2d8b63e4932052a4854d6 qemu-11.0.0.tar.xz
sha256 dd3ce02338c3a48abb6ba59b48809f7108a8bd242cb0cc8be90daafa30707c28 COPYING
sha256 31c90ce76b6f5aab90a205851e71d5c27e31c0aa3d7017a4383b98a6fe3f1faa COPYING.LIB

576
package/qemu/qemu.mk Normal file
View File

@@ -0,0 +1,576 @@
################################################################################
#
# qemu
#
################################################################################
# When updating the version, check whether the list of supported targets
# needs to be updated.
QEMU_VERSION = 11.0.0
QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.xz
QEMU_SITE = https://download.qemu.org
QEMU_SELINUX_MODULES = qemu virt
QEMU_LICENSE = GPL-2.0, LGPL-2.1, MIT, BSD-3-Clause, BSD-2-Clause, Others/BSD-1c
QEMU_LICENSE_FILES = COPYING COPYING.LIB
# NOTE: there is no top-level license file for non-(L)GPL licenses;
# the non-(L)GPL license texts are specified in the affected
# individual source files.
QEMU_CPE_ID_VENDOR = qemu
#-------------------------------------------------------------
# The build system is now partly based on Meson.
# However, building is still done with configure and make as in previous versions of QEMU.
# Target-qemu
QEMU_DEPENDENCIES = \
host-meson \
host-pkgconf \
host-python3 \
host-python-distlib \
host-python-setuptools \
host-python-wheel \
libglib2 \
zlib
# Need the LIBS variable because librt and libm are
# not automatically pulled. :-(
QEMU_LIBS = -lrt -lm
QEMU_OPTS =
QEMU_VARS = LIBTOOL=$(HOST_DIR)/bin/libtool
# If we want to build all emulation targets, we just need to either enable -user
# and/or -system emulation appropriately.
# Otherwise, if we want only a subset of targets, we must still enable all of
# them, so that QEMU properly builds a list of default targets from which it
# checks if the specified sub-set is valid.
ifeq ($(BR2_PACKAGE_QEMU_SYSTEM),y)
QEMU_DEPENDENCIES += pixman
QEMU_OPTS += --enable-system
ifeq ($(BR2_PACKAGE_QEMU_SYSTEM_KVM), y)
QEMU_OPTS += --enable-kvm
else
QEMU_OPTS += --disable-kvm
endif
ifeq ($(BR2_PACKAGE_QEMU_SYSTEM_TCG), y)
QEMU_OPTS += --enable-tcg
else
QEMU_OPTS += --disable-tcg
endif
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_AARCH64) += aarch64-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_ALPHA) += alpha-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_ARM) += arm-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_AVR) += avr-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_HPPA) += hppa-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_I386) += i386-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_LOONGARCH64) += loongarch64-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_M68K) += m68k-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_MICROBLAZE) += microblaze-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_MIPS) += mips-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_MIPS64) += mips64-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_MIPS64EL) += mips64el-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_MIPSEL) += mipsel-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_OR1K) += or1k-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_PPC) += ppc-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_PPC64) += ppc64-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_RISCV32) += riscv32-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_RISCV64) += riscv64-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_RX) += rx-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_S390X) += s390x-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_SH4) += sh4-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_SH4EB) += sh4eb-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_SPARC) += sparc-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_SPARC64) += sparc64-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_TRICORE) += tricore-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_X86_64) += x86_64-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_XTENSA) += xtensa-softmmu
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_XTENSAEB) += xtensaeb-softmmu
else
QEMU_OPTS += --disable-system
endif
ifeq ($(BR2_PACKAGE_QEMU_LINUX_USER),y)
QEMU_OPTS += --enable-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_AARCH64) += aarch64-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_AARCH64_BE) += aarch64_be-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_ALPHA) += alpha-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_ARM) += arm-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_ARMEB) += armeb-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_HEXAGON) += hexagon-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_HPPA) += hppa-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_I386) += i386-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_LOONGARCH64) += loongarch64-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_M68K) += m68k-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_MICROBLAZE) += microblaze-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_MIPS) += mips-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_MIPS64) += mips64-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_MIPS64EL) += mips64el-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_MIPSEL) += mipsel-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_MIPSN32) += mipsn32-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_MIPSN32EL) += mipsn32el-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_OR1K) += or1k-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_PPC) += ppc-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_PPC64) += ppc64-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_PPC64LE) += ppc64le-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_RISCV32) += riscv32-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_RISCV64) += riscv64-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_S390X) += s390x-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_SH4) += sh4-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_SH4EB) += sh4eb-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_SPARC) += sparc-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_SPARC32PLUS) += sparc32plus-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_SPARC64) += sparc64-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_X86_64) += x86_64-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_XTENSA) += xtensa-linux-user
QEMU_TARGET_LIST_$(BR2_PACKAGE_QEMU_TARGET_XTENSAEB) += xtensaeb-linux-user
else
QEMU_OPTS += --disable-linux-user
endif
# Build the list of desired targets, if any.
ifeq ($(BR2_PACKAGE_QEMU_CHOOSE_TARGETS),y)
QEMU_TARGET_LIST = $(strip $(QEMU_TARGET_LIST_y))
ifeq ($(BR_BUILDING).$(QEMU_TARGET_LIST),y.)
$(error "No emulator target has ben chosen")
endif
QEMU_OPTS += --target-list="$(QEMU_TARGET_LIST)"
endif
ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
QEMU_OPTS += --disable-vhost-user
else
QEMU_OPTS += --enable-vhost-user
endif
ifeq ($(BR2_PACKAGE_QEMU_SLIRP),y)
QEMU_OPTS += --enable-slirp
QEMU_DEPENDENCIES += slirp
else
QEMU_OPTS += --disable-slirp
endif
ifeq ($(BR2_PACKAGE_QEMU_SDL),y)
QEMU_OPTS += --enable-sdl
QEMU_DEPENDENCIES += sdl2
QEMU_VARS += SDL2_CONFIG=$(STAGING_DIR)/usr/bin/sdl2-config
else
QEMU_OPTS += --disable-sdl
endif
ifeq ($(BR2_PACKAGE_QEMU_FDT),y)
QEMU_OPTS += --enable-fdt
QEMU_DEPENDENCIES += dtc
else
QEMU_OPTS += --disable-fdt
endif
ifeq ($(BR2_PACKAGE_QEMU_TRACING),y)
QEMU_OPTS += --enable-trace-backends=log
else
QEMU_OPTS += --enable-trace-backends=nop
endif
ifeq ($(BR2_PACKAGE_QEMU_TOOLS),y)
QEMU_OPTS += --enable-tools
else
QEMU_OPTS += --disable-tools
endif
ifeq ($(BR2_PACKAGE_QEMU_GUEST_AGENT),y)
QEMU_OPTS += --enable-guest-agent
else
QEMU_OPTS += --disable-guest-agent
endif
ifeq ($(BR2_PACKAGE_LIBFUSE3),y)
QEMU_OPTS += --enable-fuse --enable-fuse-lseek
QEMU_DEPENDENCIES += libfuse3
else
QEMU_OPTS += --disable-fuse --disable-fuse-lseek
endif
ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
QEMU_OPTS += --enable-seccomp
QEMU_DEPENDENCIES += libseccomp
else
QEMU_OPTS += --disable-seccomp
endif
ifeq ($(BR2_PACKAGE_LIBSSH),y)
QEMU_OPTS += --enable-libssh
QEMU_DEPENDENCIES += libssh
else
QEMU_OPTS += --disable-libssh
endif
ifeq ($(BR2_PACKAGE_LIBUSB),y)
QEMU_OPTS += --enable-libusb
QEMU_DEPENDENCIES += libusb
else
QEMU_OPTS += --disable-libusb
endif
ifeq ($(BR2_PACKAGE_LIBVNCSERVER),y)
QEMU_OPTS += \
--enable-vnc \
--disable-vnc-sasl
QEMU_DEPENDENCIES += libvncserver
ifeq ($(BR2_PACKAGE_LIBPNG),y)
QEMU_OPTS += --enable-png
QEMU_DEPENDENCIES += libpng
else
QEMU_OPTS += --disable-png
endif
ifeq ($(BR2_PACKAGE_JPEG),y)
QEMU_OPTS += --enable-vnc-jpeg
QEMU_DEPENDENCIES += jpeg
else
QEMU_OPTS += --disable-vnc-jpeg
endif
else
QEMU_OPTS += --disable-vnc
endif
ifeq ($(BR2_PACKAGE_NETTLE),y)
QEMU_OPTS += --enable-nettle
QEMU_DEPENDENCIES += nettle
else
QEMU_OPTS += --disable-nettle
endif
ifeq ($(BR2_PACKAGE_NUMACTL),y)
QEMU_OPTS += --enable-numa
QEMU_DEPENDENCIES += numactl
else
QEMU_OPTS += --disable-numa
endif
ifeq ($(BR2_PACKAGE_PIPEWIRE),y)
QEMU_OPTS += --enable-pipewire
QEMU_DEPENDENCIES += pipewire
else
QEMU_OPTS += --disable-pipewire
endif
ifeq ($(BR2_PACKAGE_SPICE),y)
QEMU_OPTS += --enable-spice
QEMU_DEPENDENCIES += spice
else
QEMU_OPTS += --disable-spice
endif
ifeq ($(BR2_PACKAGE_USBREDIR),y)
QEMU_OPTS += --enable-usb-redir
QEMU_DEPENDENCIES += usbredir
else
QEMU_OPTS += --disable-usb-redir
endif
ifeq ($(BR2_PACKAGE_QEMU_OPENGL),y)
QEMU_OPTS += --enable-opengl
QEMU_DEPENDENCIES += libepoxy
else
QEMU_OPTS += --disable-opengl
endif
ifeq ($(BR2_PACKAGE_QEMU_VIRGLRENDERER),y)
QEMU_OPTS += --enable-virglrenderer
QEMU_DEPENDENCIES += virglrenderer
else
QEMU_OPTS += --disable-virglrenderer
endif
ifeq ($(BR2_STATIC_LIBS),y)
QEMU_OPTS += --static
endif
ifeq ($(BR2_PACKAGE_QEMU_BLOBS),y)
QEMU_OPTS += --enable-install-blobs
else
QEMU_OPTS += --disable-install-blobs
endif
ifeq ($(BR2_PACKAGE_ZSTD),y)
QEMU_OPTS += --enable-zstd
QEMU_DEPENDENCIES += zstd
else
QEMU_OPTS += --disable-zstd
endif
# Override CPP, as it expects to be able to call it like it'd
# call the compiler.
define QEMU_CONFIGURE_CMDS
unset TARGET_DIR; \
cd $(@D); \
LIBS='$(QEMU_LIBS)' \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
CPP="$(TARGET_CC) -E" \
$(QEMU_VARS) \
./configure \
--prefix=/usr \
--cross-prefix=$(TARGET_CROSS) \
--audio-drv-list= \
--python=$(HOST_DIR)/bin/python3 \
--ninja=$(HOST_DIR)/bin/ninja \
--disable-alsa \
--disable-asan \
--disable-bpf \
--disable-brlapi \
--disable-bsd-user \
--disable-cap-ng \
--disable-capstone \
--disable-containers \
--disable-coreaudio \
--disable-curl \
--disable-curses \
--disable-dbus-display \
--disable-docs \
--disable-download \
--disable-dsound \
--disable-hvf \
--disable-jack \
--disable-libiscsi \
--disable-linux-aio \
--disable-linux-io-uring \
--disable-malloc-trim \
--disable-membarrier \
--disable-mpath \
--disable-netmap \
--disable-oss \
--disable-pa \
--disable-plugins \
--disable-rbd \
--disable-selinux \
--disable-sparse \
--disable-strip \
--disable-ubsan \
--disable-vde \
--disable-vhost-crypto \
--disable-vhost-user-blk-server \
--disable-virtfs \
--disable-whpx \
--disable-xen \
--enable-attr \
--enable-vhost-net \
--disable-hexagon-idef-parser \
$(QEMU_OPTS)
endef
define QEMU_BUILD_CMDS
unset TARGET_DIR; \
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
endef
define QEMU_INSTALL_TARGET_CMDS
unset TARGET_DIR; \
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(QEMU_MAKE_ENV) DESTDIR=$(TARGET_DIR) install
endef
$(eval $(generic-package))
#-------------------------------------------------------------
# Host-qemu
HOST_QEMU_DEPENDENCIES = \
host-libglib2 \
host-meson \
host-pixman \
host-pkgconf \
host-python3 \
host-python-distlib \
host-python-setuptools \
host-python-wheel \
host-slirp \
host-zlib
# BR ARCH qemu
# ------- ----
# arm arm
# armeb armeb
# hppa hppa
# i486 i386
# i586 i386
# i686 i386
# x86_64 x86_64
# m68k m68k
# microblaze microblaze
# microblazeel microblaze
# mips mips
# mipsel mipsel
# mips64 mips64
# mips64el mips64el
# or1k or1k
# powerpc ppc
# powerpc64 ppc64
# powerpc64le ppc64 (system) / ppc64le (usermode)
# sh2a not supported
# sh4 sh4
# sh4eb sh4eb
# sh4a sh4
# sh4aeb sh4eb
# sparc sparc
# sparc64 sparc64
# xtensa xtensa
HOST_QEMU_ARCH = $(ARCH)
ifeq ($(HOST_QEMU_ARCH),armeb)
HOST_QEMU_SYS_ARCH = arm
endif
ifeq ($(HOST_QEMU_ARCH),i486)
HOST_QEMU_ARCH = i386
endif
ifeq ($(HOST_QEMU_ARCH),i586)
HOST_QEMU_ARCH = i386
endif
ifeq ($(HOST_QEMU_ARCH),i686)
HOST_QEMU_ARCH = i386
endif
ifeq ($(HOST_QEMU_ARCH),microblazeel)
# since v11.0.0, microblazeel emulation is provided by the microblaze target
HOST_QEMU_ARCH = microblaze
endif
ifeq ($(HOST_QEMU_ARCH),powerpc)
HOST_QEMU_ARCH = ppc
endif
ifeq ($(HOST_QEMU_ARCH),powerpc64)
HOST_QEMU_ARCH = ppc64
endif
ifeq ($(HOST_QEMU_ARCH),powerpc64le)
HOST_QEMU_ARCH = ppc64le
HOST_QEMU_SYS_ARCH = ppc64
endif
ifeq ($(HOST_QEMU_ARCH),sh4a)
HOST_QEMU_ARCH = sh4
endif
ifeq ($(HOST_QEMU_ARCH),sh4aeb)
HOST_QEMU_ARCH = sh4eb
endif
HOST_QEMU_SYS_ARCH ?= $(HOST_QEMU_ARCH)
HOST_QEMU_CFLAGS = $(HOST_CFLAGS)
ifeq ($(BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE),y)
HOST_QEMU_TARGETS += $(HOST_QEMU_SYS_ARCH)-softmmu
HOST_QEMU_OPTS += --enable-system --enable-fdt
HOST_QEMU_CFLAGS += -I$(HOST_DIR)/include/libfdt
HOST_QEMU_DEPENDENCIES += host-dtc
else
HOST_QEMU_OPTS += --disable-system
endif
ifeq ($(BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE),y)
HOST_QEMU_TARGETS += $(HOST_QEMU_ARCH)-linux-user
HOST_QEMU_OPTS += --enable-linux-user
HOST_QEMU_HOST_SYSTEM_TYPE = $(shell uname -s)
ifneq ($(HOST_QEMU_HOST_SYSTEM_TYPE),Linux)
$(error "qemu-user can only be used on Linux hosts")
endif
else # BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
HOST_QEMU_OPTS += --disable-linux-user
endif # BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
ifeq ($(BR2_PACKAGE_HOST_QEMU_VDE2),y)
HOST_QEMU_OPTS += --enable-vde
HOST_QEMU_DEPENDENCIES += host-vde2
endif
# virtfs-proxy-helper is the only user of libcap-ng.
ifeq ($(BR2_PACKAGE_HOST_QEMU_VIRTFS),y)
HOST_QEMU_OPTS += --enable-virtfs --enable-cap-ng
HOST_QEMU_DEPENDENCIES += host-libcap-ng
else
HOST_QEMU_OPTS += --disable-virtfs --disable-cap-ng
endif
ifeq ($(BR2_PACKAGE_HOST_QEMU_USB),y)
HOST_QEMU_OPTS += --enable-libusb
HOST_QEMU_DEPENDENCIES += host-libusb
else
HOST_QEMU_OPTS += --disable-libusb
endif
ifeq ($(BR2_PACKAGE_HOST_ZSTD),y)
HOST_QEMU_OPTS += --enable-zstd
HOST_QEMU_DEPENDENCIES += host-zstd
else
HOST_QEMU_OPTS += --disable-zstd
endif
# Override CPP, as it expects to be able to call it like it'd
# call the compiler.
define HOST_QEMU_CONFIGURE_CMDS
unset TARGET_DIR; \
cd $(@D); $(HOST_CONFIGURE_OPTS) CPP="$(HOSTCC) -E" \
./configure \
--target-list="$(HOST_QEMU_TARGETS)" \
--prefix="$(HOST_DIR)" \
--interp-prefix=$(STAGING_DIR) \
--cc="$(HOSTCC)" \
--host-cc="$(HOSTCC)" \
--extra-cflags="$(HOST_QEMU_CFLAGS)" \
--extra-ldflags="$(HOST_LDFLAGS)" \
--python=$(HOST_DIR)/bin/python3 \
--ninja=$(HOST_DIR)/bin/ninja \
--disable-alsa \
--disable-bpf \
--disable-bzip2 \
--disable-containers \
--disable-coreaudio \
--disable-curl \
--disable-dbus-display \
--disable-docs \
--disable-download \
--disable-dsound \
--disable-jack \
--disable-libssh \
--disable-linux-aio \
--disable-linux-io-uring \
--disable-netmap \
--disable-oss \
--disable-pa \
--disable-pipewire \
--disable-sdl \
--disable-selinux \
--disable-vde \
--disable-vhost-user-blk-server \
--disable-vnc-jpeg \
--disable-plugins \
--disable-png \
--disable-vnc-sasl \
--enable-slirp \
--enable-tools \
--disable-guest-agent \
$(HOST_QEMU_OPTS)
endef
define HOST_QEMU_BUILD_CMDS
unset TARGET_DIR; \
$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
endef
define HOST_QEMU_INSTALL_CMDS
unset TARGET_DIR; \
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) install
endef
# install symlink to qemu-system
ifeq ($(BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE),y)
define HOST_QEMU_POST_INSTALL_SYMLINK
ln -sf ./qemu-system-$(HOST_QEMU_ARCH) $(HOST_DIR)/bin/qemu-system
endef
HOST_QEMU_POST_INSTALL_HOOKS += HOST_QEMU_POST_INSTALL_SYMLINK
endif
$(eval $(host-generic-package))
# variable used by other packages
QEMU_USER = $(HOST_DIR)/bin/qemu-$(HOST_QEMU_ARCH)