Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-kernel/linux-headers/files/, sys-kernel/linux-headers/
Date: Thu, 30 Dec 2021 09:41:15
Message-Id: 1640857057.1ef3659212ff98d2e6bb5df51e405c0953a45fec.sam@gentoo
1 commit: 1ef3659212ff98d2e6bb5df51e405c0953a45fec
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 30 09:37:33 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 30 09:37:37 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ef36592
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.10-remove-inclusion-sysinfo.h.patch | 24 +++++++++++
16 .../linux-headers/linux-headers-5.10-r2.ebuild | 49 ++++++++++++++++++++++
17 2 files changed, 73 insertions(+)
18
19 diff --git a/sys-kernel/linux-headers/files/linux-headers-5.10-remove-inclusion-sysinfo.h.patch b/sys-kernel/linux-headers/files/linux-headers-5.10-remove-inclusion-sysinfo.h.patch
20 new file mode 100644
21 index 000000000000..7f23d77a71a5
22 --- /dev/null
23 +++ b/sys-kernel/linux-headers/files/linux-headers-5.10-remove-inclusion-sysinfo.h.patch
24 @@ -0,0 +1,24 @@
25 +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 ++#endif
44 + #include <linux/const.h>
45 +
46 + #endif /* _UAPI_LINUX_KERNEL_H */
47 +
48 +
49
50 diff --git a/sys-kernel/linux-headers/linux-headers-5.10-r2.ebuild b/sys-kernel/linux-headers/linux-headers-5.10-r2.ebuild
51 new file mode 100644
52 index 000000000000..26138c3d9ff4
53 --- /dev/null
54 +++ b/sys-kernel/linux-headers/linux-headers-5.10-r2.ebuild
55 @@ -0,0 +1,49 @@
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 +SRC_URI="${KERNEL_URI}
69 + ${PATCH_VER:+mirror://gentoo/gentoo-headers-${PATCH_PV}-${PATCH_VER}.tar.xz}
70 + ${PATCH_VER:+https://dev.gentoo.org/~sam/distfiles/gentoo-headers-${PATCH_PV}-${PATCH_VER}.tar.xz}
71 +"
72 +S="${WORKDIR}"/linux-${PV}
73 +
74 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
75 +
76 +BDEPEND="app-arch/xz-utils
77 + dev-lang/perl"
78 +
79 +src_unpack() {
80 + unpack ${A}
81 +}
82 +
83 +src_prepare() {
84 + [[ -n ${PATCH_VER} ]] && eapply "${WORKDIR}"/${PATCH_PV}/*.patch
85 +
86 + if use elibc_musl ; then
87 + # TODO: May need forward porting to newer versions
88 + eapply "${FILESDIR}"/${PN}-5.10-Use-stddefs.h-instead-of-compiler.h.patch
89 + eapply "${FILESDIR}"/${PN}-5.10-remove-inclusion-sysinfo.h.patch
90 + fi
91 +
92 + default
93 +}
94 +
95 +src_test() {
96 + emake headers_check ${xmakeopts}
97 +}
98 +
99 +src_install() {
100 + kernel-2_src_install
101 +
102 + find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
103 + find "${ED}" -depth -type d -delete 2>/dev/null
104 +}