1 |
commit: fa0dfbb6b2c16007e97457e3bda1ca88b85860fe |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 24 05:03:51 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 24 05:26:08 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa0dfbb6 |
7 |
|
8 |
net-fs/cifs-utils: fix build on musl |
9 |
|
10 |
Closes: https://bugs.gentoo.org/842195 |
11 |
Acked-by: David Seifert <soap <AT> gentoo.org> |
12 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
13 |
|
14 |
net-fs/cifs-utils/cifs-utils-6.15.ebuild | 1 + |
15 |
net-fs/cifs-utils/files/cifs-utils-6.15-musl.patch | 80 ++++++++++++++++++++++ |
16 |
2 files changed, 81 insertions(+) |
17 |
|
18 |
diff --git a/net-fs/cifs-utils/cifs-utils-6.15.ebuild b/net-fs/cifs-utils/cifs-utils-6.15.ebuild |
19 |
index 3ae6b5fd6284..c4415d563b2e 100644 |
20 |
--- a/net-fs/cifs-utils/cifs-utils-6.15.ebuild |
21 |
+++ b/net-fs/cifs-utils/cifs-utils-6.15.ebuild |
22 |
@@ -42,6 +42,7 @@ DOCS="doc/linux-cifs-client-guide.odt" |
23 |
|
24 |
PATCHES=( |
25 |
"${FILESDIR}/${PN}-6.12-ln_in_destdir.patch" #766594 |
26 |
+ "${FILESDIR}/${PN}-6.15-musl.patch" |
27 |
) |
28 |
|
29 |
pkg_setup() { |
30 |
|
31 |
diff --git a/net-fs/cifs-utils/files/cifs-utils-6.15-musl.patch b/net-fs/cifs-utils/files/cifs-utils-6.15-musl.patch |
32 |
new file mode 100644 |
33 |
index 000000000000..f17cc68bdaca |
34 |
--- /dev/null |
35 |
+++ b/net-fs/cifs-utils/files/cifs-utils-6.15-musl.patch |
36 |
@@ -0,0 +1,80 @@ |
37 |
+https://marc.info/?l=linux-cifs&m=165604639613381&w=2 |
38 |
+ |
39 |
+From c267ecf6a1c2152e640897d30cc0e8f637a8ef76 Mon Sep 17 00:00:00 2001 |
40 |
+From: Sam James <sam@g.o> |
41 |
+Date: Fri, 24 Jun 2022 05:25:23 +0100 |
42 |
+Subject: [PATCH 1/2] getcifsacl, setcifsacl: add missing <linux/limits.h> |
43 |
+ include for XATTR_SIZE_MAX |
44 |
+ |
45 |
+Needed to build on musl. It only works on glibc because of transitive includes |
46 |
+(which could break in future). |
47 |
+ |
48 |
+Example failure: |
49 |
+``` |
50 |
+getcifsacl.c: In function 'getcifsacl': |
51 |
+getcifsacl.c:429:24: error: 'XATTR_SIZE_MAX' undeclared (first use in this function) |
52 |
+ 429 | if (bufsize >= XATTR_SIZE_MAX) { |
53 |
+ | ^~~~~~~~~~~~~~ |
54 |
+``` |
55 |
+ |
56 |
+Bug: https://bugs.gentoo.org/842195 |
57 |
+Signed-off-by: Sam James <sam@g.o> |
58 |
+--- a/getcifsacl.c |
59 |
++++ b/getcifsacl.c |
60 |
+@@ -34,6 +34,7 @@ |
61 |
+ #include <errno.h> |
62 |
+ #include <limits.h> |
63 |
+ #include <ctype.h> |
64 |
++#include <linux/limits.h> |
65 |
+ #include <sys/xattr.h> |
66 |
+ #include "cifsacl.h" |
67 |
+ #include "idmap_plugin.h" |
68 |
+--- a/setcifsacl.c |
69 |
++++ b/setcifsacl.c |
70 |
+@@ -48,6 +48,7 @@ |
71 |
+ #include <errno.h> |
72 |
+ #include <limits.h> |
73 |
+ #include <ctype.h> |
74 |
++#include <linux/limits.h> |
75 |
+ #include <sys/xattr.h> |
76 |
+ |
77 |
+ #include "cifsacl.h" |
78 |
+From d1a36cc4caa541d1f0f9a3426a5202b680cf7ff8 Mon Sep 17 00:00:00 2001 |
79 |
+From: Sam James <sam@g.o> |
80 |
+Date: Fri, 24 Jun 2022 05:26:54 +0100 |
81 |
+Subject: [PATCH 2/2] getcifsacl, setcifsacl: add missing <endian.h> include |
82 |
+ for le32toh |
83 |
+ |
84 |
+Needed to fix build on musl libc. It only works by chance on glibc |
85 |
+because of transitive includes (which could break at any time). |
86 |
+ |
87 |
+Example failure: |
88 |
+``` |
89 |
+getcifsacl.c: In function 'print_ace': |
90 |
+getcifsacl.c:284:16: warning: implicit declaration of function 'le16toh' [-Wimplicit-function-declaration] |
91 |
+ 284 | size = le16toh(pace->size); |
92 |
+ | ^~~~~~~ |
93 |
+``` |
94 |
+ |
95 |
+Bug: https://bugs.gentoo.org/842195 |
96 |
+Signed-off-by: Sam James <sam@g.o> |
97 |
+--- a/getcifsacl.c |
98 |
++++ b/getcifsacl.c |
99 |
+@@ -23,6 +23,7 @@ |
100 |
+ #include "config.h" |
101 |
+ #endif /* HAVE_CONFIG_H */ |
102 |
+ |
103 |
++#include <endian.h> |
104 |
+ #include <string.h> |
105 |
+ #include <getopt.h> |
106 |
+ #include <stdint.h> |
107 |
+--- a/setcifsacl.c |
108 |
++++ b/setcifsacl.c |
109 |
+@@ -38,6 +38,7 @@ |
110 |
+ #include "config.h" |
111 |
+ #endif /* HAVE_CONFIG_H */ |
112 |
+ |
113 |
++#include <endian.h> |
114 |
+ #include <string.h> |
115 |
+ #include <getopt.h> |
116 |
+ #include <stdint.h> |