qemu: update to 7.1.0.

This commit is contained in:
Evgeny Ermakov 2022-09-03 19:29:11 +11:00 committed by Đoàn Trần Công Danh
parent 1a5b19cfa8
commit bd7f6cf5f5
3 changed files with 25 additions and 119 deletions

View File

@ -1,100 +0,0 @@
From 3cd3df2a9584e6f753bb62a0028bd67124ab5532 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Tue, 2 Aug 2022 12:41:34 -0400
Subject: [PATCH] linux-user: fix compat with glibc >= 2.36 sys/mount.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The latest glibc 2.36 has extended sys/mount.h so that it
defines the FSCONFIG_* enum constants. These are historically
defined in linux/mount.h, and thus if you include both headers
the compiler complains:
In file included from /usr/include/linux/fs.h:19,
from ../linux-user/syscall.c:98:
/usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command'
95 | enum fsconfig_command {
| ^~~~~~~~~~~~~~~~
In file included from ../linux-user/syscall.c:31:
/usr/include/sys/mount.h:189:6: note: originally defined here
189 | enum fsconfig_command
| ^~~~~~~~~~~~~~~~
/usr/include/linux/mount.h:96:9: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG'
96 | FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */
| ^~~~~~~~~~~~~~~~~
/usr/include/sys/mount.h:191:3: note: previous definition of 'FSCONFIG_SET_FLAG' with type 'enum fsconfig_command'
191 | FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */
| ^~~~~~~~~~~~~~~~~
...snip...
QEMU doesn't include linux/mount.h, but it does use
linux/fs.h and thus gets linux/mount.h indirectly.
glibc acknowledges this problem but does not appear to
be intending to fix it in the forseeable future, simply
documenting it as a known incompatibility with no
workaround:
https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
https://sourceware.org/glibc/wiki/Synchronizing_Headers
To address this requires either removing use of sys/mount.h
or linux/fs.h, despite QEMU needing declarations from
both.
This patch removes linux/fs.h, meaning we have to define
various FS_IOC constants that are now unavailable.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Message-Id: <20220802164134.1851910-1-berrange@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/syscall.c | 18 ++++++++++++++++++
meson.build | 2 ++
2 files changed, 20 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ef53feb5ab45..f4091212027c 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -95,7 +95,25 @@
#include <linux/soundcard.h>
#include <linux/kd.h>
#include <linux/mtio.h>
+
+#ifdef HAVE_SYS_MOUNT_FSCONFIG
+/*
+ * glibc >= 2.36 linux/mount.h conflicts with sys/mount.h,
+ * which in turn prevents use of linux/fs.h. So we have to
+ * define the constants ourselves for now.
+ */
+#define FS_IOC_GETFLAGS _IOR('f', 1, long)
+#define FS_IOC_SETFLAGS _IOW('f', 2, long)
+#define FS_IOC_GETVERSION _IOR('v', 1, long)
+#define FS_IOC_SETVERSION _IOW('v', 2, long)
+#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)
+#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
+#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
+#define FS_IOC32_GETVERSION _IOR('v', 1, int)
+#define FS_IOC32_SETVERSION _IOW('v', 2, int)
+#else
#include <linux/fs.h>
+#endif
#include <linux/fd.h>
#if defined(CONFIG_FIEMAP)
#include <linux/fiemap.h>
diff --git a/meson.build b/meson.build
index 294e9a8f329e..30a380752c0d 100644
--- a/meson.build
+++ b/meson.build
@@ -1963,6 +1963,8 @@ config_host_data.set('HAVE_OPTRESET',
cc.has_header_symbol('getopt.h', 'optreset'))
config_host_data.set('HAVE_IPPROTO_MPTCP',
cc.has_header_symbol('netinet/in.h', 'IPPROTO_MPTCP'))
+config_host_data.set('HAVE_SYS_MOUNT_FSCONFIG',
+ cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG'))
# has_member
config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID',

View File

@ -57,7 +57,7 @@ index b9c4b81..cf26497 100644
#define UNAME_MACHINE "ppc64le"
#endif
#else
+#ifdef TARGET_WORDS_BIGENDIAN
+#if TARGET_BIG_ENDIAN
#define UNAME_MACHINE "ppc"
+#else
+#define UNAME_MACHINE "ppcle"
@ -89,19 +89,25 @@ index 9f1580a..393943f 100755
echo "ppcle"
;;
arm|armel|armhf|arm64|armv[4-9]*l|aarch64)
diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index e1b70e2..e07f5fe 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -59,6 +59,8 @@ fi
: $(cross_cc_mips="mips-linux-gnu-gcc")
: ${cross_cc_ppc="powerpc-linux-gnu-gcc"}
: ${cross_cc_cflags_ppc="-m32"}
+: ${cross_cc_ppcle="powerpcle-linux-gnu-gcc"}
diff --git a/configure b/configure
index 72ab03f11a..0691929d76 100755
--- a/configure
+++ b/configure
@@ -1866,6 +1866,7 @@ fi
: ${cross_prefix_mips="mips-linux-gnu-"}
: ${cross_prefix_nios2="nios2-linux-gnu-"}
: ${cross_prefix_ppc="powerpc-linux-gnu-"}
+: ${cross_prefix_ppcle="powerpcle-linux-gnu-"}
: ${cross_prefix_ppc64="powerpc64-linux-gnu-"}
: ${cross_prefix_ppc64le="$cross_prefix_ppc64"}
: ${cross_prefix_riscv64="riscv64-linux-gnu-"}
@@ -1883,6 +1884,7 @@ fi
: ${cross_cc_cflags_hexagon="-mv67 -O2 -static"}
: ${cross_cc_cflags_i386="-m32"}
: ${cross_cc_cflags_ppc="-m32 -mbig-endian"}
+: ${cross_cc_cflags_ppcle="-m32"}
: ${cross_cc_ppc64="powerpc64-linux-gnu-gcc"}
: ${cross_cc_ppc64le="powerpc64le-linux-gnu-gcc"}
: $(cross_cc_riscv64="riscv64-linux-gnu-gcc")
--
: ${cross_cc_cflags_ppc64="-m64 -mbig-endian"}
: ${cross_cc_ppc64le="$cross_cc_ppc64"}
: ${cross_cc_cflags_ppc64le="-m64 -mlittle-endian"}
2.30.1

View File

@ -1,18 +1,18 @@
# Template file for 'qemu'
# This package should be updated together with qemu-user-static
pkgname=qemu
version=7.0.0
version=7.1.0
revision=1
build_style=configure
configure_args="--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/libexec --localstatedir=/var
--disable-glusterfs --disable-xen --enable-docs --enable-kvm --enable-libusb --enable-pie
--enable-snappy --enable-tpm --enable-usb-redir --enable-vhost-net --enable-virtfs --enable-vnc-png
--enable-snappy --enable-tpm --enable-usb-redir --enable-vhost-net --enable-virtfs --enable-png
--audio-drv-list=alsa$(vopt_if sdl2 ,sdl)$(vopt_if jack ,jack)$(vopt_if pulseaudio ,pa)
$(vopt_enable opengl) $(vopt_enable pulseaudio pa) $(vopt_enable sdl2 sdl) $(vopt_enable smartcard)
$(vopt_enable spice) $(vopt_enable virgl virglrenderer) $(vopt_if gtk3 '--enable-gtk')"
hostmakedepends="gettext pkg-config perl python3 python3-Sphinx python3-sphinx_rtd_theme ninja"
makedepends="dtc-devel libpng-devel libjpeg-turbo-devel pixman-devel snappy-devel
libuuid-devel libX11-devel alsa-lib-devel libaio-devel gnutls-devel
makedepends="capstone-devel dtc-devel libpng-devel libjpeg-turbo-devel pixman-devel
snappy-devel libuuid-devel libX11-devel alsa-lib-devel libaio-devel gnutls-devel
libsasl-devel libglib-devel ncurses-devel libseccomp-devel nss-devel
libcurl-devel xfsprogs-devel libcap-ng-devel vde2-devel usbredir-devel
libbluetooth-devel libssh2-devel libusb-devel libnfs-devel libslirp-devel
@ -28,7 +28,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.1-or-later"
homepage="https://www.qemu.org"
distfiles="https://wiki.qemu.org/download/qemu-${version}.tar.bz2"
checksum=a83032c6ce0dba35479610a4e11a7d8c4a6dffb17152653c183eec3c58616d4e
checksum=f7ac2b85b3f1831e6810b140306e30af91556e15784864b209f3942858947fd0
ignore_elf_dirs="/usr/share/qemu"
nostrip_files="hppa-firmware.img openbios-ppc openbios-sparc32 openbios-sparc64
palcode-clipper s390-ccw.img s390-netboot.img u-boot.e500 opensbi-riscv32-generic-fw_dynamic.elf