aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-emulation/qemu/files/musl-patches')
-rw-r--r--app-emulation/qemu/files/musl-patches/0001-linux-user-fix-build-with-musl-on-aarch64.patch31
-rw-r--r--app-emulation/qemu/files/musl-patches/0001-linux-user-fix-build-with-musl-on-ppc64le.patch67
-rw-r--r--app-emulation/qemu/files/musl-patches/0001-virtio-host-input-use-safe-64-bit-time-accessors-for.patch40
-rw-r--r--app-emulation/qemu/files/musl-patches/0002-virtio-user-input-use-safe-64-bit-time-accessors-for.patch40
-rw-r--r--app-emulation/qemu/files/musl-patches/0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch37
-rw-r--r--app-emulation/qemu/files/musl-patches/MAP_SYNC-fix.patch22
-rw-r--r--app-emulation/qemu/files/musl-patches/fix-segevent-and-sigval_t.patch24
-rw-r--r--app-emulation/qemu/files/musl-patches/fix-sendmsg.patch13
-rw-r--r--app-emulation/qemu/files/musl-patches/fix-sockios-header.patch13
-rw-r--r--app-emulation/qemu/files/musl-patches/ignore-signals-33-and-64-to-allow-golang-emulation.patch56
-rw-r--r--app-emulation/qemu/files/musl-patches/mips-softfloat.patch32
-rw-r--r--app-emulation/qemu/files/musl-patches/musl-F_SHLCK-and-F_EXLCK.patch19
-rw-r--r--app-emulation/qemu/files/musl-patches/xattr_size_max.patch15
13 files changed, 0 insertions, 409 deletions
diff --git a/app-emulation/qemu/files/musl-patches/0001-linux-user-fix-build-with-musl-on-aarch64.patch b/app-emulation/qemu/files/musl-patches/0001-linux-user-fix-build-with-musl-on-aarch64.patch
deleted file mode 100644
index 1bbae7de..00000000
--- a/app-emulation/qemu/files/musl-patches/0001-linux-user-fix-build-with-musl-on-aarch64.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 806cb2ed28a16cf2894fabef034347f426f1d04e Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Thu, 15 Dec 2016 11:53:07 +0100
-Subject: [PATCH] linux-user: fix build with musl on aarch64
-
-Use the standard uint64_t instead of internal __u64.
-
-This fixes compiler error with musl libc on aarch64:
-.../qemu-2.7.0/linux-user/host/aarch64/hostdep.h:28:5:
-error: unknown type name '__u64'
- __u64 *pcreg = &uc->uc_mcontext.pc;
- ^~~~~
-
-Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
----
- linux-user/host/aarch64/hostdep.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/linux-user/host/aarch64/hostdep.h b/linux-user/host/aarch64/hostdep.h
-index 64f75cef49..6fd6e36b2a 100644
---- a/linux-user/host/aarch64/hostdep.h
-+++ b/linux-user/host/aarch64/hostdep.h
-@@ -25,7 +25,7 @@ extern char safe_syscall_end[];
- static inline void rewind_if_in_safe_syscall(void *puc)
- {
- ucontext_t *uc = puc;
-- __u64 *pcreg = &uc->uc_mcontext.pc;
-+ uint64_t *pcreg = &uc->uc_mcontext.pc;
-
- if (*pcreg > (uintptr_t)safe_syscall_start
- && *pcreg < (uintptr_t)safe_syscall_end) {
diff --git a/app-emulation/qemu/files/musl-patches/0001-linux-user-fix-build-with-musl-on-ppc64le.patch b/app-emulation/qemu/files/musl-patches/0001-linux-user-fix-build-with-musl-on-ppc64le.patch
deleted file mode 100644
index c3a91877..00000000
--- a/app-emulation/qemu/files/musl-patches/0001-linux-user-fix-build-with-musl-on-ppc64le.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/linux-user/host/ppc64/hostdep.h
-+++ b/linux-user/host/ppc64/hostdep.h
-@@ -25,7 +25,11 @@
- static inline void rewind_if_in_safe_syscall(void *puc)
- {
- ucontext_t *uc = puc;
-+#if defined(__GLIBC__) || defined(__UCLIBC__)
- unsigned long *pcreg = &uc->uc_mcontext.gp_regs[PT_NIP];
-+#else // Musl
-+ unsigned long *pcreg = &uc->uc_mcontext.gp_regs[32];
-+#endif
-
- if (*pcreg > (uintptr_t)safe_syscall_start
- && *pcreg < (uintptr_t)safe_syscall_end) {
---- a/accel/tcg/user-exec.c
-+++ a/accel/tcg/user-exec.c
-@@ -228,6 +228,7 @@
- */
- #ifdef linux
- /* All Registers access - only for local access */
-+#if defined(__GLIBC__) || defined(__UCLIBC__)
- #define REG_sig(reg_name, context) \
- ((context)->uc_mcontext.regs->reg_name)
- /* Gpr Registers access */
-@@ -245,15 +246,42 @@
- /* Condition register */
- #define CR_sig(context) REG_sig(ccr, context)
-
-+#else // Musl
-+#define REG_sig(reg_num, context) \
-+ ((context)->uc_mcontext.gp_regs[reg_num])
-+/* Gpr Registers access */
-+#define GPR_sig(reg_num, context) REG_sig(gpr[reg_num], context)
-+/* Program counter */
-+#define IAR_sig(context) REG_sig(32, context)
-+/* Machine State Register (Supervisor) */
-+#define MSR_sig(context) REG_sig(33, context)
-+/* Count register */
-+#define CTR_sig(context) REG_sig(35, context)
-+/* User's integer exception register */
-+#define XER_sig(context) REG_sig(37, context)
-+/* Link register */
-+#define LR_sig(context) REG_sig(36, context)
-+/* Condition register */
-+#define CR_sig(context) REG_sig(38, context)
-+#endif
-+
-+
- /* Float Registers access */
- #define FLOAT_sig(reg_num, context) \
- (((double *)((char *)((context)->uc_mcontext.regs + 48 * 4)))[reg_num])
- #define FPSCR_sig(context) \
- (*(int *)((char *)((context)->uc_mcontext.regs + (48 + 32 * 2) * 4)))
- /* Exception Registers access */
-+#if defined(__GLIBC__) || defined(__UCLIBC__)
- #define DAR_sig(context) REG_sig(dar, context)
- #define DSISR_sig(context) REG_sig(dsisr, context)
- #define TRAP_sig(context) REG_sig(trap, context)
-+#else // Musl
-+#define DAR_sig(context) REG_sig(41, context)
-+#define DSISR_sig(context) REG_sig(42, context)
-+#define TRAP_sig(context) REG_sig(40, context)
-+#endif
-+
- #endif /* linux */
-
- #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
diff --git a/app-emulation/qemu/files/musl-patches/0001-virtio-host-input-use-safe-64-bit-time-accessors-for.patch b/app-emulation/qemu/files/musl-patches/0001-virtio-host-input-use-safe-64-bit-time-accessors-for.patch
deleted file mode 100644
index ba66aae1..00000000
--- a/app-emulation/qemu/files/musl-patches/0001-virtio-host-input-use-safe-64-bit-time-accessors-for.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 388ef67707f01fe4ad337642325ae974dd81c242 Mon Sep 17 00:00:00 2001
-From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Wed, 22 Jul 2020 02:45:00 -0600
-Subject: [PATCH 1/2] virtio host input: use safe 64-bit time accessors for
- input_event
-
-On 32-bit systems with 64-bit time_t, input_event.time is not
-directly accessible. Instead, we must use input_event_sec and
-input_event_usec accessors to set the time values.
-
-Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
----
- hw/input/virtio-input-host.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/hw/input/virtio-input-host.c b/hw/input/virtio-input-host.c
-index 85daf73f1a..7b81bf09f5 100644
---- a/hw/input/virtio-input-host.c
-+++ b/hw/input/virtio-input-host.c
-@@ -193,13 +193,16 @@ static void virtio_input_host_handle_status(VirtIOInput *vinput,
- {
- VirtIOInputHost *vih = VIRTIO_INPUT_HOST(vinput);
- struct input_event evdev;
-+ struct timeval tv;
- int rc;
-
-- if (gettimeofday(&evdev.time, NULL)) {
-+ if (gettimeofday(&tv, NULL)) {
- perror("virtio_input_host_handle_status: gettimeofday");
- return;
- }
-
-+ evdev.input_event_sec = tv.tv_sec;
-+ evdev.input_event_usec = tv.tv_usec;
- evdev.type = le16_to_cpu(event->type);
- evdev.code = le16_to_cpu(event->code);
- evdev.value = le32_to_cpu(event->value);
---
-2.27.0
-
diff --git a/app-emulation/qemu/files/musl-patches/0002-virtio-user-input-use-safe-64-bit-time-accessors-for.patch b/app-emulation/qemu/files/musl-patches/0002-virtio-user-input-use-safe-64-bit-time-accessors-for.patch
deleted file mode 100644
index b965f66e..00000000
--- a/app-emulation/qemu/files/musl-patches/0002-virtio-user-input-use-safe-64-bit-time-accessors-for.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From de7cf9878a216143db677820c23407c3b032d12c Mon Sep 17 00:00:00 2001
-From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Wed, 22 Jul 2020 02:51:30 -0600
-Subject: [PATCH 2/2] virtio user input: use safe 64-bit time accessors for
- input_event
-
-On 32-bit systems with 64-bit time_t, input_event.time is not
-directly accessible. Instead, we must use input_event_sec and
-input_event_usec accessors to set the time values.
-
-Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
----
- contrib/vhost-user-input/main.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/main.c
-index 6020c6f33a..4887a6cb44 100644
---- a/contrib/vhost-user-input/main.c
-+++ b/contrib/vhost-user-input/main.c
-@@ -115,13 +115,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 tv;
- int rc;
-
-- if (gettimeofday(&evdev.time, NULL)) {
-+ if (gettimeofday(&tv, NULL)) {
- perror("vi_handle_status: gettimeofday");
- return;
- }
-
-+ evdev.input_event_sec = tv.tv_sec;
-+ evdev.input_event_usec = tv.tv_usec;
- evdev.type = le16toh(event->type);
- evdev.code = le16toh(event->code);
- evdev.value = le32toh(event->value);
---
-2.27.0
-
diff --git a/app-emulation/qemu/files/musl-patches/0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch b/app-emulation/qemu/files/musl-patches/0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch
deleted file mode 100644
index 528b5d5d..00000000
--- a/app-emulation/qemu/files/musl-patches/0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 8fbb4e6797ed67310b74cbaaa061269db45a5b71 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Tue, 29 Apr 2014 15:51:31 +0200
-Subject: [PATCH] linux-user/signal.c: define __SIGRTMIN/MAX for non-GNU
- platforms
-
-The __SIGRTMIN and __SIGRTMAX are glibc internals and are not available
-on all platforms, so we define those if they are missing.
-
-This is needed for musl libc.
-
-Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
----
- linux-user/signal.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/linux-user/signal.c b/linux-user/signal.c
-index 5ca6d62b15..e917c16d91 100644
---- a/linux-user/signal.c
-+++ b/linux-user/signal.c
-@@ -25,6 +25,13 @@
- #include "trace.h"
- #include "signal-common.h"
-
-+#ifndef __SIGRTMIN
-+#define __SIGRTMIN 32
-+#endif
-+#ifndef __SIGRTMAX
-+#define __SIGRTMAX (NSIG-1)
-+#endif
-+
- static struct target_sigaction sigact_table[TARGET_NSIG];
-
- static void host_signal_handler(int host_signum, siginfo_t *info,
---
-2.23.0
-
diff --git a/app-emulation/qemu/files/musl-patches/MAP_SYNC-fix.patch b/app-emulation/qemu/files/musl-patches/MAP_SYNC-fix.patch
deleted file mode 100644
index e13609d7..00000000
--- a/app-emulation/qemu/files/musl-patches/MAP_SYNC-fix.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
-index f7f177d..7598960 100644
---- a/util/mmap-alloc.c
-+++ b/util/mmap-alloc.c
-@@ -10,14 +10,16 @@
- * later. See the COPYING file in the top-level directory.
- */
-
-+#include "qemu/osdep.h"
-+
- #ifdef CONFIG_LINUX
- #include <linux/mman.h>
-+#include <asm-generic/mman.h> /* for ppc64le */
- #else /* !CONFIG_LINUX */
- #define MAP_SYNC 0x0
- #define MAP_SHARED_VALIDATE 0x0
- #endif /* CONFIG_LINUX */
-
--#include "qemu/osdep.h"
- #include "qemu/mmap-alloc.h"
- #include "qemu/host-utils.h"
-
diff --git a/app-emulation/qemu/files/musl-patches/fix-segevent-and-sigval_t.patch b/app-emulation/qemu/files/musl-patches/fix-segevent-and-sigval_t.patch
deleted file mode 100644
index 1f99eacb..00000000
--- a/app-emulation/qemu/files/musl-patches/fix-segevent-and-sigval_t.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- qemu-2.2.1/linux-user/syscall.c.orig 2015-04-10 07:10:06.305662505 +0000
-+++ qemu-2.2.1/linux-user/syscall.c 2015-04-10 07:36:53.801871968 +0000
-@@ -5020,9 +5020,20 @@
- return 0;
- }
-
--static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
-+struct host_sigevent {
-+ union sigval sigev_value;
-+ int sigev_signo;
-+ int sigev_notify;
-+ union {
-+ int _pad[64-sizeof(int) * 2 + sizeof(union sigval)];
-+ int _tid;
-+ } _sigev_un;
-+};
-+
-+static inline abi_long target_to_host_sigevent(struct sigevent *sevp,
- abi_ulong target_addr)
- {
-+ struct host_sigevent *host_sevp = (struct host_sigevent *) sevp;
- struct target_sigevent *target_sevp;
-
- if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {
diff --git a/app-emulation/qemu/files/musl-patches/fix-sendmsg.patch b/app-emulation/qemu/files/musl-patches/fix-sendmsg.patch
deleted file mode 100644
index dc9c4bca..00000000
--- a/app-emulation/qemu/files/musl-patches/fix-sendmsg.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/linux-user/syscall.c b/linux-user/syscall.c
-index 389ec09764..116d5eaff5 100644
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -3337,7 +3337,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 = {};
- abi_ulong count;
- struct iovec *vec;
- abi_ulong target_vec;
diff --git a/app-emulation/qemu/files/musl-patches/fix-sockios-header.patch b/app-emulation/qemu/files/musl-patches/fix-sockios-header.patch
deleted file mode 100644
index 1f3cd767..00000000
--- a/app-emulation/qemu/files/musl-patches/fix-sockios-header.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/linux-user/syscall.c b/linux-user/syscall.c
-index 43d0562..afa0ac4 100644
---- a/linux-user/syscall.c
-+++ b/linux-user/syscall.c
-@@ -59,6 +59,7 @@ int __clone2(int (*fn)(void *), void *child_stack_base,
- #include <linux/icmp.h>
- #include <linux/icmpv6.h>
- #include <linux/errqueue.h>
-+#include <linux/sockios.h>
- #include <linux/random.h>
- #include "qemu-common.h"
- #ifdef CONFIG_TIMERFD
- #include <sys/timerfd.h>
diff --git a/app-emulation/qemu/files/musl-patches/ignore-signals-33-and-64-to-allow-golang-emulation.patch b/app-emulation/qemu/files/musl-patches/ignore-signals-33-and-64-to-allow-golang-emulation.patch
deleted file mode 100644
index 11625422..00000000
--- a/app-emulation/qemu/files/musl-patches/ignore-signals-33-and-64-to-allow-golang-emulation.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From db186a3f83454268c43fc793a48bc28c41368a6c Mon Sep 17 00:00:00 2001
-From: Petros Angelatos <petrosagg@gmail.com>
-Date: Thu, 3 Mar 2016 23:58:53 -0800
-Subject: [PATCH] linux-user: ignore signals 33 and 64 to allow golang
- emulation
-
-Signal 33 will always fail. This causes golang crash since
-https://github.com/golang/go/commit/675eb72c285cd0dd44a5f280bb3fa456ddf6de16
-
-As explained in that commit, these signals are very rarely used in a
-way that causes problems, so it's ok-ish to ignore one of them.
-
-Signal 64 will fail because QEMU uses SIGRTMAX for itself. This causes
-golang to crash for versions earlier than
-https://github.com/golang/go/commit/d10675089d74db0408f2432eae3bd89a8e1c2d6a
-
-Since after that commit golang ignores that signal, we also ignore it here to
-allow earlier versions to run as well.
-
-Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
----
- linux-user/signal.c | 21 +++++++++++++++++++++
- 1 file changed, 21 insertions(+)
-
-diff --git a/linux-user/signal.c b/linux-user/signal.c
-index 9a4d894..90aca55 100644
---- a/linux-user/signal.c
-+++ b/linux-user/signal.c
-@@ -744,6 +744,27 @@ int do_sigaction(int sig, const struct target_sigaction *act,
- }
-
- k = &sigact_table[sig - 1];
-+
-+ /* This signal will always fail. This causes golang crash since
-+ * https://github.com/golang/go/commit/675eb72c285cd0dd44a5f280bb3fa456ddf6de16
-+ *
-+ * As explained in that commit, these signals are very rarely used in a
-+ * way that causes problems, so it's ok-ish to ignore one of them here.
-+ */
-+ if (sig == 33) {
-+ return 0;
-+ }
-+ /* This signal will fail because QEMU uses SIGRTMAX for itself. This causes
-+ * golang to crash for versions earlier than
-+ * https://github.com/golang/go/commit/d10675089d74db0408f2432eae3bd89a8e1c2d6a
-+ *
-+ * Since after that commit golang ignores that signal, we also ignore it here to
-+ * allow earlier versions to run as well.
-+ */
-+ if (sig == 64) {
-+ return 0;
-+ }
-+
- if (oact) {
- __put_user(k->_sa_handler, &oact->_sa_handler);
- __put_user(k->sa_flags, &oact->sa_flags);
diff --git a/app-emulation/qemu/files/musl-patches/mips-softfloat.patch b/app-emulation/qemu/files/musl-patches/mips-softfloat.patch
deleted file mode 100644
index 4d9b4892..00000000
--- a/app-emulation/qemu/files/musl-patches/mips-softfloat.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff --git a/tests/fp/fp-bench.c b/tests/fp/fp-bench.c
-index 4ba5e1d..313256c 100644
---- a/tests/fp/fp-bench.c
-+++ b/tests/fp/fp-bench.c
-@@ -479,6 +479,7 @@ static void QEMU_NORETURN die_host_rounding(enum rounding rounding)
- exit(EXIT_FAILURE);
- }
-
-+#ifndef __mips_soft_float
- static void set_host_precision(enum rounding rounding)
- {
- int rhost;
-@@ -507,6 +508,7 @@ static void set_host_precision(enum rounding rounding)
- die_host_rounding(rounding);
- }
- }
-+#endif
-
- static void set_soft_precision(enum rounding rounding)
- {
-@@ -596,9 +598,11 @@ static void parse_args(int argc, char *argv[])
-
- /* set precision and rounding mode based on the tester */
- switch (tester) {
-+#ifndef __mips_soft_float
- case TESTER_HOST:
- set_host_precision(rounding);
- break;
-+#endif
- case TESTER_SOFT:
- set_soft_precision(rounding);
- switch (precision) {
diff --git a/app-emulation/qemu/files/musl-patches/musl-F_SHLCK-and-F_EXLCK.patch b/app-emulation/qemu/files/musl-patches/musl-F_SHLCK-and-F_EXLCK.patch
deleted file mode 100644
index 316819af..00000000
--- a/app-emulation/qemu/files/musl-patches/musl-F_SHLCK-and-F_EXLCK.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-This patch was not upstreamed to qemu as those should probably be
-defined in musl libc.
-
---- ./linux-user/syscall.c.orig
-+++ ./linux-user/syscall.c
-@@ -114,6 +114,13 @@
-
- #include "qemu.h"
-
-+#ifndef F_SHLCK
-+#define F_SHLCK 8
-+#endif
-+#ifndef F_EXLCK
-+#define F_EXLCK 4
-+#endif
-+
- #ifndef CLONE_IO
- #define CLONE_IO 0x80000000 /* Clone io context */
- #endif
diff --git a/app-emulation/qemu/files/musl-patches/xattr_size_max.patch b/app-emulation/qemu/files/musl-patches/xattr_size_max.patch
deleted file mode 100644
index 1a33cbf5..00000000
--- a/app-emulation/qemu/files/musl-patches/xattr_size_max.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
-index faebd91..a0f15b6 100644
---- a/hw/9pfs/9p.c
-+++ b/hw/9pfs/9p.c
-@@ -25,6 +25,10 @@
- #include "trace.h"
- #include "migration/migration.h"
-
-+#ifdef __linux__
-+#include <linux/limits.h> /* for XATTR_SIZE_MAX */
-+#endif
-+
- int open_fd_hw;
- int total_open_fd;
- static int open_fd_rc;