aboutsummaryrefslogtreecommitdiff
path: root/package/qemu
diff options
context:
space:
mode:
Diffstat (limited to 'package/qemu')
-rw-r--r--package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch4
-rw-r--r--package/qemu/0002-Fix-build-with-64-bits-time_t.patch98
-rw-r--r--package/qemu/0003-hw-usb-host-libusb.c-fix-build-with-kernel-5.0.patch43
-rw-r--r--package/qemu/0004-meson-add-tests-option.patch92
-rw-r--r--package/qemu/Config.in1
-rw-r--r--package/qemu/Config.in.host5
-rw-r--r--package/qemu/qemu.hash6
-rw-r--r--package/qemu/qemu.mk29
8 files changed, 266 insertions, 12 deletions
diff --git a/package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch b/package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch
index 548ec3e765..841708995e 100644
--- a/package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch
+++ b/package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch
@@ -18,10 +18,10 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
-index 4be78eb9b3..0a690bec55 100644
+index 4ebe25461a..0496674fbd 100644
--- a/accel/tcg/user-exec.c
+++ b/accel/tcg/user-exec.c
-@@ -508,7 +508,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+@@ -536,7 +536,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
#if defined(__NetBSD__)
pc = uc->uc_mcontext.__gregs[_REG_R15];
diff --git a/package/qemu/0002-Fix-build-with-64-bits-time_t.patch b/package/qemu/0002-Fix-build-with-64-bits-time_t.patch
new file mode 100644
index 0000000000..7a72047136
--- /dev/null
+++ b/package/qemu/0002-Fix-build-with-64-bits-time_t.patch
@@ -0,0 +1,98 @@
+From 839e51aa452345b440f8d2d0df84ab58bdedfcd1 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sat, 14 Nov 2020 21:54:17 +0100
+Subject: [PATCH] Fix build with 64 bits time_t
+
+time element is deprecated on new input_event structure in kernel's
+input.h [1]
+
+This will avoid the following build failure:
+
+hw/input/virtio-input-host.c: In function 'virtio_input_host_handle_status':
+hw/input/virtio-input-host.c:198:28: error: 'struct input_event' has no member named 'time'
+ 198 | if (gettimeofday(&evdev.time, NULL)) {
+ | ^
+
+Fixes:
+ - http://autobuild.buildroot.org/results/a538167e288c14208d557cd45446df86d3d599d5
+ - http://autobuild.buildroot.org/results/efd4474fb4b6c0ce0ab3838ce130429c51e43bbb
+
+[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=152194fe9c3f
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ contrib/vhost-user-input/main.c | 10 +++++++++-
+ hw/input/virtio-input-host.c | 10 +++++++++-
+ 2 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/main.c
+index 6020c6f33a..e688c3e0a9 100644
+--- a/contrib/vhost-user-input/main.c
++++ b/contrib/vhost-user-input/main.c
+@@ -17,6 +17,11 @@
+ #include "standard-headers/linux/virtio_input.h"
+ #include "qapi/error.h"
+
++#ifndef input_event_sec
++#define input_event_sec time.tv_sec
++#define input_event_usec time.tv_usec
++#endif
++
+ enum {
+ VHOST_USER_INPUT_MAX_QUEUES = 2,
+ };
+@@ -115,13 +120,16 @@ vi_evdev_watch(VuDev *dev, int condition, void *data)
+ static void vi_handle_status(VuInput *vi, virtio_input_event *event)
+ {
+ struct input_event evdev;
++ struct timeval tval;
+ int rc;
+
+- if (gettimeofday(&evdev.time, NULL)) {
++ if (gettimeofday(&tval, NULL)) {
+ perror("vi_handle_status: gettimeofday");
+ return;
+ }
+
++ evdev.input_event_sec = tval.tv_sec;
++ evdev.input_event_usec = tval.tv_usec;
+ evdev.type = le16toh(event->type);
+ evdev.code = le16toh(event->code);
+ evdev.value = le32toh(event->value);
+diff --git a/hw/input/virtio-input-host.c b/hw/input/virtio-input-host.c
+index 85daf73f1a..2e261737e1 100644
+--- a/hw/input/virtio-input-host.c
++++ b/hw/input/virtio-input-host.c
+@@ -16,6 +16,11 @@
+ #include <sys/ioctl.h>
+ #include "standard-headers/linux/input.h"
+
++#ifndef input_event_sec
++#define input_event_sec time.tv_sec
++#define input_event_usec time.tv_usec
++#endif
++
+ /* ----------------------------------------------------------------- */
+
+ static struct virtio_input_config virtio_input_host_config[] = {
+@@ -193,13 +198,16 @@ static void virtio_input_host_handle_status(VirtIOInput *vinput,
+ {
+ VirtIOInputHost *vih = VIRTIO_INPUT_HOST(vinput);
+ struct input_event evdev;
++ struct timeval tval;
+ int rc;
+
+- if (gettimeofday(&evdev.time, NULL)) {
++ if (gettimeofday(&tval, NULL)) {
+ perror("virtio_input_host_handle_status: gettimeofday");
+ return;
+ }
+
++ evdev.input_event_sec = tval.tv_sec;
++ evdev.input_event_usec = tval.tv_usec;
+ evdev.type = le16_to_cpu(event->type);
+ evdev.code = le16_to_cpu(event->code);
+ evdev.value = le32_to_cpu(event->value);
+--
+2.29.2
+
diff --git a/package/qemu/0003-hw-usb-host-libusb.c-fix-build-with-kernel-5.0.patch b/package/qemu/0003-hw-usb-host-libusb.c-fix-build-with-kernel-5.0.patch
new file mode 100644
index 0000000000..2510dc9cd4
--- /dev/null
+++ b/package/qemu/0003-hw-usb-host-libusb.c-fix-build-with-kernel-5.0.patch
@@ -0,0 +1,43 @@
+From ecd615dfe328e3ab551cea3ba243d908936ed382 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sun, 13 Dec 2020 21:27:31 +0100
+Subject: [PATCH] hw/usb/host-libusb.c: fix build with kernel < 5.0
+
+USBDEVFS_GET_SPEED is used since version 5.2.0 and
+https://gitlab.com/qemu-project/qemu/-/commit/202d69a715a4b1824dcd7ec1683d027ed2bae6d3
+resulting in the following build failure with kernel < 5.0:
+
+../hw/usb/host-libusb.c: In function 'usb_host_open':
+../hw/usb/host-libusb.c:953:32: error: 'USBDEVFS_GET_SPEED' undeclared (first use in this function); did you mean 'USBDEVFS_GETDRIVER'?
+ int rc = ioctl(hostfd, USBDEVFS_GET_SPEED, NULL);
+ ^~~~~~~~~~~~~~~~~~
+ USBDEVFS_GETDRIVER
+
+A tentative was made to fix this build failure with
+https://gitlab.com/qemu-project/qemu/-/commit/4969e697c15ac536d5c0700381d5d026ef7f0588
+
+However, the assumtion that distros with old kernels also have old
+libusb is just wrong so also add a check for defined(USBDEVFS_GET_SPEED)
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: sent to qemu-devel@nongnu.org]
+---
+ hw/usb/host-libusb.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
+index b950501d10..0343300d3e 100644
+--- a/hw/usb/host-libusb.c
++++ b/hw/usb/host-libusb.c
+@@ -941,7 +941,7 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev, int hostfd)
+ usb_host_ep_update(s);
+
+ libusb_speed = libusb_get_device_speed(dev);
+-#if LIBUSB_API_VERSION >= 0x01000107 && defined(CONFIG_LINUX)
++#if LIBUSB_API_VERSION >= 0x01000107 && defined(CONFIG_LINUX) && defined(USBDEVFS_GET_SPEED)
+ if (hostfd && libusb_speed == 0) {
+ /*
+ * Workaround libusb bug: libusb_get_device_speed() does not
+--
+2.29.2
+
diff --git a/package/qemu/0004-meson-add-tests-option.patch b/package/qemu/0004-meson-add-tests-option.patch
new file mode 100644
index 0000000000..aff8a0f9fc
--- /dev/null
+++ b/package/qemu/0004-meson-add-tests-option.patch
@@ -0,0 +1,92 @@
+From c24f6cc8f847a4f90cd8fe0f94604862c5ac4a5e Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@gmail.com>
+Date: Mon, 21 Dec 2020 22:12:14 +0100
+Subject: [PATCH] meson: add tests option
+
+tests/fp/fp-bench.c use fenv.h that is not always provided
+by the libc (uClibc).
+
+To workaround this issue, add an new meson option to
+disable tests while building Qemu.
+
+Fixes:
+http://autobuild.buildroot.net/results/53f5d8baa994d599b9da013ee643b82353366ec3/build-end.log
+
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ configure | 7 +++++++
+ meson.build | 5 ++++-
+ meson_options.txt | 2 ++
+ 3 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 18c26e0389..7cceae4418 100755
+--- a/configure
++++ b/configure
+@@ -449,6 +449,7 @@ meson=""
+ ninja=""
+ skip_meson=no
+ gettext=""
++tests="auto"
+
+ bogus_os="no"
+ malloc_trim="auto"
+@@ -1525,6 +1526,10 @@ for opt do
+ ;;
+ --disable-libdaxctl) libdaxctl=no
+ ;;
++ --disable-tests) tests="disabled"
++ ;;
++ --enable-tests) tests="enabled"
++ ;;
+ *)
+ echo "ERROR: unknown option $opt"
+ echo "Try '$0 --help' for more information"
+@@ -1850,6 +1855,7 @@ disabled with --disable-FEATURE, default is enabled if available:
+ xkbcommon xkbcommon support
+ rng-none dummy RNG, avoid using /dev/(u)random and getrandom()
+ libdaxctl libdaxctl support
++ tests build tests
+
+ NOTE: The object files are built at the place where configure is launched
+ EOF
+@@ -7014,6 +7020,7 @@ NINJA=$ninja $meson setup \
+ -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\
+ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
+ -Dvhost_user_blk_server=$vhost_user_blk_server \
++ -Dtests=$tests \
+ $cross_arg \
+ "$PWD" "$source_path"
+
+diff --git a/meson.build b/meson.build
+index e3386196ba..7f4efdc347 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1944,7 +1944,10 @@ subdir('scripts')
+ subdir('tools')
+ subdir('pc-bios')
+ subdir('docs')
+-subdir('tests')
++if get_option('tests').enabled()
++ subdir('tests')
++endif
++
+ if 'CONFIG_GTK' in config_host
+ subdir('po')
+ endif
+diff --git a/meson_options.txt b/meson_options.txt
+index f6f64785fe..81bffbfe87 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -66,6 +66,8 @@ option('virtiofsd', type: 'feature', value: 'auto',
+ description: 'build virtiofs daemon (virtiofsd)')
+ option('vhost_user_blk_server', type: 'feature', value: 'auto',
+ description: 'build vhost-user-blk server')
++option('tests', type : 'feature', value : 'auto',
++ description: 'Tests build support')
+
+ option('capstone', type: 'combo', value: 'auto',
+ choices: ['disabled', 'enabled', 'auto', 'system', 'internal'],
+--
+2.29.2
+
diff --git a/package/qemu/Config.in b/package/qemu/Config.in
index 33d4cccd7b..391fd5faaf 100644
--- a/package/qemu/Config.in
+++ b/package/qemu/Config.in
@@ -58,6 +58,7 @@ comment "Networking options"
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
diff --git a/package/qemu/Config.in.host b/package/qemu/Config.in.host
index 7ccf768d15..3163797067 100644
--- a/package/qemu/Config.in.host
+++ b/package/qemu/Config.in.host
@@ -15,6 +15,7 @@ config BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
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
@@ -87,7 +88,11 @@ config BR2_PACKAGE_HOST_QEMU_VIRTFS
config BR2_PACKAGE_HOST_QEMU_USB
bool "USB passthrough support"
+ depends on BR2_HOST_GCC_AT_LEAST_4_9 # host-libusb
help
Enables USB passthrough support from guest to host.
+comment "USB passthrough support needs a toolchain w/ host gcc >= 4.9"
+ depends on !BR2_HOST_GCC_AT_LEAST_4_9
+
endif
diff --git a/package/qemu/qemu.hash b/package/qemu/qemu.hash
index 317c0b1a4e..7d9936adb4 100644
--- a/package/qemu/qemu.hash
+++ b/package/qemu/qemu.hash
@@ -1,4 +1,4 @@
# Locally computed, tarball verified with GPG signature
-sha256 c9174eb5933d9eb5e61f541cd6d1184cd3118dfe4c5c4955bc1bdc4d390fa4e5 qemu-5.1.0.tar.xz
-sha256 6f04ae8364d0079a192b14635f4b1da294ce18724c034c39a6a41d1b09df6100 COPYING
-sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LIB
+sha256 cb18d889b628fbe637672b0326789d9b0e3b8027e0445b936537c78549df17bc qemu-5.2.0.tar.xz
+sha256 6f04ae8364d0079a192b14635f4b1da294ce18724c034c39a6a41d1b09df6100 COPYING
+sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LIB
diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index 69850ec938..b552ea139e 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -4,7 +4,7 @@
#
################################################################################
-QEMU_VERSION = 5.1.0
+QEMU_VERSION = 5.2.0
QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.xz
QEMU_SITE = http://download.qemu.org
QEMU_LICENSE = GPL-2.0, LGPL-2.1, MIT, BSD-3-Clause, BSD-2-Clause, Others/BSD-1c
@@ -12,10 +12,15 @@ 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-pkgconf libglib2 zlib pixman host-python3
+QEMU_DEPENDENCIES = host-meson host-pkgconf libglib2 zlib pixman host-python3
# Need the LIBS variable because librt and libm are
# not automatically pulled. :-(
@@ -51,8 +56,10 @@ endif
endif
-# There is no "--enable-slirp"
-ifeq ($(BR2_PACKAGE_QEMU_SLIRP),)
+ifeq ($(BR2_PACKAGE_QEMU_SLIRP),y)
+QEMU_OPTS += --enable-slirp=system
+QEMU_DEPENDENCIES += slirp
+else
QEMU_OPTS += --disable-slirp
endif
@@ -161,7 +168,8 @@ define QEMU_CONFIGURE_CMDS
--prefix=/usr \
--cross-prefix=$(TARGET_CROSS) \
--audio-drv-list= \
- --python=$(HOST_DIR)/bin/python3 \
+ --meson=$(HOST_DIR)/bin/meson \
+ --ninja=$(HOST_DIR)/bin/ninja \
--enable-kvm \
--enable-attr \
--enable-vhost-net \
@@ -192,6 +200,9 @@ define QEMU_CONFIGURE_CMDS
--disable-capstone \
--disable-git-update \
--disable-opengl \
+ --disable-vhost-user-blk-server \
+ --disable-virtiofsd \
+ --disable-tests \
$(QEMU_OPTS)
endef
@@ -210,7 +221,7 @@ $(eval $(generic-package))
#-------------------------------------------------------------
# Host-qemu
-HOST_QEMU_DEPENDENCIES = host-pkgconf host-zlib host-libglib2 host-pixman host-python3
+HOST_QEMU_DEPENDENCIES = host-meson host-pkgconf host-zlib host-libglib2 host-pixman host-python3
# BR ARCH qemu
# ------- ----
@@ -325,16 +336,20 @@ define HOST_QEMU_CONFIGURE_CMDS
--host-cc="$(HOSTCC)" \
--extra-cflags="$(HOST_QEMU_CFLAGS)" \
--extra-ldflags="$(HOST_LDFLAGS)" \
- --python=$(HOST_DIR)/bin/python3 \
+ --meson=$(HOST_DIR)/bin/meson \
+ --ninja=$(HOST_DIR)/bin/ninja \
--disable-bzip2 \
--disable-containers \
--disable-curl \
--disable-libssh \
--disable-linux-io-uring \
--disable-sdl \
+ --disable-vhost-user-blk-server \
+ --disable-virtiofsd \
--disable-vnc-jpeg \
--disable-vnc-png \
--disable-vnc-sasl \
+ --disable-tests \
$(HOST_QEMU_OPTS)
endef