Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/toolchain/linux-headers-patches:master commit in: 5.3/
Date: Thu, 07 Nov 2019 22:57:39
Message-Id: 1573167319.ba734355267d4accb9a4bd8143dbc880ac5044bc.slyfox@gentoo
1 commit: ba734355267d4accb9a4bd8143dbc880ac5044bc
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 7 22:55:19 2019 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 7 22:55:19 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/toolchain/linux-headers-patches.git/commit/?id=ba734355
7
8 5.3: don't include sysinfo.h on non-glibc libcs
9
10 https://lore.kernel.org/patchwork/patch/449607/
11 https://gitweb.gentoo.org/proj/musl.git/tree/sys-kernel/linux-headers/files/libc-5.1-remove-sysinfo_h-from-kernel_h.patch
12
13 Reported-by: Anarchy
14 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
15
16 ...ecific-inclusion-of-sysinfo.h-in-kernel.h.patch | 46 ++++++++++++++++++++++
17 1 file changed, 46 insertions(+)
18
19 diff --git a/5.3/00_all_0009_glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch b/5.3/00_all_0009_glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch
20 new file mode 100644
21 index 0000000..df075dc
22 --- /dev/null
23 +++ b/5.3/00_all_0009_glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch
24 @@ -0,0 +1,46 @@
25 +https://lore.kernel.org/patchwork/patch/449607/
26 +https://gitweb.gentoo.org/proj/musl.git/tree/sys-kernel/linux-headers/files/libc-5.1-remove-sysinfo_h-from-kernel_h.patch
27 +
28 +Date: Fri, 14 Mar 2014 17:14:10 +0100
29 +From: David Heidelberger <david.heidelberger@××××.cz>
30 +To: linux-kernel@×××××××××××.org
31 +Cc: maillist-linux@××××××××.de, torvalds@××××××××××××××××.org
32 +Subject: [PATCH 1/4] glibc specific inclusion of sysinfo.h in kernel.h
33 +Message-ID: <130a9e0c237bae10e631a5ae52c5e2c8@××××.cz>
34 +User-Agent: Roundcube Webmail/0.9.5
35 +Sender: linux-kernel-owner@×××××××××××.org
36 +List-ID: <linux-kernel.vger.kernel.org>
37 +X-Mailing-List: linux-kernel@×××××××××××.org
38 +
39 +including sysinfo.h from kernel.h makes no sense whatsoever,
40 +but removing it breaks glibc's userspace header,
41 +which includes kernel.h instead of sysinfo.h from their sys/sysinfo.h.
42 +this seems to be a historical mistake.
43 +on musl, including any header that uses kernel.h directly or indirectly
44 +plus sys/sysinfo.h will produce a compile error due to redefinition of
45 +struct sysinfo.h.
46 +so for now, only include it on glibc in order not to break their
47 +headers.
48 +
49 +Signed-off-by: John Spencer <maillist-linux@××××××××.de>
50 +Signed-off-by: David Heidelberger <david.heidelberger@××××.cz>
51 +---
52 + include/uapi/linux/kernel.h | 2 ++
53 + 1 file changed, 2 insertion(+)
54 +
55 + */
56 +
57 +diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h
58 +index 321e399..8c45eeb 100644
59 +--- a/include/uapi/linux/kernel.h
60 ++++ b/include/uapi/linux/kernel.h
61 +@@ -1,7 +1,9 @@
62 + #ifndef _UAPI_LINUX_KERNEL_H
63 + #define _UAPI_LINUX_KERNEL_H
64 +
65 ++#ifdef __GLIBC__
66 + #include <linux/sysinfo.h>
67 ++#endif
68 +
69 + /*
70 + * 'kernel.h' contains some often-used function prototypes etc