summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/pseudo
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2020-04-27 14:04:16 +0800
committerSteve Sakoman <steve@sakoman.com>2020-05-01 10:12:13 -1000
commit9fff03afb8e67b360042e80fda8213a67472b9ec (patch)
tree3e81e1ccb1dc035e4aa89247bf68e094957831ac /meta/recipes-devtools/pseudo
parented7ce0d5e9009d80a79c39bb3d0d45de6e7721c0 (diff)
downloadopenembedded-core-contrib-9fff03afb8e67b360042e80fda8213a67472b9ec.tar.gz
pseudo: add macro guard for seccomp
It fails to compile pseudo-native on centos 7: | ports/linux/pseudo_wrappers.c: In function ‘prctl’: | ports/linux/pseudo_wrappers.c:129:14: error: ‘SECCOMP_SET_MODE_FILTER’ undeclared (first use in this function) | if (cmd == SECCOMP_SET_MODE_FILTER) { | ^ Add macro guard for the definition to avoid the failure. Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-devtools/pseudo')
-rw-r--r--meta/recipes-devtools/pseudo/files/seccomp.patch15
1 files changed, 14 insertions, 1 deletions
diff --git a/meta/recipes-devtools/pseudo/files/seccomp.patch b/meta/recipes-devtools/pseudo/files/seccomp.patch
index be42eaf353..283f997941 100644
--- a/meta/recipes-devtools/pseudo/files/seccomp.patch
+++ b/meta/recipes-devtools/pseudo/files/seccomp.patch
@@ -7,6 +7,17 @@ Upstream-Status: Pending
RP 2020/4/3
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+It fails to compile pseudo-native on centos 7:
+
+| ports/linux/pseudo_wrappers.c: In function ‘prctl’:
+| ports/linux/pseudo_wrappers.c:129:14: error: ‘SECCOMP_SET_MODE_FILTER’ undeclared (first use in this function)
+| if (cmd == SECCOMP_SET_MODE_FILTER) {
+| ^
+
+Add macro guard for seccomp to avoid the failure.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
Index: git/ports/linux/pseudo_wrappers.c
===================================================================
--- git.orig/ports/linux/pseudo_wrappers.c
@@ -40,7 +51,7 @@ Index: git/ports/linux/pseudo_wrappers.c
/* gcc magic to attempt to just pass these args to syscall. we have to
* guess about the number of args; the docs discuss calling conventions
* up to 7, so let's try that?
-@@ -92,3 +108,42 @@ static long wrap_syscall(long nr, va_lis
+@@ -92,3 +108,44 @@ static long wrap_syscall(long nr, va_lis
(void) ap;
return -1;
}
@@ -56,6 +67,7 @@ Index: git/ports/linux/pseudo_wrappers.c
+ return rc;
+ }
+
++#ifdef SECCOMP_SET_MODE_FILTER
+ /* pseudo and seccomp are incompatible as pseudo uses different syscalls
+ * so pretend to enable seccomp but really do nothing */
+ if (option == PR_SET_SECCOMP) {
@@ -67,6 +79,7 @@ Index: git/ports/linux/pseudo_wrappers.c
+ return 0;
+ }
+ }
++#endif
+
+ /* gcc magic to attempt to just pass these args to prctl. we have to
+ * guess about the number of args; the docs discuss calling conventions