commit:     9140a9596d82701700e82bfee718161a2a93599f
Author:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
AuthorDate: Tue Jan 30 21:16:43 2018 +0000
Commit:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Tue Jan 30 21:16:43 2018 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=9140a959

sys-kernel/linux-headers: version bump to 4.15

 .../files/libc-4.15-portability.patch              | 165 +++++++++++++++++++++
 sys-kernel/linux-headers/linux-headers-4.15.ebuild |  58 ++++++++
 2 files changed, 223 insertions(+)

diff --git a/sys-kernel/linux-headers/files/libc-4.15-portability.patch 
b/sys-kernel/linux-headers/files/libc-4.15-portability.patch
new file mode 100644
index 0000000..09af412
--- /dev/null
+++ b/sys-kernel/linux-headers/files/libc-4.15-portability.patch
@@ -0,0 +1,165 @@
+diff -Naur gentoo-headers-base-4.15.orig/include/uapi/linux/kernel.h 
gentoo-headers-base-4.15/include/uapi/linux/kernel.h
+--- gentoo-headers-base-4.15.orig/include/uapi/linux/kernel.h  2018-01-29 
21:22:19.000000000 -0800
++++ gentoo-headers-base-4.15/include/uapi/linux/kernel.h       2018-01-30 
13:05:03.399378810 -0800
+@@ -2,7 +2,9 @@
+ #ifndef _UAPI_LINUX_KERNEL_H
+ #define _UAPI_LINUX_KERNEL_H
+ 
++#ifdef __GLIBC__
+ #include <linux/sysinfo.h>
++#endif
+ 
+ /*
+  * 'kernel.h' contains some often-used function prototypes etc
+diff -Naur gentoo-headers-base-4.15.orig/include/uapi/linux/libc-compat.h 
gentoo-headers-base-4.15/include/uapi/linux/libc-compat.h
+--- gentoo-headers-base-4.15.orig/include/uapi/linux/libc-compat.h     
2018-01-29 21:22:19.000000000 -0800
++++ gentoo-headers-base-4.15/include/uapi/linux/libc-compat.h  2018-01-30 
13:14:11.470368995 -0800
+@@ -49,47 +49,57 @@
+ #ifndef _UAPI_LIBC_COMPAT_H
+ #define _UAPI_LIBC_COMPAT_H
+ 
+-/* We have included glibc headers... */
+-#if defined(__GLIBC__)
++/* We're used from userspace... */
++#if !defined(__KERNEL__)
+ 
+-/* Coordinate with glibc net/if.h header. */
++/* Coordinate with libc net/if.h header. */
+ #if defined(_NET_IF_H) && defined(__USE_MISC)
+ 
+-/* GLIBC headers included first so don't define anything
++/* libc headers included first so don't define anything
+  * that would already be defined. */
+ 
+ #define __UAPI_DEF_IF_IFCONF 0
+ #define __UAPI_DEF_IF_IFMAP 0
+ #define __UAPI_DEF_IF_IFNAMSIZ 0
+ #define __UAPI_DEF_IF_IFREQ 0
+-/* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
+-/* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
++/* If libc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
++#if !defined(__GLIBC__)
++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
++#else
+ #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
+ #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
++#endif /* !defined(__GLIBC__) */
+ 
+ #else /* _NET_IF_H */
+ 
+ /* Linux headers included first, and we must define everything
+- * we need. The expectation is that glibc will check the
++ * we need. The expectation is that libc will check the
+  * __UAPI_DEF_* defines and adjust appropriately. */
+ 
+ #define __UAPI_DEF_IF_IFCONF 1
+ #define __UAPI_DEF_IF_IFMAP 1
+ #define __UAPI_DEF_IF_IFNAMSIZ 1
+ #define __UAPI_DEF_IF_IFREQ 1
+-/* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
+-/* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
++/* If libc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
+ 
+ #endif /* _NET_IF_H */
+ 
+-/* Coordinate with glibc netinet/in.h header. */
++/* Coordinate with libc netinet/if_ether.h */
++#ifdef _NETINET_IF_ETHER_H
++#define __UAPI_DEF_ETHHDR 0
++#else
++/* glibc uses __NETINET_IF_ETHER_H and uses the uapi header */
++#define __UAPI_DEF_ETHHDR 1
++#endif /* _NETINET_IF_ETHER_H */
++
++/* Coordinate with libc netinet/in.h header. */
+ #if defined(_NETINET_IN_H)
+ 
+-/* GLIBC headers included first so don't define anything
++/* libc headers included first so don't define anything
+  * that would already be defined. */
+ #define __UAPI_DEF_IN_ADDR            0
+ #define __UAPI_DEF_IN_IPPROTO         0
+@@ -99,15 +109,7 @@
+ #define __UAPI_DEF_IN_CLASS           0
+ 
+ #define __UAPI_DEF_IN6_ADDR           0
+-/* The exception is the in6_addr macros which must be defined
+- * if the glibc code didn't define them. This guard matches
+- * the guard in glibc/inet/netinet/in.h which defines the
+- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
+-#if defined(__USE_MISC) || defined (__USE_GNU)
+ #define __UAPI_DEF_IN6_ADDR_ALT               0
+-#else
+-#define __UAPI_DEF_IN6_ADDR_ALT               1
+-#endif
+ #define __UAPI_DEF_SOCKADDR_IN6               0
+ #define __UAPI_DEF_IPV6_MREQ          0
+ #define __UAPI_DEF_IPPROTO_V6         0
+@@ -118,7 +120,7 @@
+ #else
+ 
+ /* Linux headers included first, and we must define everything
+- * we need. The expectation is that glibc will check the
++ * we need. The expectation is that libc will check the
+  * __UAPI_DEF_* defines and adjust appropriately. */
+ #define __UAPI_DEF_IN_ADDR            1
+ #define __UAPI_DEF_IN_IPPROTO         1
+@@ -128,7 +130,7 @@
+ #define __UAPI_DEF_IN_CLASS           1
+ 
+ #define __UAPI_DEF_IN6_ADDR           1
+-/* We unconditionally define the in6_addr macros and glibc must
++/* We unconditionally define the in6_addr macros and libc must
+  * coordinate. */
+ #define __UAPI_DEF_IN6_ADDR_ALT               1
+ #define __UAPI_DEF_SOCKADDR_IN6               1
+@@ -170,7 +172,7 @@
+  * or we are being included in the kernel, then define everything
+  * that we need. Check for previous __UAPI_* definitions to give
+  * unsupported C libraries a way to opt out of any kernel definition. */
+-#else /* !defined(__GLIBC__) */
++#else /* defined(__KERNEL) */
+ 
+ /* Definitions for if.h */
+ #ifndef __UAPI_DEF_IF_IFCONF
+@@ -185,15 +187,20 @@
+ #ifndef __UAPI_DEF_IF_IFREQ
+ #define __UAPI_DEF_IF_IFREQ 1
+ #endif
+-/* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
+ #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
+ #endif
+-/* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
++/* If libc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
+ #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
+ #endif
+ 
++/* Definitions for if_ether.h */
++/* allow libcs like musl to deactivate this, glibc does not implement this. */
++#ifndef __UAPI_DEF_ETHHDR
++#define __UAPI_DEF_ETHHDR             1
++#endif
++
+ /* Definitions for in.h */
+ #ifndef __UAPI_DEF_IN_ADDR
+ #define __UAPI_DEF_IN_ADDR            1
+@@ -262,12 +269,6 @@
+ #define __UAPI_DEF_XATTR              1
+ #endif
+ 
+-#endif /* __GLIBC__ */
+-
+-/* Definitions for if_ether.h */
+-/* allow libcs like musl to deactivate this, glibc does not implement this. */
+-#ifndef __UAPI_DEF_ETHHDR
+-#define __UAPI_DEF_ETHHDR             1
+-#endif
++#endif /* defined(__KERNEL__) */
+ 
+ #endif /* _UAPI_LIBC_COMPAT_H */

diff --git a/sys-kernel/linux-headers/linux-headers-4.15.ebuild 
b/sys-kernel/linux-headers/linux-headers-4.15.ebuild
new file mode 100644
index 0000000..f230669
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-4.15.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 bfin cris frv hexagon hppa 
ia64 m32r m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 s390 
score sh sparc tile x86 xtensa"
+inherit kernel-2
+detect_version
+
+PATCH_VER="1"
+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz
+       ${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}"
+
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+
+DEPEND="app-arch/xz-utils
+       dev-lang/perl"
+RDEPEND="!!media-sound/alsa-headers"
+
+S=${WORKDIR}/gentoo-headers-base-${PV}
+
+src_unpack() {
+       unpack ${A}
+}
+
+src_prepare() {
+       default
+
+       [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/${PV}
+       epatch "${FILESDIR}"/libc-4.15-portability.patch
+}
+
+src_install() {
+       kernel-2_src_install
+
+       # hrm, build system sucks
+       find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+       find "${ED}" -depth -type d -delete 2>/dev/null
+}
+
+src_test() {
+       # Make sure no uapi/ include paths are used by accident.
+       egrep -r \
+               -e '# *include.*["<]uapi/' \
+               "${D}" && die "#include uapi/xxx detected"
+
+       einfo "Possible unescaped attribute/type usage"
+       egrep -r \
+               -e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
+               -e '\<([us](8|16|32|64))\>' \
+               .
+
+       einfo "Missing linux/types.h include"
+       egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L 
linux/types.h
+
+       emake ARCH=$(tc-arch-kernel) headers_check
+}

Reply via email to