Gentoo Archives: gentoo-commits

From: Aric Belsito <lluixhi@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: sys-kernel/linux-headers/files/, sys-kernel/linux-headers/
Date: Mon, 09 Apr 2018 00:55:55
Message-Id: 1523235315.45d38ea5b0262d41b331b74b530d7cac3d8275b7.lluixhi@gentoo
1 commit: 45d38ea5b0262d41b331b74b530d7cac3d8275b7
2 Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
3 AuthorDate: Mon Apr 9 00:55:15 2018 +0000
4 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
5 CommitDate: Mon Apr 9 00:55:15 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=45d38ea5
7
8 sys-kernel/linux-headers: new patch
9
10 .../files/libc-4.16-portability.patch | 159 +++++++++++++++++++++
11 sys-kernel/linux-headers/linux-headers-4.16.ebuild | 2 +-
12 2 files changed, 160 insertions(+), 1 deletion(-)
13
14 diff --git a/sys-kernel/linux-headers/files/libc-4.16-portability.patch b/sys-kernel/linux-headers/files/libc-4.16-portability.patch
15 new file mode 100644
16 index 0000000..9828411
17 --- /dev/null
18 +++ b/sys-kernel/linux-headers/files/libc-4.16-portability.patch
19 @@ -0,0 +1,159 @@
20 +diff -Naur gentoo-headers-base-4.16.orig/include/uapi/linux/kernel.h gentoo-headers-base-4.16/include/uapi/linux/kernel.h
21 +--- gentoo-headers-base-4.16.orig/include/uapi/linux/kernel.h 2018-04-04 23:45:32.000000000 -0700
22 ++++ gentoo-headers-base-4.16/include/uapi/linux/kernel.h 2018-04-08 17:51:18.477168271 -0700
23 +@@ -2,7 +2,9 @@
24 + #ifndef _UAPI_LINUX_KERNEL_H
25 + #define _UAPI_LINUX_KERNEL_H
26 +
27 ++#ifdef __GLIBC__
28 + #include <linux/sysinfo.h>
29 ++#endif
30 +
31 + /*
32 + * 'kernel.h' contains some often-used function prototypes etc
33 +diff -Naur gentoo-headers-base-4.16.orig/include/uapi/linux/libc-compat.h gentoo-headers-base-4.16/include/uapi/linux/libc-compat.h
34 +--- gentoo-headers-base-4.16.orig/include/uapi/linux/libc-compat.h 2018-04-04 23:45:32.000000000 -0700
35 ++++ gentoo-headers-base-4.16/include/uapi/linux/libc-compat.h 2018-04-08 17:53:43.004162639 -0700
36 +@@ -49,47 +49,57 @@
37 + #ifndef _UAPI_LIBC_COMPAT_H
38 + #define _UAPI_LIBC_COMPAT_H
39 +
40 +-/* We have included glibc headers... */
41 +-#if defined(__GLIBC__)
42 ++/* We're used from userspace... */
43 ++#if !defined(__KERNEL__)
44 +
45 +-/* Coordinate with glibc net/if.h header. */
46 ++/* Coordinate with libc net/if.h header. */
47 + #if defined(_NET_IF_H) && defined(__USE_MISC)
48 +
49 +-/* GLIBC headers included first so don't define anything
50 ++/* libc headers included first so don't define anything
51 + * that would already be defined. */
52 +
53 + #define __UAPI_DEF_IF_IFCONF 0
54 + #define __UAPI_DEF_IF_IFMAP 0
55 + #define __UAPI_DEF_IF_IFNAMSIZ 0
56 + #define __UAPI_DEF_IF_IFREQ 0
57 +-/* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
58 + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
59 +-/* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
60 ++/* If libc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
61 ++#if !defined(__GLIBC__)
62 ++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
63 ++#else
64 + #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
65 + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
66 + #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
67 ++#endif /* !defined(__GLIBC__) */
68 +
69 + #else /* _NET_IF_H */
70 +
71 + /* Linux headers included first, and we must define everything
72 +- * we need. The expectation is that glibc will check the
73 ++ * we need. The expectation is that libc will check the
74 + * __UAPI_DEF_* defines and adjust appropriately. */
75 +
76 + #define __UAPI_DEF_IF_IFCONF 1
77 + #define __UAPI_DEF_IF_IFMAP 1
78 + #define __UAPI_DEF_IF_IFNAMSIZ 1
79 + #define __UAPI_DEF_IF_IFREQ 1
80 +-/* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
81 + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
82 +-/* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
83 ++/* If libc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
84 + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
85 +
86 + #endif /* _NET_IF_H */
87 +
88 +-/* Coordinate with glibc netinet/in.h header. */
89 ++/* Coordinate with libc netinet/if_ether.h */
90 ++#ifdef _NETINET_IF_ETHER_H
91 ++#define __UAPI_DEF_ETHHDR 0
92 ++#else
93 ++/* glibc uses __NETINET_IF_ETHER_H and uses the uapi header */
94 ++#define __UAPI_DEF_ETHHDR 1
95 ++#endif /* _NETINET_IF_ETHER_H */
96 ++
97 ++/* Coordinate with libc netinet/in.h header. */
98 + #if defined(_NETINET_IN_H)
99 +
100 +-/* GLIBC headers included first so don't define anything
101 ++/* libc headers included first so don't define anything
102 + * that would already be defined. */
103 + #define __UAPI_DEF_IN_ADDR 0
104 + #define __UAPI_DEF_IN_IPPROTO 0
105 +@@ -99,15 +109,7 @@
106 + #define __UAPI_DEF_IN_CLASS 0
107 +
108 + #define __UAPI_DEF_IN6_ADDR 0
109 +-/* The exception is the in6_addr macros which must be defined
110 +- * if the glibc code didn't define them. This guard matches
111 +- * the guard in glibc/inet/netinet/in.h which defines the
112 +- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
113 +-#if defined(__USE_MISC) || defined (__USE_GNU)
114 + #define __UAPI_DEF_IN6_ADDR_ALT 0
115 +-#else
116 +-#define __UAPI_DEF_IN6_ADDR_ALT 1
117 +-#endif
118 + #define __UAPI_DEF_SOCKADDR_IN6 0
119 + #define __UAPI_DEF_IPV6_MREQ 0
120 + #define __UAPI_DEF_IPPROTO_V6 0
121 +@@ -118,7 +120,7 @@
122 + #else
123 +
124 + /* Linux headers included first, and we must define everything
125 +- * we need. The expectation is that glibc will check the
126 ++ * we need. The expectation is that libc will check the
127 + * __UAPI_DEF_* defines and adjust appropriately. */
128 + #define __UAPI_DEF_IN_ADDR 1
129 + #define __UAPI_DEF_IN_IPPROTO 1
130 +@@ -128,7 +130,7 @@
131 + #define __UAPI_DEF_IN_CLASS 1
132 +
133 + #define __UAPI_DEF_IN6_ADDR 1
134 +-/* We unconditionally define the in6_addr macros and glibc must
135 ++/* We unconditionally define the in6_addr macros and libc must
136 + * coordinate. */
137 + #define __UAPI_DEF_IN6_ADDR_ALT 1
138 + #define __UAPI_DEF_SOCKADDR_IN6 1
139 +@@ -170,7 +172,7 @@
140 + * or we are being included in the kernel, then define everything
141 + * that we need. Check for previous __UAPI_* definitions to give
142 + * unsupported C libraries a way to opt out of any kernel definition. */
143 +-#else /* !defined(__GLIBC__) */
144 ++#else /* defined(__KERNEL) */
145 +
146 + /* Definitions for if.h */
147 + #ifndef __UAPI_DEF_IF_IFCONF
148 +@@ -185,15 +187,20 @@
149 + #ifndef __UAPI_DEF_IF_IFREQ
150 + #define __UAPI_DEF_IF_IFREQ 1
151 + #endif
152 +-/* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
153 + #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS
154 + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
155 + #endif
156 +-/* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
157 ++/* If libc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
158 + #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
159 + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
160 + #endif
161 +
162 ++/* Definitions for if_ether.h */
163 ++/* allow libcs like musl to deactivate this, glibc does not implement this. */
164 ++#ifndef __UAPI_DEF_ETHHDR
165 ++#define __UAPI_DEF_ETHHDR 1
166 ++#endif
167 ++
168 + /* Definitions for in.h */
169 + #ifndef __UAPI_DEF_IN_ADDR
170 + #define __UAPI_DEF_IN_ADDR 1
171 +@@ -262,6 +269,6 @@
172 + #define __UAPI_DEF_XATTR 1
173 + #endif
174 +
175 +-#endif /* __GLIBC__ */
176 ++#endif /* defined(__KERNEL__) */
177 +
178 + #endif /* _UAPI_LIBC_COMPAT_H */
179
180 diff --git a/sys-kernel/linux-headers/linux-headers-4.16.ebuild b/sys-kernel/linux-headers/linux-headers-4.16.ebuild
181 index 409a4b5..e5cbef5 100644
182 --- a/sys-kernel/linux-headers/linux-headers-4.16.ebuild
183 +++ b/sys-kernel/linux-headers/linux-headers-4.16.ebuild
184 @@ -31,7 +31,7 @@ src_prepare() {
185 default
186
187 [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/${PV}
188 - epatch "${FILESDIR}"/libc-4.15-portability.patch
189 + epatch "${FILESDIR}"/libc-4.16-portability.patch
190 }
191
192 src_install() {