diff options
Diffstat (limited to 'meta/recipes-devtools/pseudo/files')
| -rw-r--r-- | meta/recipes-devtools/pseudo/files/seccomp.patch | 15 |
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 | |||
| 7 | RP 2020/4/3 | 7 | RP 2020/4/3 |
| 8 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | 8 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 9 | 9 | ||
| 10 | It 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 | |||
| 17 | Add macro guard for seccomp to avoid the failure. | ||
| 18 | |||
| 19 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
| 20 | |||
| 10 | Index: git/ports/linux/pseudo_wrappers.c | 21 | Index: 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 |
