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
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-04-29 15:02:19 +0100
commit430ef75dcfddf998f1789c7f0ac66673da7016ee (patch)
treebcd7e42799ea41001641211985d2d50759871a62 /meta/recipes-devtools/pseudo
parent48a8eb0fc207d4e97f8d5d43bda4600767b5a07b (diff)
downloadpoky-430ef75dcfddf998f1789c7f0ac66673da7016ee.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. (From OE-Core rev: d1c4492cb9cf5a624bb996c94e9a1589133be014) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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
7RP 2020/4/3 7RP 2020/4/3
8Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 8Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 9
10It fails to compile pseudo-native on centos 7:
11
12| ports/linux/pseudo_wrappers.c: In function ‘prctl’:
13| ports/linux/pseudo_wrappers.c:129:14: error: ‘SECCOMP_SET_MODE_FILTER’ undeclared (first use in this function)
14| if (cmd == SECCOMP_SET_MODE_FILTER) {
15| ^
16
17Add macro guard for seccomp to avoid the failure.
18
19Signed-off-by: Kai Kang <kai.kang@windriver.com>
20
10Index: git/ports/linux/pseudo_wrappers.c 21Index: git/ports/linux/pseudo_wrappers.c
11=================================================================== 22===================================================================
12--- git.orig/ports/linux/pseudo_wrappers.c 23--- git.orig/ports/linux/pseudo_wrappers.c
@@ -40,7 +51,7 @@ Index: git/ports/linux/pseudo_wrappers.c
40 /* gcc magic to attempt to just pass these args to syscall. we have to 51 /* gcc magic to attempt to just pass these args to syscall. we have to
41 * guess about the number of args; the docs discuss calling conventions 52 * guess about the number of args; the docs discuss calling conventions
42 * up to 7, so let's try that? 53 * up to 7, so let's try that?
43@@ -92,3 +108,42 @@ static long wrap_syscall(long nr, va_lis 54@@ -92,3 +108,44 @@ static long wrap_syscall(long nr, va_lis
44 (void) ap; 55 (void) ap;
45 return -1; 56 return -1;
46 } 57 }
@@ -56,6 +67,7 @@ Index: git/ports/linux/pseudo_wrappers.c
56+ return rc; 67+ return rc;
57+ } 68+ }
58+ 69+
70+#ifdef SECCOMP_SET_MODE_FILTER
59+ /* pseudo and seccomp are incompatible as pseudo uses different syscalls 71+ /* pseudo and seccomp are incompatible as pseudo uses different syscalls
60+ * so pretend to enable seccomp but really do nothing */ 72+ * so pretend to enable seccomp but really do nothing */
61+ if (option == PR_SET_SECCOMP) { 73+ if (option == PR_SET_SECCOMP) {
@@ -67,6 +79,7 @@ Index: git/ports/linux/pseudo_wrappers.c
67+ return 0; 79+ return 0;
68+ } 80+ }
69+ } 81+ }
82+#endif
70+ 83+
71+ /* gcc magic to attempt to just pass these args to prctl. we have to 84+ /* gcc magic to attempt to just pass these args to prctl. we have to
72+ * guess about the number of args; the docs discuss calling conventions 85+ * guess about the number of args; the docs discuss calling conventions