-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
install.sh fails on debian based distros #214
Comments
I run into similar issues on my ubuntu. While I didn't had a problem with minor/major I got this python error:
To resolve it I needed to upgrade |
pipenv is the real move here. Would merge it if someone did the PR |
FWIW, the changes needed to get qemu building on WSL2 as of today (and thus likely on Ubuntu 20.04, and potentially any recent Debian based distro): diff --git a/linux-user/strace.c b/linux-user/strace.c
index 99fe9c56..1d1e3ba6 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -9,6 +9,7 @@
#include <sys/mman.h>
#include <unistd.h>
#include <sched.h>
+#include <sys/sysmacros.h>
#include "qemu.h"
#undef TARGET_ABI_FMT_lx
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d395f628..5d319cb4 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -133,39 +133,46 @@ int __clone2(int (*fn)(void *), void *child_stack_base,
#undef _syscall5
#undef _syscall6
+int stime(const time_t *t)
+{
+ struct timespec ts = {};
+ ts.tv_sec = *t;
+ return clock_settime(CLOCK_REALTIME, &ts);
+}
+
#define _syscall0(type,name) \
-static type name (void) \
+type name (void) \
{ \
return syscall(__NR_##name); \
}
#define _syscall1(type,name,type1,arg1) \
-static type name (type1 arg1) \
+type name (type1 arg1) \
{ \
return syscall(__NR_##name, arg1); \
}
#define _syscall2(type,name,type1,arg1,type2,arg2) \
-static type name (type1 arg1,type2 arg2) \
+type name (type1 arg1,type2 arg2) \
{ \
return syscall(__NR_##name, arg1, arg2); \
}
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
-static type name (type1 arg1,type2 arg2,type3 arg3) \
+type name (type1 arg1,type2 arg2,type3 arg3) \
{ \
return syscall(__NR_##name, arg1, arg2, arg3); \
}
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
-static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4) \
+type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4) \
{ \
return syscall(__NR_##name, arg1, arg2, arg3, arg4); \
}
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
type5,arg5) \
-static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
+type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
{ \
return syscall(__NR_##name, arg1, arg2, arg3, arg4, arg5); \
}
@@ -173,7 +180,7 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
type5,arg5,type6,arg6) \
-static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \
+type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \
type6 arg6) \
{ \
return syscall(__NR_##name, arg1, arg2, arg3, arg4, arg5, arg6); \
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index c2ff9702..245f8b54 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -29,6 +29,7 @@
#include "qemu/queue.h"
#include "qemu/host-utils.h"
#include "qemu/sockets.h"
+#include <sys/sysmacros.h>
#ifndef CONFIG_HAS_ENVIRON
#ifdef __APPLE__
diff --git a/user-exec.c b/user-exec.c
index 8ad89a46..50c7cba6 100644
--- a/user-exec.c
+++ b/user-exec.c
@@ -58,7 +58,7 @@ static void exception_action(CPUState *cpu)
void cpu_resume_from_signal(CPUState *cpu, void *puc)
{
#ifdef __linux__
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
#elif defined(__OpenBSD__)
struct sigcontext *uc = puc;
#endif
@@ -172,7 +172,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
#elif defined(__OpenBSD__)
struct sigcontext *uc = puc;
#else
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
#endif
unsigned long pc;
int trapno;
@@ -227,7 +227,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
#elif defined(__OpenBSD__)
struct sigcontext *uc = puc;
#else
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
#endif
pc = PC_sig(uc);
@@ -289,7 +289,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
#ifdef __APPLE__
#include <sys/ucontext.h>
-typedef struct ucontext SIGCONTEXT;
+typedef ucontext_t SIGCONTEXT;
/* All Registers access - only for local access */
#define REG_sig(reg_name, context) \
((context)->uc_mcontext->ss.reg_name)
@@ -332,7 +332,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
ucontext_t *uc = puc;
#else
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
#endif
unsigned long pc;
int is_write;
@@ -359,7 +359,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
uint32_t *pc = uc->uc_mcontext.sc_pc;
uint32_t insn = *pc;
int is_write = 0;
@@ -457,7 +457,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
#if defined(__NetBSD__)
ucontext_t *uc = puc;
#else
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
#endif
unsigned long pc;
int is_write;
@@ -484,7 +484,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
int cpu_signal_handler(int host_signum, void *pinfo, void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
uintptr_t pc = uc->uc_mcontext.pc;
uint32_t insn = *(uint32_t *)pc;
bool is_write;
@@ -513,7 +513,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
unsigned long pc;
int is_write;
@@ -535,7 +535,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
int cpu_signal_handler(int host_signum, void *pinfo, void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
unsigned long ip;
int is_write = 0;
@@ -566,7 +566,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
unsigned long pc;
uint16_t *pinsn;
int is_write = 0;
@@ -619,7 +619,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
greg_t pc = uc->uc_mcontext.pc;
int is_write;
@@ -635,7 +635,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
- struct ucontext *uc = puc;
+ ucontext_t *uc = puc;
unsigned long pc = uc->uc_mcontext.sc_iaoq[0];
uint32_t insn = *(uint32_t *)pc;
int is_write = 0;
diff --git a/util/memfd.c b/util/memfd.c
index 7c406914..1f3de727 100644
--- a/util/memfd.c
+++ b/util/memfd.c
@@ -40,7 +40,7 @@
#include <sys/syscall.h>
#include <asm/unistd.h>
-static int memfd_create(const char *name, unsigned int flags)
+int memfd_create(const char *name, unsigned int flags)
{
#ifdef __NR_memfd_create
return syscall(__NR_memfd_create, name, flags); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried to install qira on a debian based distro...I faced some errors, probably due to some libs/package misalignment.
I managed to fix and have everything working, just want to share, in case someone else face the same issues.
Consider that I got the lazy way to fix....no reinstallations, just mods....
Error: "error: static declaration of 'memfd_create' follows non-static declaration"
Fix: remove static from "int memfd_create" in "qira-1.3/tracers/qemu/qemu-2.5.1/util/memfd.c"
Error: "error: undefined reference to 'minor'/'major'"
Fix: add "#include <sys/sysmacros.h>" in "qira-1.3/tracers/qemu/qemu-2.5.1/qga/commands-posix.c"
and "qira-1.3/tracers/qemu/qemu-latest/linux-user/strace.c"
Error: "error dereferencing pointer to incomplete type 'struct ucontext'"
Fix: take this at your own risk, but modify every "ucontext" decalaration in "ucontext_t" in
"qira-1.3/tracers/qemu/qemu-latest/user-exec.c"
I don't know if it make sense to include these mods in the code...not sure if it's just my problem or a common one.
The text was updated successfully, but these errors were encountered: