From 2d0a5e25471b9d52f92a6c056b4471f94630ec52 Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Sat, 26 Feb 2022 13:17:36 -0500 Subject: [PATCH 01/15] wip --- Q/Qemu/build_tarballs.jl | 25 +++++++++------- Q/Qemu/bundled/patches/qemu_falloc.patch | 13 +++++++++ .../patches/qemu_madv_nohugepage.patch | 29 ++++++++++++++----- 3 files changed, 49 insertions(+), 18 deletions(-) create mode 100644 Q/Qemu/bundled/patches/qemu_falloc.patch diff --git a/Q/Qemu/build_tarballs.jl b/Q/Qemu/build_tarballs.jl index 24f46eba75c..1d86f5007ea 100644 --- a/Q/Qemu/build_tarballs.jl +++ b/Q/Qemu/build_tarballs.jl @@ -1,27 +1,30 @@ using BinaryBuilder name = "Qemu" -version = v"4.1.0" +version = v"6.2.0" # Collection of sources required to build libffi sources = [ - GitSource("https://gitlab.com/virtio-fs/qemu.git", - "bf5775237ee563b4baa1c7f3c1a65b7c93b93fca"), + ArchiveSource("https://download.qemu.org/qemu-6.2.0.tar.xz", + "68e15d8e45ac56326e0b9a4afa8b49a3dfe8aba3488221d098c84698bca65b45"), DirectorySource("./bundled"), ] # Bash recipe for building across all platforms script = raw""" -cd $WORKSPACE/srcdir/qemu +cd $WORKSPACE/srcdir/qemu-* # Patch out usage of MADV_NOHUGEPAGE which does not exist in glibc 2.12.X atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_madv_nohugepage.patch" -# Patch in adapter for `clock_gettime()` on macOS 10.12- -atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_clock_gettime.patch" +# Patch to include `falloc` header in `strace.c` +atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_falloc.patch" -# Patch to fix pointer mismatch between `size_t` and `uint64_t` -atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_size_uint64.patch" +## Patch in adapter for `clock_gettime()` on macOS 10.12- +#atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_clock_gettime.patch" +# +## Patch to fix pointer mismatch between `size_t` and `uint64_t` +#atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_size_uint64.patch" # Configure, ignoring some warnings that we don't need, etc... ./configure --host-cc="${HOSTCC}" --extra-cflags="-I${prefix}/include -Wno-unused-result" --disable-cocoa --prefix=$prefix @@ -40,10 +43,12 @@ platforms = [ Platform("x86_64", "linux"; libc="glibc"), Platform("x86_64", "macos"), ] +platforms = supported_platforms() # The products that we will ensure are always built products = [ ExecutableProduct("qemu-system-x86_64", :qemu_system_x86_64), + ExecutableProduct("qemu-system-aarch64", :qemu_system_aarch64), ] # Dependencies that must be installed before this package can be built @@ -52,9 +57,9 @@ dependencies = [ Dependency("Glib_jll", v"2.59.0"; compat="2.59.0"), Dependency("PCRE_jll"), # TOOD: verify Gettext is actually needed at runtime - Dependency("Gettext_jll", v"0.20.1"; compat="=0.20.1"), + Dependency("Gettext_jll"), Dependency("libcap_jll"), ] # Build the tarballs, and possibly a `build.jl` as well. -build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"8") diff --git a/Q/Qemu/bundled/patches/qemu_falloc.patch b/Q/Qemu/bundled/patches/qemu_falloc.patch new file mode 100644 index 00000000000..3ca5dd77884 --- /dev/null +++ b/Q/Qemu/bundled/patches/qemu_falloc.patch @@ -0,0 +1,13 @@ +--- a/linux-user/strace.c ++++ b/linux-user/strace.c +@@ -18,6 +18,10 @@ + #include "user-internals.h" + #include "strace.h" + ++#if defined(CONFIG_FALLOCATE_PUNCH_HOLE) || defined(CONFIG_FALLOCATE_ZERO_RANGE) ++#include ++#endif ++ + struct syscallname { + int nr; + const char *name; diff --git a/Q/Qemu/bundled/patches/qemu_madv_nohugepage.patch b/Q/Qemu/bundled/patches/qemu_madv_nohugepage.patch index 76bc6ca9889..c631f741e44 100644 --- a/Q/Qemu/bundled/patches/qemu_madv_nohugepage.patch +++ b/Q/Qemu/bundled/patches/qemu_madv_nohugepage.patch @@ -1,13 +1,26 @@ -diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c -index 8af8c84dec..d86395f31a 100644 ---- a/contrib/libvhost-user/libvhost-user.c -+++ b/contrib/libvhost-user/libvhost-user.c -@@ -646,7 +646,7 @@ vu_set_mem_table_exec_postcopy(VuDev *dev, VhostUserMsg *vmsg) +--- a/subprojects/libvhost-user/libvhost-user.c ++++ b/subprojects/libvhost-user/libvhost-user.c +@@ -80,6 +80,14 @@ + } \ + } while (0) + ++/* copied from include/qemu/osdep.h */ ++#define QEMU_MADV_INVALID -1 ++#ifdef MADV_NOHUGEPAGE ++#define QEMU_MADV_NOHUGEPAGE MADV_NOHUGEPAGE ++#else ++#define QEMU_MADV_NOHUGEPAGE QEMU_MADV_INVALID ++#endif ++ + static inline + bool has_feature(uint64_t features, unsigned int fbit) + { +@@ -634,7 +642,7 @@ */ - ret = madvise((void *)dev_region->mmap_addr, + ret = madvise((void *)(uintptr_t)dev_region->mmap_addr, dev_region->size + dev_region->mmap_offset, - MADV_NOHUGEPAGE); + QEMU_MADV_NOHUGEPAGE); if (ret) { - /* Note: This can happen legally on kernels that are configured - * without madvise'able hugepages + /* + * Note: This can happen legally on kernels that are configured From 55027c95f4e661c1317f7e55ad6c555840f75065 Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Sat, 26 Feb 2022 13:38:18 -0500 Subject: [PATCH 02/15] add julia compat --- Q/Qemu/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Q/Qemu/build_tarballs.jl b/Q/Qemu/build_tarballs.jl index 1d86f5007ea..99e2535e933 100644 --- a/Q/Qemu/build_tarballs.jl +++ b/Q/Qemu/build_tarballs.jl @@ -62,4 +62,4 @@ dependencies = [ ] # Build the tarballs, and possibly a `build.jl` as well. -build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"8") +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"8", julia_compat="1.6") From 23065e96ca914fc5adc4b3cad7787be39cc106ba Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Sat, 26 Feb 2022 14:04:17 -0500 Subject: [PATCH 03/15] debug failing make --- Q/Qemu/build_tarballs.jl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Q/Qemu/build_tarballs.jl b/Q/Qemu/build_tarballs.jl index 99e2535e933..277f68bbea2 100644 --- a/Q/Qemu/build_tarballs.jl +++ b/Q/Qemu/build_tarballs.jl @@ -33,17 +33,18 @@ echo '#!/bin/true ' > /usr/bin/Rez echo '#!/bin/true ' > /usr/bin/SetFile chmod +x /usr/bin/Rez chmod +x /usr/bin/SetFile -make -j${nproc} -make install +make -j${nproc} --trace || true +make install --trace || true """ # These are the platforms we will build for by default, unless further # platforms are passed in on the command line platforms = [ Platform("x86_64", "linux"; libc="glibc"), - Platform("x86_64", "macos"), + Platform("i686", "linux"; libc="glibc"), + Platform("x86_64", "linux"; libc="musl"), + Platform("i686", "linux"; libc="musl"), ] -platforms = supported_platforms() # The products that we will ensure are always built products = [ From bd4f6b6adb0aed807a8f27b7cdedba8e8e698640 Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Sat, 26 Feb 2022 14:34:23 -0500 Subject: [PATCH 04/15] patch makefile to not fail on cleanup --- Q/Qemu/build_tarballs.jl | 7 +++++-- .../bundled/patches/qemu_no_fail_in_cleanup.patch | 13 +++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 Q/Qemu/bundled/patches/qemu_no_fail_in_cleanup.patch diff --git a/Q/Qemu/build_tarballs.jl b/Q/Qemu/build_tarballs.jl index 277f68bbea2..3abdc856544 100644 --- a/Q/Qemu/build_tarballs.jl +++ b/Q/Qemu/build_tarballs.jl @@ -20,6 +20,9 @@ atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_madv_nohugepage.patch" # Patch to include `falloc` header in `strace.c` atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_falloc.patch" +# Patch to not fail if trying to clean up non-existent files +atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_no_fail_in_cleanup.patch" + ## Patch in adapter for `clock_gettime()` on macOS 10.12- #atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_clock_gettime.patch" # @@ -33,8 +36,8 @@ echo '#!/bin/true ' > /usr/bin/Rez echo '#!/bin/true ' > /usr/bin/SetFile chmod +x /usr/bin/Rez chmod +x /usr/bin/SetFile -make -j${nproc} --trace || true -make install --trace || true +make -j${nproc} +make install """ # These are the platforms we will build for by default, unless further diff --git a/Q/Qemu/bundled/patches/qemu_no_fail_in_cleanup.patch b/Q/Qemu/bundled/patches/qemu_no_fail_in_cleanup.patch new file mode 100644 index 00000000000..4c9655d1bcd --- /dev/null +++ b/Q/Qemu/bundled/patches/qemu_no_fail_in_cleanup.patch @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index 48c2177..401b0ca 100755 +--- a/configure ++++ b/configure +@@ -49,7 +49,7 @@ endif + @if test "$(MAKECMDGOALS)" = "distclean" && \ + test -e build/auto-created-by-configure ; \ + then \ +- rm -rf build GNUmakefile ; \ ++ rm -rf build GNUmakefile || true ; \ + fi + force: ; + .PHONY: force From 0fba2f0065136f68e3b64c4e8b5548fc1d5528b9 Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Sat, 26 Feb 2022 15:30:45 -0500 Subject: [PATCH 05/15] try to fix musl build --- Q/Qemu/build_tarballs.jl | 5 ++ Q/Qemu/bundled/patches/qemu_syscall.patch | 61 +++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 Q/Qemu/bundled/patches/qemu_syscall.patch diff --git a/Q/Qemu/build_tarballs.jl b/Q/Qemu/build_tarballs.jl index 3abdc856544..fc567d33977 100644 --- a/Q/Qemu/build_tarballs.jl +++ b/Q/Qemu/build_tarballs.jl @@ -23,6 +23,11 @@ atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_falloc.patch" # Patch to not fail if trying to clean up non-existent files atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_no_fail_in_cleanup.patch" +if [[ "${target}" == *-*-musl ]] + # Patch to fix messy header situation on musl + atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_syscall.patch" +fi + ## Patch in adapter for `clock_gettime()` on macOS 10.12- #atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_clock_gettime.patch" # diff --git a/Q/Qemu/bundled/patches/qemu_syscall.patch b/Q/Qemu/bundled/patches/qemu_syscall.patch new file mode 100644 index 00000000000..a85b8d3a77e --- /dev/null +++ b/Q/Qemu/bundled/patches/qemu_syscall.patch @@ -0,0 +1,61 @@ +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index f1cfcc810..52cfe29d6 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -49,6 +49,7 @@ + #include + #include + #include ++#define _LINUX_SYSINFO_H + #include + //#include + #include +@@ -7281,12 +7282,47 @@ static inline abi_long host_to_target_timex64(abi_long target_addr, + #endif + + #ifndef HAVE_SIGEV_NOTIFY_THREAD_ID ++typedef union _sigval { ++ int sival_int; ++ void *sival_ptr; ++} sigval_t; ++ ++/* ++ * This works because the alignment is ok on all current architectures ++ * but we leave open this being overridden in the future ++ */ ++#ifndef __ARCH_SIGEV_PREAMBLE_SIZE ++#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(int) * 2 + sizeof(sigval_t)) ++#endif ++ ++#define SIGEV_MAX_SIZE 64 ++#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) \ ++ / sizeof(int)) ++ ++typedef struct _sigevent { ++ sigval_t sigev_value; ++ int sigev_signo; ++ int sigev_notify; ++ union { ++ int _pad[SIGEV_PAD_SIZE]; ++ int _tid; ++ ++ struct { ++ void (*_function)(sigval_t); ++ void *_attribute; /* really pthread_attr_t */ ++ } _sigev_thread; ++ } _sigev_un; ++} sigevent_t; ++ + #define sigev_notify_thread_id _sigev_un._tid ++#else ++#define _sigevent sigevent + #endif + +-static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp, ++static inline abi_long target_to_host_sigevent(struct sigevent *_host_sevp, + abi_ulong target_addr) + { ++ struct _sigevent *host_sevp = (struct _sigevent*)_host_sevp; + struct target_sigevent *target_sevp; + + if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) { From 0943d9b932e7308665504aae5c9b50cf43a16eb0 Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Sat, 26 Feb 2022 15:34:22 -0500 Subject: [PATCH 06/15] fix bash syntax --- Q/Qemu/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Q/Qemu/build_tarballs.jl b/Q/Qemu/build_tarballs.jl index fc567d33977..d5ac2060563 100644 --- a/Q/Qemu/build_tarballs.jl +++ b/Q/Qemu/build_tarballs.jl @@ -23,7 +23,7 @@ atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_falloc.patch" # Patch to not fail if trying to clean up non-existent files atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_no_fail_in_cleanup.patch" -if [[ "${target}" == *-*-musl ]] +if [[ "${target}" == *-*-musl ]]; then # Patch to fix messy header situation on musl atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_syscall.patch" fi From 43d5101e3e2a890e9f9fc90c591952682b4f8062 Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Sat, 26 Feb 2022 15:41:05 -0500 Subject: [PATCH 07/15] fix makefile failure --- Q/Qemu/build_tarballs.jl | 5 +---- .../bundled/patches/qemu_no_fail_in_cleanup.patch | 13 ------------- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 Q/Qemu/bundled/patches/qemu_no_fail_in_cleanup.patch diff --git a/Q/Qemu/build_tarballs.jl b/Q/Qemu/build_tarballs.jl index d5ac2060563..7c46a3dd31a 100644 --- a/Q/Qemu/build_tarballs.jl +++ b/Q/Qemu/build_tarballs.jl @@ -20,9 +20,6 @@ atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_madv_nohugepage.patch" # Patch to include `falloc` header in `strace.c` atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_falloc.patch" -# Patch to not fail if trying to clean up non-existent files -atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_no_fail_in_cleanup.patch" - if [[ "${target}" == *-*-musl ]]; then # Patch to fix messy header situation on musl atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_syscall.patch" @@ -41,7 +38,7 @@ echo '#!/bin/true ' > /usr/bin/Rez echo '#!/bin/true ' > /usr/bin/SetFile chmod +x /usr/bin/Rez chmod +x /usr/bin/SetFile -make -j${nproc} +make -j${nproc} || true make install """ diff --git a/Q/Qemu/bundled/patches/qemu_no_fail_in_cleanup.patch b/Q/Qemu/bundled/patches/qemu_no_fail_in_cleanup.patch deleted file mode 100644 index 4c9655d1bcd..00000000000 --- a/Q/Qemu/bundled/patches/qemu_no_fail_in_cleanup.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/configure b/configure -index 48c2177..401b0ca 100755 ---- a/configure -+++ b/configure -@@ -49,7 +49,7 @@ endif - @if test "$(MAKECMDGOALS)" = "distclean" && \ - test -e build/auto-created-by-configure ; \ - then \ -- rm -rf build GNUmakefile ; \ -+ rm -rf build GNUmakefile || true ; \ - fi - force: ; - .PHONY: force From ed9ad7136a5380e56adcde0996a89da809fb5f15 Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Sat, 26 Feb 2022 16:22:30 -0500 Subject: [PATCH 08/15] add complete list of products, remove i686 musl --- Q/Qemu/build_tarballs.jl | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/Q/Qemu/build_tarballs.jl b/Q/Qemu/build_tarballs.jl index 7c46a3dd31a..6615a8e42fb 100644 --- a/Q/Qemu/build_tarballs.jl +++ b/Q/Qemu/build_tarballs.jl @@ -48,13 +48,40 @@ platforms = [ Platform("x86_64", "linux"; libc="glibc"), Platform("i686", "linux"; libc="glibc"), Platform("x86_64", "linux"; libc="musl"), - Platform("i686", "linux"; libc="musl"), ] # The products that we will ensure are always built products = [ - ExecutableProduct("qemu-system-x86_64", :qemu_system_x86_64), - ExecutableProduct("qemu-system-aarch64", :qemu_system_aarch64), + ExecutableProduct("qemu-system-xtensaeb" , :qemu_system_xtensaeb ), + ExecutableProduct("qemu-system-xtensa" , :qemu_system_xtensa ), + ExecutableProduct("qemu-system-tricore" , :qemu_system_tricore ), + ExecutableProduct("qemu-system-sparc64" , :qemu_system_sparc64 ), + ExecutableProduct("qemu-system-sparc" , :qemu_system_sparc ), + ExecutableProduct("qemu-system-x86_64" , :qemu_system_x86_64 ), + ExecutableProduct("qemu-system-sh4eb" , :qemu_system_sh4eb ), + ExecutableProduct("qemu-system-s390x" , :qemu_system_s390x ), + ExecutableProduct("qemu-system-sh4" , :qemu_system_sh4 ), + ExecutableProduct("qemu-system-rx" , :qemu_system_rx ), + ExecutableProduct("qemu-system-riscv32" , :qemu_system_riscv32 ), + ExecutableProduct("qemu-system-riscv64" , :qemu_system_riscv64 ), + ExecutableProduct("qemu-system-ppc64" , :qemu_system_ppc64 ), + ExecutableProduct("qemu-system-ppc" , :qemu_system_ppc ), + ExecutableProduct("qemu-system-or1k" , :qemu_system_or1k ), + ExecutableProduct("qemu-system-nios2" , :qemu_system_nios2 ), + ExecutableProduct("qemu-system-microblazeel", :qemu_system_microblazeel), + ExecutableProduct("qemu-system-microblaze" , :qemu_system_microblaze ), + ExecutableProduct("qemu-system-m68k" , :qemu_system_m68k ), + ExecutableProduct("qemu-system-i386" , :qemu_system_i386 ), + ExecutableProduct("qemu-system-cris" , :qemu_system_cris ), + ExecutableProduct("qemu-system-hppa" , :qemu_system_hppa ), + ExecutableProduct("qemu-system-avr" , :qemu_system_avr ), + ExecutableProduct("qemu-system-arm" , :qemu_system_arm ), + ExecutableProduct("qemu-system-alpha" , :qemu_system_alpha ), + ExecutableProduct("qemu-system-aarch64" , :qemu_system_aarch64 ), + ExecutableProduct("qemu-system-mips" , :qemu_system_mips ), + ExecutableProduct("qemu-system-mipsel" , :qemu_system_mipsel ), + ExecutableProduct("qemu-system-mips64el" , :qemu_system_mips64el ), + ExecutableProduct("qemu-system-mips64" , :qemu_system_mips64 ), ] # Dependencies that must be installed before this package can be built From 1b11f5c42a1539471eccf8560c710847e05f9f7b Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Sat, 26 Feb 2022 16:24:46 -0500 Subject: [PATCH 09/15] expand cxxstring ABIs --- Q/Qemu/build_tarballs.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/Q/Qemu/build_tarballs.jl b/Q/Qemu/build_tarballs.jl index 6615a8e42fb..954194cbcf8 100644 --- a/Q/Qemu/build_tarballs.jl +++ b/Q/Qemu/build_tarballs.jl @@ -49,6 +49,7 @@ platforms = [ Platform("i686", "linux"; libc="glibc"), Platform("x86_64", "linux"; libc="musl"), ] +platforms = expand_cxxstring_abis(platforms) # The products that we will ensure are always built products = [ From 93cef647840d25a0926fb8605b23a591bbba35a4 Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Sat, 26 Feb 2022 18:16:29 -0500 Subject: [PATCH 10/15] Update Q/Qemu/build_tarballs.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mosè Giordano --- Q/Qemu/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Q/Qemu/build_tarballs.jl b/Q/Qemu/build_tarballs.jl index 954194cbcf8..7cffc623640 100644 --- a/Q/Qemu/build_tarballs.jl +++ b/Q/Qemu/build_tarballs.jl @@ -91,7 +91,7 @@ dependencies = [ Dependency("Glib_jll", v"2.59.0"; compat="2.59.0"), Dependency("PCRE_jll"), # TOOD: verify Gettext is actually needed at runtime - Dependency("Gettext_jll"), + BuildDependency("Gettext_jll"), Dependency("libcap_jll"), ] From b42beb6d8e900e312ad953995c481cca92334842 Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Sun, 27 Feb 2022 17:20:46 -0500 Subject: [PATCH 11/15] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mosè Giordano --- Q/Qemu/build_tarballs.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Q/Qemu/build_tarballs.jl b/Q/Qemu/build_tarballs.jl index 7cffc623640..bfc603b4f3c 100644 --- a/Q/Qemu/build_tarballs.jl +++ b/Q/Qemu/build_tarballs.jl @@ -88,9 +88,8 @@ products = [ # Dependencies that must be installed before this package can be built dependencies = [ Dependency("Pixman_jll"), - Dependency("Glib_jll", v"2.59.0"; compat="2.59.0"), + Dependency("Glib_jll"; compat="2.68.1"), Dependency("PCRE_jll"), - # TOOD: verify Gettext is actually needed at runtime BuildDependency("Gettext_jll"), Dependency("libcap_jll"), ] From e637a1c38461088e081e25c6897244a48f680955 Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Sun, 27 Feb 2022 18:30:37 -0500 Subject: [PATCH 12/15] disable tests --- Q/Qemu/build_tarballs.jl | 3 +++ .../bundled/patches/qemu_disable_tests.patch | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Q/Qemu/bundled/patches/qemu_disable_tests.patch diff --git a/Q/Qemu/build_tarballs.jl b/Q/Qemu/build_tarballs.jl index bfc603b4f3c..8d31f336589 100644 --- a/Q/Qemu/build_tarballs.jl +++ b/Q/Qemu/build_tarballs.jl @@ -25,6 +25,9 @@ if [[ "${target}" == *-*-musl ]]; then atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_syscall.patch" fi +# Patch to disable tests +atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_disable_tests.patch" + ## Patch in adapter for `clock_gettime()` on macOS 10.12- #atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_clock_gettime.patch" # diff --git a/Q/Qemu/bundled/patches/qemu_disable_tests.patch b/Q/Qemu/bundled/patches/qemu_disable_tests.patch new file mode 100644 index 00000000000..fe54497808a --- /dev/null +++ b/Q/Qemu/bundled/patches/qemu_disable_tests.patch @@ -0,0 +1,22 @@ +--- a/meson.build ++++ b/meson.build +@@ -2620,8 +2620,8 @@ + specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss) + + # needed for fuzzing binaries +-subdir('tests/qtest/libqos') +-subdir('tests/qtest/fuzz') ++#subdir('tests/qtest/libqos') ++#subdir('tests/qtest/fuzz') + + # accel modules + tcg_real_module_ss = ss.source_set() +@@ -3107,7 +3107,7 @@ + subdir('tools') + subdir('pc-bios') + subdir('docs') +-subdir('tests') ++#subdir('tests') + if gtk.found() + subdir('po') + endif From ca1738952162b1e7883a7e8a4ccda3937131d165 Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Sun, 27 Feb 2022 18:43:26 -0500 Subject: [PATCH 13/15] link to rt --- Q/Qemu/build_tarballs.jl | 3 ++ Q/Qemu/bundled/patches/qemu_link_rt.patch | 51 +++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 Q/Qemu/bundled/patches/qemu_link_rt.patch diff --git a/Q/Qemu/build_tarballs.jl b/Q/Qemu/build_tarballs.jl index 8d31f336589..f9ec067b775 100644 --- a/Q/Qemu/build_tarballs.jl +++ b/Q/Qemu/build_tarballs.jl @@ -28,6 +28,9 @@ fi # Patch to disable tests atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_disable_tests.patch" +# Patch to properly link to rt +atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_link_rt.patch" + ## Patch in adapter for `clock_gettime()` on macOS 10.12- #atomic_patch -p1 "${WORKSPACE}/srcdir/patches/qemu_clock_gettime.patch" # diff --git a/Q/Qemu/bundled/patches/qemu_link_rt.patch b/Q/Qemu/bundled/patches/qemu_link_rt.patch new file mode 100644 index 00000000000..555fb4982e9 --- /dev/null +++ b/Q/Qemu/bundled/patches/qemu_link_rt.patch @@ -0,0 +1,51 @@ +diff --git a/contrib/vhost-user-input/meson.build b/contrib/vhost-user-input/meson.build +index 21a9ed4f15..543cee285c 100644 +--- a/contrib/vhost-user-input/meson.build ++++ b/contrib/vhost-user-input/meson.build +@@ -1,4 +1,4 @@ + executable('vhost-user-input', files('main.c'), +- dependencies: [qemuutil, vhost_user], ++ dependencies: [qemuutil, vhost_user, rt], + build_by_default: targetos == 'linux', + install: false) +diff --git a/meson.build b/meson.build +index 8df40bfac4..3079e99e9a 100644 +--- a/meson.build ++++ b/meson.build +@@ -3276,7 +3276,7 @@ if have_tools + subdir('contrib/elf2dmp') + + executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'), +- dependencies: qemuutil, ++ dependencies: [qemuutil, rt], + install: true) + + if 'CONFIG_VHOST_USER' in config_host +@@ -3288,13 +3288,13 @@ if have_tools + + if targetos == 'linux' + executable('qemu-bridge-helper', files('qemu-bridge-helper.c'), +- dependencies: [qemuutil, libcap_ng], ++ dependencies: [qemuutil, libcap_ng, rt], + install: true, + install_dir: get_option('libexecdir')) + + executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/utils.c'), + dependencies: [authz, crypto, io, qom, qemuutil, +- libcap_ng, mpathpersist], ++ libcap_ng, mpathpersist, rt], + install: true) + endif + +diff --git a/qga/meson.build b/qga/meson.build +index 54f2da5b07..21a5f44880 100644 +--- a/qga/meson.build ++++ b/qga/meson.build +@@ -95,7 +95,7 @@ endif + + qga = executable('qemu-ga', qga_ss.sources(), + link_args: qga_libs, +- dependencies: [qemuutil, libudev], ++ dependencies: [qemuutil, libudev, rt], + install: true) + all_qga += qga From 37a801b4fc7594b805341b3a1e9158dcba060001 Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Sun, 27 Feb 2022 18:50:27 -0500 Subject: [PATCH 14/15] fix patch --- Q/Qemu/bundled/patches/qemu_link_rt.patch | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Q/Qemu/bundled/patches/qemu_link_rt.patch b/Q/Qemu/bundled/patches/qemu_link_rt.patch index 555fb4982e9..ebb8e005f10 100644 --- a/Q/Qemu/bundled/patches/qemu_link_rt.patch +++ b/Q/Qemu/bundled/patches/qemu_link_rt.patch @@ -9,10 +9,10 @@ index 21a9ed4f15..543cee285c 100644 build_by_default: targetos == 'linux', install: false) diff --git a/meson.build b/meson.build -index 8df40bfac4..3079e99e9a 100644 +index 96de1a6ef9..96ba587d1a 100644 --- a/meson.build +++ b/meson.build -@@ -3276,7 +3276,7 @@ if have_tools +@@ -3075,7 +3075,7 @@ if have_tools subdir('contrib/elf2dmp') executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'), @@ -21,7 +21,7 @@ index 8df40bfac4..3079e99e9a 100644 install: true) if 'CONFIG_VHOST_USER' in config_host -@@ -3288,13 +3288,13 @@ if have_tools +@@ -3087,13 +3087,13 @@ if have_tools if targetos == 'linux' executable('qemu-bridge-helper', files('qemu-bridge-helper.c'), @@ -38,14 +38,15 @@ index 8df40bfac4..3079e99e9a 100644 endif diff --git a/qga/meson.build b/qga/meson.build -index 54f2da5b07..21a5f44880 100644 +index cfb1fbc085..f4f9475050 100644 --- a/qga/meson.build +++ b/qga/meson.build -@@ -95,7 +95,7 @@ endif +@@ -44,7 +44,7 @@ qga_ss = qga_ss.apply(config_host, strict: false) qga = executable('qemu-ga', qga_ss.sources(), - link_args: qga_libs, + link_args: config_host['LIBS_QGA'].split(), - dependencies: [qemuutil, libudev], + dependencies: [qemuutil, libudev, rt], install: true) - all_qga += qga + all_qga = [qga] + From fa7d22e0c44538edd7002fc0be73f77b26354f6f Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Sun, 27 Feb 2022 19:07:58 -0500 Subject: [PATCH 15/15] actually declare rt as dependency of libqemuutil --- Q/Qemu/bundled/patches/qemu_link_rt.patch | 57 ++++------------------- 1 file changed, 9 insertions(+), 48 deletions(-) diff --git a/Q/Qemu/bundled/patches/qemu_link_rt.patch b/Q/Qemu/bundled/patches/qemu_link_rt.patch index ebb8e005f10..1e630d91658 100644 --- a/Q/Qemu/bundled/patches/qemu_link_rt.patch +++ b/Q/Qemu/bundled/patches/qemu_link_rt.patch @@ -1,52 +1,13 @@ -diff --git a/contrib/vhost-user-input/meson.build b/contrib/vhost-user-input/meson.build -index 21a9ed4f15..543cee285c 100644 ---- a/contrib/vhost-user-input/meson.build -+++ b/contrib/vhost-user-input/meson.build -@@ -1,4 +1,4 @@ - executable('vhost-user-input', files('main.c'), -- dependencies: [qemuutil, vhost_user], -+ dependencies: [qemuutil, vhost_user, rt], - build_by_default: targetos == 'linux', - install: false) diff --git a/meson.build b/meson.build -index 96de1a6ef9..96ba587d1a 100644 +index 96de1a6ef9..36b315971e 100644 --- a/meson.build +++ b/meson.build -@@ -3075,7 +3075,7 @@ if have_tools - subdir('contrib/elf2dmp') - - executable('qemu-edid', files('qemu-edid.c', 'hw/display/edid-generate.c'), -- dependencies: qemuutil, -+ dependencies: [qemuutil, rt], - install: true) - - if 'CONFIG_VHOST_USER' in config_host -@@ -3087,13 +3087,13 @@ if have_tools - - if targetos == 'linux' - executable('qemu-bridge-helper', files('qemu-bridge-helper.c'), -- dependencies: [qemuutil, libcap_ng], -+ dependencies: [qemuutil, libcap_ng, rt], - install: true, - install_dir: get_option('libexecdir')) - - executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/utils.c'), - dependencies: [authz, crypto, io, qom, qemuutil, -- libcap_ng, mpathpersist], -+ libcap_ng, mpathpersist, rt], - install: true) - endif - -diff --git a/qga/meson.build b/qga/meson.build -index cfb1fbc085..f4f9475050 100644 ---- a/qga/meson.build -+++ b/qga/meson.build -@@ -44,7 +44,7 @@ qga_ss = qga_ss.apply(config_host, strict: false) - - qga = executable('qemu-ga', qga_ss.sources(), - link_args: config_host['LIBS_QGA'].split(), -- dependencies: [qemuutil, libudev], -+ dependencies: [qemuutil, libudev, rt], - install: true) - all_qga = [qga] +@@ -2527,7 +2527,7 @@ util_ss.add_all(trace_ss) + util_ss = util_ss.apply(config_all, strict: false) + libqemuutil = static_library('qemuutil', + sources: util_ss.sources() + stub_ss.sources() + genh, +- dependencies: [util_ss.dependencies(), libm, threads, glib, socket, malloc, pixman]) ++ dependencies: [util_ss.dependencies(), libm, threads, glib, socket, malloc, pixman, rt]) + qemuutil = declare_dependency(link_with: libqemuutil, + sources: genh + version_res)