1 |
commit: 2e20ec0fa649b0720f862615c6099b947848fd3c |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jul 18 17:46:26 2021 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 18 17:46:26 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e20ec0f |
7 |
|
8 |
sys-apps/file: fix seccomp build failure with musl |
9 |
|
10 |
Closes: https://bugs.gentoo.org/789336 |
11 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
12 |
|
13 |
sys-apps/file/file-5.40-r3.ebuild | 1 + |
14 |
.../files/file-5.40-seccomp-fstatat64-musl.patch | 31 ++++++++++++++++++++++ |
15 |
2 files changed, 32 insertions(+) |
16 |
|
17 |
diff --git a/sys-apps/file/file-5.40-r3.ebuild b/sys-apps/file/file-5.40-r3.ebuild |
18 |
index 90b41899e80..7cb5ba7a5cd 100644 |
19 |
--- a/sys-apps/file/file-5.40-r3.ebuild |
20 |
+++ b/sys-apps/file/file-5.40-r3.ebuild |
21 |
@@ -42,6 +42,7 @@ PATCHES=( |
22 |
"${FILESDIR}/file-5.40-seccomp-faccessat.patch" |
23 |
"${FILESDIR}/file-5.40-seccomp-fstatat64.patch" #784857 |
24 |
"${FILESDIR}/file-5.40-revert-char-count.patch" #799188 |
25 |
+ "${FILESDIR}/file-5.40-seccomp-fstatat64-musl.patch" #789336, not upstream yet |
26 |
) |
27 |
|
28 |
src_prepare() { |
29 |
|
30 |
diff --git a/sys-apps/file/files/file-5.40-seccomp-fstatat64-musl.patch b/sys-apps/file/files/file-5.40-seccomp-fstatat64-musl.patch |
31 |
new file mode 100644 |
32 |
index 00000000000..4cc64801786 |
33 |
--- /dev/null |
34 |
+++ b/sys-apps/file/files/file-5.40-seccomp-fstatat64-musl.patch |
35 |
@@ -0,0 +1,31 @@ |
36 |
+From 8c13923a8e17a02be0989649b2edc20124816729 Mon Sep 17 00:00:00 2001 |
37 |
+From: Mike Gilbert <floppym@g.o> |
38 |
+Date: Tue, 15 Jun 2021 16:08:22 -0400 |
39 |
+Subject: [PATCH] seccomp: undef fstatat64 to avoid build failure on musl |
40 |
+ |
41 |
+sys/stat.h in musl does this: |
42 |
+ |
43 |
+ #define fstatat64 fstatat |
44 |
+ |
45 |
+Counteract this with an #undef. |
46 |
+ |
47 |
+Bug: https://bugs.gentoo.org/789336 |
48 |
+--- |
49 |
+ src/seccomp.c | 1 + |
50 |
+ 1 file changed, 1 insertion(+) |
51 |
+ |
52 |
+diff --git a/src/seccomp.c b/src/seccomp.c |
53 |
+index 3318367c..eb8b1e57 100644 |
54 |
+--- a/src/seccomp.c |
55 |
++++ b/src/seccomp.c |
56 |
+@@ -179,6 +179,7 @@ enable_sandbox_full(void) |
57 |
+ ALLOW_RULE(fstat); |
58 |
+ ALLOW_RULE(fstat64); |
59 |
+ #ifdef __NR_fstatat64 |
60 |
++#undef fstatat64 |
61 |
+ ALLOW_RULE(fstatat64); |
62 |
+ #endif |
63 |
+ ALLOW_RULE(futex); |
64 |
+-- |
65 |
+2.32.0 |
66 |
+ |