1 |
commit: a70524f6112e0bd88cbc3c84b77f393e4f6944f5 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Aug 2 23:40:20 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Aug 2 23:40:27 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a70524f6 |
7 |
|
8 |
sys-apps/systemd-utils: fix build w/ glibc 2.36 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/863218 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
sys-apps/systemd-utils/files/251-glibc-2.36.patch | 154 ++++++++++++++++++++++ |
14 |
sys-apps/systemd-utils/systemd-utils-251.3.ebuild | 3 + |
15 |
2 files changed, 157 insertions(+) |
16 |
|
17 |
diff --git a/sys-apps/systemd-utils/files/251-glibc-2.36.patch b/sys-apps/systemd-utils/files/251-glibc-2.36.patch |
18 |
new file mode 100644 |
19 |
index 000000000000..65693d747ca3 |
20 |
--- /dev/null |
21 |
+++ b/sys-apps/systemd-utils/files/251-glibc-2.36.patch |
22 |
@@ -0,0 +1,154 @@ |
23 |
+https://bugs.gentoo.org/863218 |
24 |
+https://github.com/systemd/systemd/issues/23984 |
25 |
+https://github.com/systemd/systemd/commit/3657d3a01c7e25ff86d7a4642065b367c4ff7484 |
26 |
+https://github.com/systemd/systemd/commit/0a58cd00454cc7b57b04f3a4a334584d743d7f7a |
27 |
+ |
28 |
+From: Rudi Heitbaum <rudi@××××××××.com> |
29 |
+Date: Sat, 23 Jul 2022 10:38:49 +0000 |
30 |
+Subject: [PATCH] glibc: Remove #include <linux/fs.h> to resolve |
31 |
+ fsconfig_command/mount_attr conflict with glibc 2.36 |
32 |
+ |
33 |
+--- a/meson.build |
34 |
++++ b/meson.build |
35 |
+@@ -511,7 +511,6 @@ decl_headers = ''' |
36 |
+ #include <uchar.h> |
37 |
+ #include <sys/mount.h> |
38 |
+ #include <sys/stat.h> |
39 |
+-#include <linux/fs.h> |
40 |
+ ''' |
41 |
+ |
42 |
+ foreach decl : ['char16_t', |
43 |
+@@ -523,6 +522,17 @@ foreach decl : ['char16_t', |
44 |
+ # We get -1 if the size cannot be determined |
45 |
+ have = cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0 |
46 |
+ |
47 |
++ if decl == 'struct mount_attr' |
48 |
++ if have |
49 |
++ want_linux_fs_h = false |
50 |
++ else |
51 |
++ have = cc.sizeof(decl, |
52 |
++ prefix : decl_headers + '#include <linux/fs.h>', |
53 |
++ args : '-D_GNU_SOURCE') > 0 |
54 |
++ want_linux_fs_h = have |
55 |
++ endif |
56 |
++ endif |
57 |
++ |
58 |
+ if decl == 'struct statx' |
59 |
+ if have |
60 |
+ want_linux_stat_h = false |
61 |
+@@ -538,6 +548,7 @@ foreach decl : ['char16_t', |
62 |
+ endforeach |
63 |
+ |
64 |
+ conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h) |
65 |
++conf.set10('WANT_LINUX_FS_H', want_linux_fs_h) |
66 |
+ |
67 |
+ foreach ident : ['secure_getenv', '__secure_getenv'] |
68 |
+ conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident)) |
69 |
+--- a/src/basic/fd-util.c |
70 |
++++ b/src/basic/fd-util.c |
71 |
+@@ -3,7 +3,9 @@ |
72 |
+ #include <errno.h> |
73 |
+ #include <fcntl.h> |
74 |
+ #include <linux/btrfs.h> |
75 |
++#if WANT_LINUX_FS_H |
76 |
+ #include <linux/fs.h> |
77 |
++#endif |
78 |
+ #include <linux/magic.h> |
79 |
+ #include <sys/ioctl.h> |
80 |
+ #include <sys/resource.h> |
81 |
+--- a/src/core/namespace.c |
82 |
++++ b/src/core/namespace.c |
83 |
+@@ -7,7 +7,9 @@ |
84 |
+ #include <sys/file.h> |
85 |
+ #include <sys/mount.h> |
86 |
+ #include <unistd.h> |
87 |
++#if WANT_LINUX_FS_H |
88 |
+ #include <linux/fs.h> |
89 |
++#endif |
90 |
+ |
91 |
+ #include "alloc-util.h" |
92 |
+ #include "base-filesystem.h" |
93 |
+--- a/src/shared/mount-util.c |
94 |
++++ b/src/shared/mount-util.c |
95 |
+@@ -7,7 +7,9 @@ |
96 |
+ #include <sys/statvfs.h> |
97 |
+ #include <unistd.h> |
98 |
+ #include <linux/loop.h> |
99 |
++#if WANT_LINUX_FS_H |
100 |
+ #include <linux/fs.h> |
101 |
++#endif |
102 |
+ |
103 |
+ #include "alloc-util.h" |
104 |
+ #include "chase-symlinks.h" |
105 |
+ |
106 |
+From 0a58cd00454cc7b57b04f3a4a334584d743d7f7a Mon Sep 17 00:00:00 2001 |
107 |
+From: Yu Watanabe <watanabe.yu+github@×××××.com> |
108 |
+Date: Tue, 26 Jul 2022 20:03:12 +0900 |
109 |
+Subject: [PATCH] home: drop conflicted headers |
110 |
+ |
111 |
+Fixes #24117. |
112 |
+--- a/src/basic/missing_fs.h |
113 |
++++ b/src/basic/missing_fs.h |
114 |
+@@ -64,3 +64,8 @@ |
115 |
+ #ifndef FS_PROJINHERIT_FL |
116 |
+ #define FS_PROJINHERIT_FL 0x20000000 |
117 |
+ #endif |
118 |
++ |
119 |
++/* linux/fscrypt.h */ |
120 |
++#ifndef FS_KEY_DESCRIPTOR_SIZE |
121 |
++#define FS_KEY_DESCRIPTOR_SIZE 8 |
122 |
++#endif |
123 |
+--- a/src/home/homework-cifs.c |
124 |
++++ b/src/home/homework-cifs.c |
125 |
+@@ -1,5 +1,10 @@ |
126 |
+ /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
127 |
+ |
128 |
++#include <sys/mount.h> |
129 |
++#if WANT_LINUX_FS_H |
130 |
++#include <linux/fs.h> |
131 |
++#endif |
132 |
++ |
133 |
+ #include "dirent-util.h" |
134 |
+ #include "fd-util.h" |
135 |
+ #include "fileio.h" |
136 |
+--- a/src/home/homework-luks.c |
137 |
++++ b/src/home/homework-luks.c |
138 |
+@@ -4,7 +4,6 @@ |
139 |
+ #include <poll.h> |
140 |
+ #include <sys/file.h> |
141 |
+ #include <sys/ioctl.h> |
142 |
+-#include <sys/mount.h> |
143 |
+ #include <sys/xattr.h> |
144 |
+ |
145 |
+ #if HAVE_VALGRIND_MEMCHECK_H |
146 |
+--- a/src/home/homework-mount.c |
147 |
++++ b/src/home/homework-mount.c |
148 |
+@@ -2,7 +2,9 @@ |
149 |
+ |
150 |
+ #include <sched.h> |
151 |
+ #include <sys/mount.h> |
152 |
++#if WANT_LINUX_FS_H |
153 |
+ #include <linux/fs.h> |
154 |
++#endif |
155 |
+ |
156 |
+ #include "alloc-util.h" |
157 |
+ #include "fd-util.h" |
158 |
+--- a/src/home/homework.h |
159 |
++++ b/src/home/homework.h |
160 |
+@@ -1,13 +1,14 @@ |
161 |
+ /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
162 |
+ #pragma once |
163 |
+ |
164 |
+-#include <linux/fs.h> |
165 |
+ #include <sys/vfs.h> |
166 |
+ |
167 |
+ #include "sd-id128.h" |
168 |
+ |
169 |
++#include "cryptsetup-util.h" |
170 |
+ #include "homework-password-cache.h" |
171 |
+ #include "loop-util.h" |
172 |
++#include "missing_fs.h" /* for FS_KEY_DESCRIPTOR_SIZE, do not include linux/fs.h */ |
173 |
+ #include "missing_keyctl.h" |
174 |
+ #include "missing_syscall.h" |
175 |
+ #include "user-record.h" |
176 |
+ |
177 |
|
178 |
diff --git a/sys-apps/systemd-utils/systemd-utils-251.3.ebuild b/sys-apps/systemd-utils/systemd-utils-251.3.ebuild |
179 |
index 21ec7a6de8f9..277f36c6be9c 100644 |
180 |
--- a/sys-apps/systemd-utils/systemd-utils-251.3.ebuild |
181 |
+++ b/sys-apps/systemd-utils/systemd-utils-251.3.ebuild |
182 |
@@ -105,7 +105,10 @@ QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*" |
183 |
|
184 |
src_prepare() { |
185 |
local PATCHES=( |
186 |
+ # bug #863218 |
187 |
+ "${FILESDIR}/251-glibc-2.36.patch" |
188 |
) |
189 |
+ |
190 |
if use elibc_musl; then |
191 |
PATCHES+=( "${WORKDIR}/${MUSL_PATCHSET}" ) |
192 |
# Applied upstream in 251.3 |