From 62ca689e155f5cee7506ed3661e92dfcf97ebca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Wed, 13 Jan 2021 11:36:06 -0300 Subject: [PATCH] qemu-user-static: update to 5.2.0. Move from libglib-static to libglib-devel, which now includes static versions of each library. Pick up tricks from qemu for cross compilation. The patch being applied fixes #23557. Add comment to qemu about qemu-user-static. It's important to update the two packages together, since they share the patches folder. --- srcpkgs/qemu-user-static/template | 24 +++++++++++-------- .../qemu/patches/musl-initialize-msghdr.patch | 15 ++++++++++++ srcpkgs/qemu/template | 3 +++ 3 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 srcpkgs/qemu/patches/musl-initialize-msghdr.patch diff --git a/srcpkgs/qemu-user-static/template b/srcpkgs/qemu-user-static/template index 608dc27d982..01d4d7acb56 100644 --- a/srcpkgs/qemu-user-static/template +++ b/srcpkgs/qemu-user-static/template @@ -1,16 +1,18 @@ # Template file for 'qemu-user-static' +# This package should be updated together with qemu pkgname=qemu-user-static -version=5.1.0 +version=5.2.0 revision=1 wrksrc="qemu-${version}" -hostmakedepends="pkg-config automake python3" -makedepends="dtc-devel libglib-static pixman-devel libuuid-devel" +build_style=configure +hostmakedepends="pkg-config automake python3 ninja" +makedepends="dtc-devel libglib-devel pixman-devel libuuid-devel" short_desc="QEMU User-mode emulators (statically compiled)" maintainer="Orphaned " 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=8314b6e5fcc7bf9fa3915d504de6586a69cba30ffa27cbe9ba85d2cb9987fb3a +checksum=7bd9334c02edaf02f5b0b52beb19fe7f72556c3ca0180e20f0095f0ef2f25f14 _fmts="aarch64 alpha arm armeb cris i386 m68k microblaze mips mipsel mips64 mips64el ppc ppc64 ppc64abi32 ppc64le s390x sh4 sh4eb sparc sparc32plus sparc64 x86_64" @@ -80,19 +82,21 @@ done binfmts="${binfmts%?}" post_extract() { - sed -i 's/__u64/unsigned long/' linux-user/host/aarch64/hostdep.h + vsed -i 's/__u64/unsigned long/' linux-user/host/aarch64/hostdep.h } do_configure() { + if [ "$CROSS_BUILD" ]; then + _args="--cross-prefix=${XBPS_CROSS_TRIPLET}-" + export LIBTOOL=libtool + fi + unset CPP + ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/libexec \ --disable-kvm --disable-vnc-png \ --disable-virtfs --disable-fdt --disable-seccomp \ --enable-linux-user --disable-system \ - --static -} - -do_build() { - make ${makejobs} LDFLAGS="-static -lrt -luuid" + --static ${_args} } do_install() { diff --git a/srcpkgs/qemu/patches/musl-initialize-msghdr.patch b/srcpkgs/qemu/patches/musl-initialize-msghdr.patch new file mode 100644 index 00000000000..c195f0c0b1f --- /dev/null +++ b/srcpkgs/qemu/patches/musl-initialize-msghdr.patch @@ -0,0 +1,15 @@ +Source: https://github.com/void-linux/void-packages/issues/23557 + +diff --git linux-user/syscall.c linux-user/syscall.c +index 945fc25..8d8b68a 100644 +--- linux-user/syscall.c ++++ linux-user/syscall.c +@@ -3071,7 +3071,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp, + int flags, int send) + { + abi_long ret, len; +- struct msghdr msg; ++ struct msghdr msg = {0}; + abi_ulong count; + struct iovec *vec; + abi_ulong target_vec; diff --git a/srcpkgs/qemu/template b/srcpkgs/qemu/template index e8cb4d4672c..ae18a557078 100644 --- a/srcpkgs/qemu/template +++ b/srcpkgs/qemu/template @@ -1,4 +1,5 @@ # Template file for 'qemu' +# This package should be updated together with qemu-user-static pkgname=qemu version=5.2.0 revision=1 @@ -27,6 +28,8 @@ 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 opensbi-riscv64-generic-fw_dynamic.elf" +# FIXME +make_check=extended build_options="gtk3 opengl sdl2 spice virgl smartcard numa iscsi" build_options_default="opengl gtk3 virgl sdl2 numa iscsi"