diff --git a/srcpkgs/kernel-libc-headers/patches/1-4-glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch b/srcpkgs/kernel-libc-headers/patches/1-4-glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch new file mode 100644 index 0000000000..0b4cfb1220 --- /dev/null +++ b/srcpkgs/kernel-libc-headers/patches/1-4-glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch @@ -0,0 +1,12 @@ +--- ./include/uapi/linux/kernel.h.orig ++++ ./include/uapi/linux/kernel.h +@@ -1,7 +1,9 @@ + #ifndef _UAPI_LINUX_KERNEL_H + #define _UAPI_LINUX_KERNEL_H + ++#ifdef __GLIBC__ + #include ++#endif + + /* + * 'kernel.h' contains some often-used function prototypes etc diff --git a/srcpkgs/kernel-libc-headers/patches/3-4-libc-compat.h-fix-some-issues-arising-from-in6.h.patch b/srcpkgs/kernel-libc-headers/patches/3-4-libc-compat.h-fix-some-issues-arising-from-in6.h.patch new file mode 100644 index 0000000000..ceff65e400 --- /dev/null +++ b/srcpkgs/kernel-libc-headers/patches/3-4-libc-compat.h-fix-some-issues-arising-from-in6.h.patch @@ -0,0 +1,60 @@ +--- include/uapi/linux/libc-compat.h.orig 2015-05-31 15:43:30.635620792 +0200 ++++ include/uapi/linux/libc-compat.h 2015-05-31 15:48:08.787163241 +0200 +@@ -48,30 +48,27 @@ + #ifndef _UAPI_LIBC_COMPAT_H + #define _UAPI_LIBC_COMPAT_H + +-/* We have included glibc headers... */ +-#if defined(__GLIBC__) ++#ifndef __KERNEL__ /* we're used from userspace */ + +-/* Coordinate with glibc netinet/in.h header. */ +-#if defined(_NETINET_IN_H) ++#ifdef _NETINET_IF_ETHER_H /* musl */ ++#define __UAPI_DEF_ETHHDR 0 ++#else /* glibc uses __NETINET_IF_ETHER_H, and includes the kernel header. */ ++#define __UAPI_DEF_ETHHDR 1 ++#endif ++ ++/* Coordinate with libc netinet/in.h header. */ ++#ifdef _NETINET_IN_H + + /* GLIBC headers included first so don't define anything + * that would already be defined. */ + #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 + #define __UAPI_DEF_IPV6_OPTIONS 0 + +-#else ++#else /* defined(_NETINET_IN_H) */ + + /* Linux headers included first, and we must define everything + * we need. The expectation is that glibc will check the +@@ -97,7 +94,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 /* __KERNEL__ */ + + /* Definitions for in6.h */ + #define __UAPI_DEF_IN6_ADDR 1 +@@ -110,6 +107,6 @@ + /* Definitions for xattr.h */ + #define __UAPI_DEF_XATTR 1 + +-#endif /* __GLIBC__ */ ++#endif /* __KERNEL__ */ + + #endif /* _UAPI_LIBC_COMPAT_H */ diff --git a/srcpkgs/kernel-libc-headers/patches/4-4-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch b/srcpkgs/kernel-libc-headers/patches/4-4-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch new file mode 100644 index 0000000000..5c85e8143c --- /dev/null +++ b/srcpkgs/kernel-libc-headers/patches/4-4-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch @@ -0,0 +1,24 @@ +--- include/uapi/linux/if_ether.h.orig 2015-05-31 15:46:25.659328508 +0200 ++++ include/uapi/linux/if_ether.h 2015-05-31 15:47:19.843238460 +0200 +@@ -22,6 +22,7 @@ + #define _UAPI_LINUX_IF_ETHER_H + + #include ++#include + + /* + * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble +@@ -134,11 +135,12 @@ + * 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 */ diff --git a/srcpkgs/kernel-libc-headers/template b/srcpkgs/kernel-libc-headers/template index 9d786e2dc0..1fea70c45e 100644 --- a/srcpkgs/kernel-libc-headers/template +++ b/srcpkgs/kernel-libc-headers/template @@ -2,7 +2,7 @@ # pkgname=kernel-libc-headers version=3.18.6 -revision=1 +revision=2 bootstrap=yes nostrip=yes noverifyrdeps=yes