Skip to content

Commit

Permalink
Merge branch 'jb-45154' into 'master'
Browse files Browse the repository at this point in the history
[qemu] Add support glibc > 2.26

See merge request mer-core/qemu-usermode!5
  • Loading branch information
uaoh committed Apr 24, 2019
2 parents 258aec3 + 3da7053 commit 34c89c8
Show file tree
Hide file tree
Showing 3 changed files with 459 additions and 65 deletions.
62 changes: 62 additions & 0 deletions glibc_2.26_support.patch
@@ -0,0 +1,62 @@
diff -Naur qemu-2.1.0_orig/linux-user/strace.c qemu-2.1.0/linux-user/strace.c
--- qemu-2.1.0_orig/linux-user/strace.c 2014-08-01 18:12:17.000000000 +0400
+++ qemu-2.1.0/linux-user/strace.c 2019-03-14 16:11:15.448369163 +0300
@@ -5,6 +5,9 @@
#include <sys/shm.h>
#include <sys/select.h>
#include <sys/types.h>
+#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 26
+#include <sys/sysmacros.h>
+#endif
#include <sys/mount.h>
#include <sys/mman.h>
#include <unistd.h>
diff -Naur qemu-2.1.0_orig/qga/commands-posix.c qemu-2.1.0/qga/commands-posix.c
--- qemu-2.1.0_orig/qga/commands-posix.c 2014-08-01 18:12:17.000000000 +0400
+++ qemu-2.1.0/qga/commands-posix.c 2019-03-14 16:12:06.708453509 +0300
@@ -13,6 +13,9 @@

#include <glib.h>
#include <sys/types.h>
+#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 26
+#include <sys/sysmacros.h>
+#endif
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <unistd.h>
diff -Naur qemu-2.1.0_orig/user-exec.c qemu-2.1.0/user-exec.c
--- qemu-2.1.0_orig/user-exec.c 2014-08-01 18:12:17.000000000 +0400
+++ qemu-2.1.0/user-exec.c 2019-03-14 16:26:22.349811884 +0300
@@ -57,7 +57,7 @@
void cpu_resume_from_signal(CPUState *cpu, void *puc)
{
#ifdef __linux__
- struct ucontext *uc = puc;
+ struct ucontext_t *uc = puc;
#elif defined(__OpenBSD__)
struct sigcontext *uc = puc;
#endif
@@ -171,7 +171,7 @@
#elif defined(__OpenBSD__)
struct sigcontext *uc = puc;
#else
- struct ucontext *uc = puc;
+ struct ucontext_t *uc = puc;
#endif
unsigned long pc;
int trapno;
@@ -210,10 +210,10 @@
#define ERROR_sig(context) ((context)->uc_mcontext.mc_err)
#define MASK_sig(context) ((context)->uc_sigmask)
#else
-#define PC_sig(context) ((context)->uc_mcontext.gregs[REG_RIP])
-#define TRAP_sig(context) ((context)->uc_mcontext.gregs[REG_TRAPNO])
-#define ERROR_sig(context) ((context)->uc_mcontext.gregs[REG_ERR])
-#define MASK_sig(context) ((context)->uc_sigmask)
+#define PC_sig(context) (((struct ucontext_t *)context)->uc_mcontext.gregs[REG_RIP])
+#define TRAP_sig(context) (((struct ucontext_t *)context)->uc_mcontext.gregs[REG_TRAPNO])
+#define ERROR_sig(context) (((struct ucontext_t *)context)->uc_mcontext.gregs[REG_ERR])
+#define MASK_sig(context) (((struct ucontext_t *)context)->uc_sigmask)
#endif

int cpu_signal_handler(int host_signum, void *pinfo,

0 comments on commit 34c89c8

Please sign in to comment.