1 |
commit: e1bd866997acfb6ed2f4e3051ce233658f1b69bc |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 30 09:39:10 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 30 09:39:10 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1bd8669 |
7 |
|
8 |
sys-kernel/linux-headers: fix 5.10 for musl (sysinfo.h) |
9 |
|
10 |
Notably fixes btrfs-progs build. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/828726 |
13 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
14 |
|
15 |
...x-headers-5.15-remove-inclusion-sysinfo.h.patch | 24 ++++++++++ |
16 |
.../linux-headers/linux-headers-5.15-r2.ebuild | 52 ++++++++++++++++++++++ |
17 |
2 files changed, 76 insertions(+) |
18 |
|
19 |
diff --git a/sys-kernel/linux-headers/files/linux-headers-5.15-remove-inclusion-sysinfo.h.patch b/sys-kernel/linux-headers/files/linux-headers-5.15-remove-inclusion-sysinfo.h.patch |
20 |
new file mode 100644 |
21 |
index 000000000000..064066f19ef6 |
22 |
--- /dev/null |
23 |
+++ b/sys-kernel/linux-headers/files/linux-headers-5.15-remove-inclusion-sysinfo.h.patch |
24 |
@@ -0,0 +1,24 @@ |
25 |
+Earlier version: https://git.alpinelinux.org/aports/tree/main/linux-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch |
26 |
+https://bugs.gentoo.org/828726 |
27 |
+ |
28 |
+From: rofl0r <retnyg@×××.net> |
29 |
+Date: Mon, 20 Jan 2014 21:31:34 +0100 |
30 |
+Subject: [PATCH 3/3] remove inclusion of sysinfo.h in kernel.h |
31 |
+ |
32 |
+the declaration of struct sysinfo clashes with userspace. |
33 |
+it's not quite clear why that header was included from kernel.h, |
34 |
+as none of its functionality is needed. |
35 |
+--- a/include/uapi/linux/kernel.h |
36 |
++++ b/include/uapi/linux/kernel.h |
37 |
+@@ -2,7 +2,9 @@ |
38 |
+ #ifndef _UAPI_LINUX_KERNEL_H |
39 |
+ #define _UAPI_LINUX_KERNEL_H |
40 |
+ |
41 |
++#ifdef __GLIBC__ |
42 |
+ #include <linux/sysinfo.h> |
43 |
+ #include <linux/const.h> |
44 |
++#endif |
45 |
+ |
46 |
+ #endif /* _UAPI_LINUX_KERNEL_H */ |
47 |
+ |
48 |
+ |
49 |
|
50 |
diff --git a/sys-kernel/linux-headers/linux-headers-5.15-r2.ebuild b/sys-kernel/linux-headers/linux-headers-5.15-r2.ebuild |
51 |
new file mode 100644 |
52 |
index 000000000000..7fc09552f9bc |
53 |
--- /dev/null |
54 |
+++ b/sys-kernel/linux-headers/linux-headers-5.15-r2.ebuild |
55 |
@@ -0,0 +1,52 @@ |
56 |
+# Copyright 1999-2021 Gentoo Authors |
57 |
+# Distributed under the terms of the GNU General Public License v2 |
58 |
+ |
59 |
+EAPI=7 |
60 |
+ |
61 |
+ETYPE="headers" |
62 |
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 cris frv hexagon hppa ia64 m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 riscv s390 score sh sparc x86 xtensa" |
63 |
+inherit kernel-2 toolchain-funcs |
64 |
+detect_version |
65 |
+ |
66 |
+PATCH_PV=${PV} # to ease testing new versions against not existing patches |
67 |
+PATCH_VER="1" |
68 |
+PATCH_DEV="sam" |
69 |
+SRC_URI="${KERNEL_URI} |
70 |
+ ${PATCH_VER:+https://dev.gentoo.org/~${PATCH_DEV}/distfiles/sys-kernel/linux-headers/gentoo-headers-${PATCH_PV}-${PATCH_VER}.tar.xz}" |
71 |
+S="${WORKDIR}/linux-${PV}" |
72 |
+ |
73 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" |
74 |
+ |
75 |
+BDEPEND="app-arch/xz-utils |
76 |
+ dev-lang/perl" |
77 |
+ |
78 |
+# bug #816762 |
79 |
+RESTRICT="test" |
80 |
+ |
81 |
+[[ -n ${PATCH_VER} ]] && PATCHES=( "${WORKDIR}"/${PATCH_PV} ) |
82 |
+ |
83 |
+src_unpack() { |
84 |
+ # avoid kernel-2_src_unpack |
85 |
+ default |
86 |
+} |
87 |
+ |
88 |
+src_prepare() { |
89 |
+ if use elibc_musl ; then |
90 |
+ # TODO: May need forward porting to newer versions |
91 |
+ eapply "${FILESDIR}"/${PN}-5.10-Use-stddefs.h-instead-of-compiler.h.patch |
92 |
+ eapply "${FILESDIR}"/${PN}-5.15-remove-inclusion-sysinfo.h.patch |
93 |
+ fi |
94 |
+ |
95 |
+ # avoid kernel-2_src_prepare |
96 |
+ default |
97 |
+} |
98 |
+ |
99 |
+src_test() { |
100 |
+ emake headers_check ${xmakeopts} |
101 |
+} |
102 |
+ |
103 |
+src_install() { |
104 |
+ kernel-2_src_install |
105 |
+ |
106 |
+ find "${ED}" \( -name '.install' -o -name '*.cmd' \) -delete || die |
107 |
+} |