aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/pending-4.14
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2017-06-03 12:59:55 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2018-01-20 22:11:33 +0100
commit4336efe14b61e47177a2d0863f8391c48cf4a9f5 (patch)
tree0135be3408bc34b45dba4bde3679e28bbfceee41 /target/linux/generic/pending-4.14
parente3c43ade0bae9491aeea50fa361e846bb5002dc0 (diff)
downloadupstream-4336efe14b61e47177a2d0863f8391c48cf4a9f5.tar.gz
upstream-4336efe14b61e47177a2d0863f8391c48cf4a9f5.tar.bz2
upstream-4336efe14b61e47177a2d0863f8391c48cf4a9f5.zip
kernel: use upstream patches for musl
This replaces the current patches used to make the kernel headers compatible with musl with the version which was accepted upstream. This is included in upstream kernel 4.15. This was compile tested with iproute2 build on all supported kernel versions with musl and one one with glibc. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'target/linux/generic/pending-4.14')
-rw-r--r--target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch32
-rw-r--r--target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch105
-rw-r--r--target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch65
3 files changed, 0 insertions, 202 deletions
diff --git a/target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch b/target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
deleted file mode 100644
index 9ec8daf886..0000000000
--- a/target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: David Heidelberger <david.heidelberger@ixit.cz>
-Subject: uapi/kernel.h: glibc specific inclusion of sysinfo.h
-
-including sysinfo.h from kernel.h makes no sense whatsoever,
-but removing it breaks glibc's userspace header,
-which includes kernel.h instead of sysinfo.h from their sys/sysinfo.h.
-this seems to be a historical mistake.
-on musl, including any header that uses kernel.h directly or indirectly
-plus sys/sysinfo.h will produce a compile error due to redefinition of
-struct sysinfo from sys/sysinfo.h.
-so for now, only include it on glibc or when including from kernel
-in order not to break their headers.
-
-Signed-off-by: John Spencer <maillist-linux@barfooze.de>
-Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
-Signed-off-by: Jonas Gorski <jogo@openwrt.org>
----
- include/uapi/linux/kernel.h | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/include/uapi/linux/kernel.h
-+++ b/include/uapi/linux/kernel.h
-@@ -2,7 +2,9 @@
- #ifndef _UAPI_LINUX_KERNEL_H
- #define _UAPI_LINUX_KERNEL_H
-
-+#if defined(__KERNEL__) || defined( __GLIBC__)
- #include <linux/sysinfo.h>
-+#endif
-
- /*
- * 'kernel.h' contains some often-used function prototypes etc
diff --git a/target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch b/target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
deleted file mode 100644
index 9ae148da4f..0000000000
--- a/target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From: David Heidelberger <david.heidelberger@ixit.cz>
-Subject: uapi/libc-compat.h: do not rely on __GLIBC__
-
-Musl provides the same structs as glibc, but does not provide a define to
-allow its detection. Since the absence of __GLIBC__ also can mean that it
-is included from the kernel, change the __GLIBC__ detection to
-!__KERNEL__, which should always be true when included from userspace.
-
-Signed-off-by: John Spencer <maillist-linux@barfooze.de>
-Tested-by: David Heidelberger <david.heidelberger@ixit.cz>
-Signed-off-by: Jonas Gorski <jogo@openwrt.org>
----
- include/uapi/linux/libc-compat.h | 18 +++++++++---------
- 1 file changed, 9 insertions(+), 9 deletions(-)
-
---- a/include/uapi/linux/libc-compat.h
-+++ b/include/uapi/linux/libc-compat.h
-@@ -49,13 +49,13 @@
- #ifndef _UAPI_LIBC_COMPAT_H
- #define _UAPI_LIBC_COMPAT_H
-
--/* We have included glibc headers... */
--#if defined(__GLIBC__)
-+/* We have included libc headers... */
-+#if !defined(__KERNEL__)
-
--/* Coordinate with glibc net/if.h header. */
--#if defined(_NET_IF_H) && defined(__USE_MISC)
-+/* Coordinate with libc net/if.h header. */
-+#if defined(_NET_IF_H) && (!defined(__GLIBC__) || 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
-@@ -66,7 +66,11 @@
- #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
- /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
- #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
-+#ifdef __GLIBC__
- #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
-+#else
-+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
-+#endif
- #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
-
- #else /* _NET_IF_H */
-@@ -86,10 +90,10 @@
-
- #endif /* _NET_IF_H */
-
--/* Coordinate with glibc netinet/in.h header. */
-+/* 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
-@@ -103,7 +107,7 @@
- * 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)
-+#if !defined(__GLIBC__) || defined(__USE_MISC) || defined (__USE_GNU)
- #define __UAPI_DEF_IN6_ADDR_ALT 0
- #else
- #define __UAPI_DEF_IN6_ADDR_ALT 1
-@@ -118,7 +122,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 the libc will check the
- * __UAPI_DEF_* defines and adjust appropriately. */
- #define __UAPI_DEF_IN_ADDR 1
- #define __UAPI_DEF_IN_IPPROTO 1
-@@ -128,7 +132,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 the libc must
- * coordinate. */
- #define __UAPI_DEF_IN6_ADDR_ALT 1
- #define __UAPI_DEF_SOCKADDR_IN6 1
-@@ -169,7 +173,7 @@
- /* If we did not see any headers from any supported C libraries,
- * or we are being included in the kernel, then define everything
- * that we need. */
--#else /* !defined(__GLIBC__) */
-+#else /* defined(__KERNEL__) */
-
- /* Definitions for if.h */
- #define __UAPI_DEF_IF_IFCONF 1
-@@ -209,6 +213,6 @@
- /* Definitions for xattr.h */
- #define __UAPI_DEF_XATTR 1
-
--#endif /* __GLIBC__ */
-+#endif /* __KERNEL__ */
-
- #endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
deleted file mode 100644
index 1dca07328d..0000000000
--- a/target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From: David Heidelberger <david.heidelberger@ixit.cz>
-Subject: uapi/if_ether.h: prevent redefinition of struct ethhdr
-
-Musl provides its own ethhdr struct definition. Add a guard to prevent
-its definition of the appropriate musl header has already been included.
-
-Signed-off-by: John Spencer <maillist-linux@barfooze.de>
-Tested-by: David Heidelberger <david.heidelberger@ixit.cz>
-Signed-off-by: Jonas Gorski <jogo@openwrt.org>
----
- include/uapi/linux/if_ether.h | 3 +++
- include/uapi/linux/libc-compat.h | 11 +++++++++++
- 2 files changed, 14 insertions(+)
-
---- a/include/uapi/linux/if_ether.h
-+++ b/include/uapi/linux/if_ether.h
-@@ -23,6 +23,7 @@
- #define _UAPI_LINUX_IF_ETHER_H
-
- #include <linux/types.h>
-+#include <linux/libc-compat.h>
-
- /*
- * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
-@@ -149,11 +150,13 @@
- * This is an Ethernet frame header.
- */
-
-+#if __UAPI_DEF_ETHHDR
- struct ethhdr {
- unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
- unsigned char h_source[ETH_ALEN]; /* source ether addr */
- __be16 h_proto; /* packet type ID field */
- } __attribute__((packed));
-+#endif
-
-
- #endif /* _UAPI_LINUX_IF_ETHER_H */
---- a/include/uapi/linux/libc-compat.h
-+++ b/include/uapi/linux/libc-compat.h
-@@ -90,6 +90,14 @@
-
- #endif /* _NET_IF_H */
-
-+/* musl defines the ethhdr struct itself in its netinet/if_ether.h.
-+ * Glibc just includes the kernel header and uses a different guard. */
-+#if defined(_NETINET_IF_ETHER_H)
-+#define __UAPI_DEF_ETHHDR 0
-+#else
-+#define __UAPI_DEF_ETHHDR 1
-+#endif
-+
- /* Coordinate with libc netinet/in.h header. */
- #if defined(_NETINET_IN_H)
-
-@@ -185,6 +193,9 @@
- /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
- #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
-
-+/* Definitions for if_ether.h */
-+#define __UAPI_DEF_ETHHDR 1
-+
- /* Definitions for in.h */
- #define __UAPI_DEF_IN_ADDR 1
- #define __UAPI_DEF_IN_IPPROTO 1