@@ -2359,6 +2359,7 @@ block_ss = ss.source_set()
bsd_user_ss = ss.source_set()
chardev_ss = ss.source_set()
common_ss = ss.source_set()
+common_user_ss = ss.source_set()
crypto_ss = ss.source_set()
hwcore_ss = ss.source_set()
io_ss = ss.source_set()
@@ -2605,12 +2606,15 @@ subdir('accel')
subdir('plugins')
subdir('bsd-user')
subdir('linux-user')
+subdir('common-user')
subdir('ebpf')
-specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
+specific_ss.add_all(when: 'CONFIG_BSD_USER',
+ if_true: [bsd_user_ss, common_user_ss])
linux_user_ss.add(files('thunk.c'))
-specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
+specific_ss.add_all(when: 'CONFIG_LINUX_USER',
+ if_true: [linux_user_ss, common_user_ss])
# needed for fuzzing binaries
subdir('tests/qtest/libqos')
similarity index 100%
rename from linux-user/safe-syscall.h
rename to include/user/safe-syscall.h
@@ -31,7 +31,7 @@
#include "trace.h"
#include "signal-common.h"
#include "host-signal.h"
-#include "safe-syscall.h"
+#include "user/safe-syscall.h"
static struct target_sigaction sigact_table[TARGET_NSIG];
@@ -132,7 +132,7 @@
#include "signal-common.h"
#include "loader.h"
#include "user-mmap.h"
-#include "safe-syscall.h"
+#include "user/safe-syscall.h"
#include "qemu/guest-random.h"
#include "qemu/selfmap.h"
#include "user/syscall-trace.h"
new file mode 100644
@@ -0,0 +1,2 @@
+# TODO: reorg the *-user headers so that this can be built once.
+common_user_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('safe-syscall.S'))
similarity index 100%
rename from linux-user/safe-syscall.S
rename to common-user/safe-syscall.S
@@ -9,7 +9,6 @@ linux_user_ss.add(files(
'linuxload.c',
'main.c',
'mmap.c',
- 'safe-syscall.S',
'signal.c',
'strace.c',
'syscall.c',