From 4336efe14b61e47177a2d0863f8391c48cf4a9f5 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 3 Jun 2017 12:59:55 +0200 Subject: 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 --- toolchain/musl/common.mk | 2 +- ...suppress-some-more-Linux-uapi-definitions.patch | 59 ++++++++++++++++++++++ ...t-attribute-to-some-function-declarations.patch | 12 ++--- 3 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 toolchain/musl/patches/010-kernel-suppress-some-more-Linux-uapi-definitions.patch (limited to 'toolchain') diff --git a/toolchain/musl/common.mk b/toolchain/musl/common.mk index a94a475571..8350197a9f 100644 --- a/toolchain/musl/common.mk +++ b/toolchain/musl/common.mk @@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/target.mk PKG_NAME:=musl PKG_VERSION:=1.1.18 -PKG_RELEASE=1 +PKG_RELEASE=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) diff --git a/toolchain/musl/patches/010-kernel-suppress-some-more-Linux-uapi-definitions.patch b/toolchain/musl/patches/010-kernel-suppress-some-more-Linux-uapi-definitions.patch new file mode 100644 index 0000000000..78b487faeb --- /dev/null +++ b/toolchain/musl/patches/010-kernel-suppress-some-more-Linux-uapi-definitions.patch @@ -0,0 +1,59 @@ +From 8e85d2c268000b51cc690f3a55a820d8f8a6c0bc Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Thu, 22 Jun 2017 22:04:28 +0200 +Subject: [PATCH] Add additional uapi guards for Linux kernel header files + +With Linux kernel 4.15 it will be possible to guard more parts of the +Linux header files from a libc. Make use of this in musl to guard all +the structures and other definitions from the Linux header files which +are also defined by the header files provided by musl. This will make +musl compile with the unmodified Linux kernel user space headers. + +This extends the definitions done in commit 04983f227238 ("make +netinet/in.h suppress clashing definitions from kernel headers") + +The needed patches were recently accepted for Linux 4.15: +https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c0bace798436bca0fdc221ff61143f1376a9c3de +https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6926e041a8920c8ec27e4e155efa760aa01551fd +--- + include/net/if.h | 7 +++++++ + include/netinet/if_ether.h | 1 + + include/sys/xattr.h | 2 ++ + 3 files changed, 10 insertions(+) + +--- a/include/net/if.h ++++ b/include/net/if.h +@@ -125,6 +125,13 @@ struct ifconf { + #define ifc_req ifc_ifcu.ifcu_req + #define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0) + ++#define __UAPI_DEF_IF_IFCONF 0 ++#define __UAPI_DEF_IF_IFMAP 0 ++#define __UAPI_DEF_IF_IFNAMSIZ 0 ++#define __UAPI_DEF_IF_IFREQ 0 ++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0 ++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 ++ + #endif + + #ifdef __cplusplus +--- a/include/netinet/if_ether.h ++++ b/include/netinet/if_ether.h +@@ -133,5 +133,6 @@ do { \ + (enaddr)[5] = ((uint8_t *)ipaddr)[3]; \ + } while(0) + ++#define __UAPI_DEF_ETHHDR 0 + + #endif +--- a/include/sys/xattr.h ++++ b/include/sys/xattr.h +@@ -24,6 +24,8 @@ int removexattr(const char *, const char + int lremovexattr(const char *, const char *); + int fremovexattr(int, const char *); + ++#define __UAPI_DEF_XATTR 0 ++ + #ifdef __cplusplus + } + #endif diff --git a/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch b/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch index c495d67e08..67fedae30a 100644 --- a/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch +++ b/toolchain/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch @@ -45,11 +45,7 @@ Signed-off-by: Hauke Mehrtens +#else +#define __fp(x, y) +#endif - --_Noreturn void err(int, const char *, ...); --_Noreturn void verr(int, const char *, va_list); --_Noreturn void errx(int, const char *, ...); --_Noreturn void verrx(int, const char *, va_list); ++ +void warn(const char *, ...) __fp(1, 2); +void vwarn(const char *, va_list) __fp(1, 0); +void warnx(const char *, ...) __fp(1, 2); @@ -59,7 +55,11 @@ Signed-off-by: Hauke Mehrtens +_Noreturn void verr(int, const char *, va_list) __fp(2, 0); +_Noreturn void errx(int, const char *, ...) __fp(2, 3); +_Noreturn void verrx(int, const char *, va_list) __fp(2, 0); -+ + +-_Noreturn void err(int, const char *, ...); +-_Noreturn void verr(int, const char *, va_list); +-_Noreturn void errx(int, const char *, ...); +-_Noreturn void verrx(int, const char *, va_list); +#undef __fp #ifdef __cplusplus -- cgit v1.2.3