From: "Aric Belsito" <lluixhi@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/musl:master commit in: sys-kernel/linux-headers/files/, sys-kernel/linux-headers/
Date: Mon, 9 Apr 2018 00:55:50 +0000 (UTC) [thread overview]
Message-ID: <1523235315.45d38ea5b0262d41b331b74b530d7cac3d8275b7.lluixhi@gentoo> (raw)
commit: 45d38ea5b0262d41b331b74b530d7cac3d8275b7
Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
AuthorDate: Mon Apr 9 00:55:15 2018 +0000
Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Mon Apr 9 00:55:15 2018 +0000
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=45d38ea5
sys-kernel/linux-headers: new patch
.../files/libc-4.16-portability.patch | 159 +++++++++++++++++++++
| 2 +-
2 files changed, 160 insertions(+), 1 deletion(-)
diff --git a/sys-kernel/linux-headers/files/libc-4.16-portability.patch b/sys-kernel/linux-headers/files/libc-4.16-portability.patch
new file mode 100644
index 0000000..9828411
--- /dev/null
+++ b/sys-kernel/linux-headers/files/libc-4.16-portability.patch
@@ -0,0 +1,159 @@
+diff -Naur gentoo-headers-base-4.16.orig/include/uapi/linux/kernel.h gentoo-headers-base-4.16/include/uapi/linux/kernel.h
+--- gentoo-headers-base-4.16.orig/include/uapi/linux/kernel.h 2018-04-04 23:45:32.000000000 -0700
++++ gentoo-headers-base-4.16/include/uapi/linux/kernel.h 2018-04-08 17:51:18.477168271 -0700
+@@ -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.16.orig/include/uapi/linux/libc-compat.h gentoo-headers-base-4.16/include/uapi/linux/libc-compat.h
+--- gentoo-headers-base-4.16.orig/include/uapi/linux/libc-compat.h 2018-04-04 23:45:32.000000000 -0700
++++ gentoo-headers-base-4.16/include/uapi/linux/libc-compat.h 2018-04-08 17:53:43.004162639 -0700
+@@ -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,6 +269,6 @@
+ #define __UAPI_DEF_XATTR 1
+ #endif
+
+-#endif /* __GLIBC__ */
++#endif /* defined(__KERNEL__) */
+
+ #endif /* _UAPI_LIBC_COMPAT_H */
--git a/sys-kernel/linux-headers/linux-headers-4.16.ebuild b/sys-kernel/linux-headers/linux-headers-4.16.ebuild
index 409a4b5..e5cbef5 100644
--- a/sys-kernel/linux-headers/linux-headers-4.16.ebuild
+++ b/sys-kernel/linux-headers/linux-headers-4.16.ebuild
@@ -31,7 +31,7 @@ src_prepare() {
default
[[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/${PV}
- epatch "${FILESDIR}"/libc-4.15-portability.patch
+ epatch "${FILESDIR}"/libc-4.16-portability.patch
}
src_install() {
next reply other threads:[~2018-04-09 0:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-09 0:55 Aric Belsito [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-11-21 13:56 [gentoo-commits] proj/musl:master commit in: sys-kernel/linux-headers/files/, sys-kernel/linux-headers/ Sam James
2020-05-04 2:05 Jory Pratt
2019-07-11 18:03 Jory Pratt
2018-01-30 21:17 Aric Belsito
2016-11-12 1:07 Aric Belsito
2016-04-01 23:58 Anthony G. Basile
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1523235315.45d38ea5b0262d41b331b74b530d7cac3d8275b7.lluixhi@gentoo \
--to=lluixhi@gmail.com \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox