From 0560f6db906ab993af985f7493480d4cb4e4b333 Mon Sep 17 00:00:00 2001 From: Will Newton Date: Wed, 7 Jun 2017 10:12:17 +0100 Subject: [PATCH] linux-user/syscall.c: Loosen clone flag check The golang runtime calls clone without the CLONE_SYSVMEM flag but it wants thread semantics. Make this flag optional so golang binaries will start. Signed-off-by: Will Newton --- linux-user/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 925ae11..b180872 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -133,7 +133,7 @@ int __clone2(int (*fn)(void *), void *child_stack_base, */ #define CLONE_THREAD_FLAGS \ (CLONE_VM | CLONE_FS | CLONE_FILES | \ - CLONE_SIGHAND | CLONE_THREAD | CLONE_SYSVSEM) + CLONE_SIGHAND | CLONE_THREAD) /* These flags are ignored: * CLONE_DETACHED is now ignored by the kernel; @@ -150,7 +150,7 @@ int __clone2(int (*fn)(void *), void *child_stack_base, /* Flags for thread creation which we can implement within QEMU itself */ #define CLONE_OPTIONAL_THREAD_FLAGS \ (CLONE_SETTLS | CLONE_PARENT_SETTID | \ - CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID | CLONE_PARENT) + CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID | CLONE_PARENT | CLONE_SYSVSEM) #define CLONE_INVALID_FORK_FLAGS \ (~(CSIGNAL | CLONE_OPTIONAL_FORK_FLAGS | CLONE_IGNORED_FLAGS)) -- 2.9.4