[PATCH] filter_seccomp: fix build for no-MMU targets

Baruch Siach baruch at tkos.co.il
Fri Oct 4 07:06:04 UTC 2019


Detect and define NOMMU_SYSTEM correctly to avoid unsupported fork()
call on no-MMU Linux systems.

Fix strace binary link failure:

.../arm-buildroot-uclinux-uclibcgnueabi/bin/ld.real: strace-filter_seccomp.o: in function `check_seccomp_filter':
filter_seccomp.c:(.text+0x39a): undefined reference to `fork'
collect2: error: ld returned 1 exit status
---
 filter_seccomp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/filter_seccomp.c b/filter_seccomp.c
index fc582654b7ac..28b46aabe25e 100644
--- a/filter_seccomp.c
+++ b/filter_seccomp.c
@@ -21,6 +21,11 @@
 #include "syscall.h"
 #include "scno.h"
 
+#if !defined(HAVE_FORK)
+# undef NOMMU_SYSTEM
+# define NOMMU_SYSTEM 1
+#endif
+
 bool seccomp_filtering;
 bool seccomp_before_sysentry;
 
-- 
2.23.0



More information about the Strace-devel mailing list