Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jb-45154' into 'master'
[qemu] Add support glibc > 2.26 See merge request mer-core/qemu-usermode!5
- Loading branch information
Showing
3 changed files
with
459 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, |
Oops, something went wrong.