Skip to content

Instantly share code, notes, and snippets.

@mikdusan
Created April 2, 2020 00:03
Show Gist options
  • Save mikdusan/0b51f2d6a2a95ff6b9739f9eabce4fc4 to your computer and use it in GitHub Desktop.
Save mikdusan/0b51f2d6a2a95ff6b9739f9eabce4fc4 to your computer and use it in GitHub Desktop.
static qemu
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 8cf51ffecd..a006f7b025 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,
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5af55fca78..40ef9362d6 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -122,6 +122,13 @@
#include "fd-trans.h"
#include "tcg/tcg.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
@@ -6770,9 +6777,20 @@ static inline abi_long host_to_target_timex(abi_long target_addr,
}
#endif
-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)) {
@mikdusan
Copy link
Author

mikdusan commented Apr 2, 2020

# required
sudo apk linux-headers
sudo apk pixman-static zlib-static glib-static

# may be required; they are on my VM
sudo apk libc-dev pixman-dev glib-dev zlib-dev musl-dev libaio-dev pcre-dev gettext-dev

mkdir _build
cd _build
../configure --prefix=/opt/qemu-5.0.0-rc1 --disable-system --enable-linux-user --disable-werror --static
make -j4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment