kernel-libc-headers: update to 5.10.4.

This commit is contained in:
Leah Neukirchen 2021-01-05 19:45:58 +01:00 committed by Érico Nogueira Rolim
parent f2ca55ee5a
commit cc78fb411c
5 changed files with 27 additions and 267 deletions

View file

@ -1,117 +0,0 @@
Source: yopito
Upstream: No
Reason: musl compatibility
--- include/uapi/linux/libc-compat.h 2018-11-01 21:44:22.016378667 +0100
+++ include/uapi/linux/libc-compat.h 2018-11-01 21:54:14.382052324 +0100
@@ -170,11 +170,102 @@
#define __UAPI_DEF_XATTR 1
#endif
+/*
+ * Support of guessed LIBC musl, since neither glibc nor kernel space.
+ * Written for musl libc 1.1.16. Mimics the glibc support above.
+ */
+#elif !defined(__KERNEL__) /* and not __GLIBC__ */
+
+/* Coordinate with musl libc net/if.h header. */
+#if defined(_NET_IF_H)
+
+/* 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 */
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
+
+/* musl libc defines IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
+
+#else /* _NET_IF_H */
+
+/* Linux headers included first, and we must define everything
+ * we need. Will define the corresponding structures twice
+ * if net/if.h is included later ? */
+
+#define __UAPI_DEF_IF_IFCONF 1
+#define __UAPI_DEF_IF_IFMAP 1
+#define __UAPI_DEF_IF_IFNAMSIZ 1
+#define __UAPI_DEF_IF_IFREQ 1
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
+
+#endif /* _NET_IF_H */
+
+/* Coordinate with musl libc netinet/in.h header. */
+#if defined(_NETINET_IN_H)
+
+/* musl 1.1.16 LIBC netinet/in.h defines the following (to 0),
+ * so it's useless to set them again:
+ * __UAPI_DEF_IN_ADDR __UAPI_DEF_IN_IPPROTO
+ * __UAPI_DEF_IN_PKTINFO __UAPI_DEF_IP_MREQ
+ * __UAPI_DEF_SOCKADDR_IN __UAPI_DEF_IN_CLASS
+ * __UAPI_DEF_IN6_ADDR __UAPI_DEF_IN6_ADDR_ALT
+ * __UAPI_DEF_SOCKADDR_IN6 __UAPI_DEF_IPV6_MREQ
+ * __UAPI_DEF_IPPROTO_V6 __UAPI_DEF_IPV6_OPTIONS
+ * __UAPI_DEF_IN6_PKTINFO __UAPI_DEF_IP6_MTUINFO
+ */
+
+#else /* _NETINET_IN_H */
+
+/* Linux headers included first, and we must define everything
+ * we need. Will define the corresponding structures twice
+ * if netinet/in.h is included later ? */
+
+#define __UAPI_DEF_IN_ADDR 1
+#define __UAPI_DEF_IN_IPPROTO 1
+#define __UAPI_DEF_IN_PKTINFO 1
+#define __UAPI_DEF_IP_MREQ 1
+#define __UAPI_DEF_SOCKADDR_IN 1
+#define __UAPI_DEF_IN_CLASS 1
+
+#define __UAPI_DEF_IN6_ADDR 1
+#define __UAPI_DEF_IN6_ADDR_ALT 1
+#define __UAPI_DEF_SOCKADDR_IN6 1
+#define __UAPI_DEF_IPV6_MREQ 1
+#define __UAPI_DEF_IPPROTO_V6 1
+#define __UAPI_DEF_IPV6_OPTIONS 1
+#define __UAPI_DEF_IN6_PKTINFO 1
+#define __UAPI_DEF_IP6_MTUINFO 1
+
+#endif /* _NETINET_IN_H */
+
+/* musl libc does not provide IPX support */
+#define __UAPI_DEF_SOCKADDR_IPX 1
+#define __UAPI_DEF_IPX_ROUTE_DEFINITION 1
+#define __UAPI_DEF_IPX_INTERFACE_DEFINITION 1
+#define __UAPI_DEF_IPX_CONFIG_DATA 1
+#define __UAPI_DEF_IPX_ROUTE_DEF 1
+
+/* Definitions for sys/xattr.h */
+#if defined(_SYS_XATTR_H)
+#define __UAPI_DEF_XATTR 0
+#else
+#define __UAPI_DEF_XATTR 1
+#endif
+
+
/* 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. 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
@@ -266,6 +357,6 @@
#define __UAPI_DEF_XATTR 1
#endif
-#endif /* __GLIBC__ */
+#endif /* __KERNEL__ or __GLIBC__ or libc */
#endif /* _UAPI_LIBC_COMPAT_H */

View file

@ -1,109 +0,0 @@
diff -u -r linux-4.9.8-bak/include/uapi/linux/if_arp.h linux-4.9.8/include/uapi/linux/if_arp.h
--- include/uapi/linux/if_arp.h 2018-05-14 23:49:28.882768986 +0200
+++ include/uapi/linux/if_arp.h 2018-05-14 23:50:03.156912981 +0200
@@ -24,6 +24,7 @@
#define _UAPI_LINUX_IF_ARP_H
#include <linux/netdevice.h>
+#include <linux/libc-compat.h>
/* ARP protocol HARDWARE identifiers. */
#define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */
@@ -108,7 +109,7 @@
#define ARPOP_InREPLY 9 /* InARP reply */
#define ARPOP_NAK 10 /* (ATM)ARP NAK */
-
+#if __UAPI_DEF_ARPREQ
/* ARP ioctl request. */
struct arpreq {
struct sockaddr arp_pa; /* protocol address */
@@ -117,13 +118,15 @@
struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
char arp_dev[16];
};
-
+#endif
+#if __UAPI_DEF_ARPREQ_OLD
struct arpreq_old {
struct sockaddr arp_pa; /* protocol address */
struct sockaddr arp_ha; /* hardware address */
int arp_flags; /* flags */
struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
};
+#endif
/* ARP Flag values. */
#define ATF_COM 0x02 /* completed entry (ha valid) */
@@ -133,7 +136,7 @@
#define ATF_NETMASK 0x20 /* want to use a netmask (only
for proxy entries) */
#define ATF_DONTPUB 0x40 /* don't answer this addresses */
-
+#if __UAPI_DEF_ARPHDR
/*
* This structure defines an ethernet arp header.
*/
@@ -156,6 +159,6 @@
#endif
};
-
+#endif
#endif /* _UAPI_LINUX_IF_ARP_H */
diff -u -r linux-4.9.8-bak/include/uapi/linux/libc-compat.h linux-4.9.8/include/uapi/linux/libc-compat.h
--- include/uapi/linux/libc-compat.h 2018-05-14 23:49:28.885768999 +0200
+++ include/uapi/linux/libc-compat.h 2018-05-14 23:50:03.156912981 +0200
@@ -51,6 +51,11 @@
/* We have included glibc headers... */
#if defined(__GLIBC__)
+#define __UAPI_DEF_ETHHDR 1
+#define __UAPI_DEF_ARPREQ 1
+#define __UAPI_DEF_ARPREQ_OLD 1
+#define __UAPI_DEF_ARPHDR 1
+
/* Coordinate with glibc net/if.h header. */
#if defined(_NET_IF_H) && defined(__USE_MISC)
@@ -73,7 +78,6 @@
/* Linux headers included first, and we must define everything
* we need. The expectation is that glibc 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
@@ -256,6 +260,21 @@
#define __UAPI_DEF_XATTR 1
#endif
+#ifdef _NETINET_IF_ETHER_H /* musl */
+#define __UAPI_DEF_ETHHDR 0
+#else
+#define __UAPI_DEF_ETHHDR 1
+#endif
+
+#ifdef _NET_IF_ARP_H
+#define __UAPI_DEF_ARPREQ 0
+#define __UAPI_DEF_ARPREQ_OLD 0
+#define __UAPI_DEF_ARPHDR 0
+#else
+#define __UAPI_DEF_ARPREQ 1
+#define __UAPI_DEF_ARPREQ_OLD 1
+#define __UAPI_DEF_ARPHDR 1
+#endif
/* If we did not see any headers from any supported C libraries,
* or we are being included in the kernel, then define everything
--- include/uapi/linux/if_ether.h 2018-11-01 21:25:05.338466089 +0100
+++ include/uapi/linux/if_ether.h 2018-11-01 21:26:07.819172903 +0100
@@ -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

View file

@ -1,28 +0,0 @@
Work around redefinition of sigcontext in libc headers
Introduced with:
https://github.com/torvalds/linux/commit/43d4da2c45b2f5d62f8a79ff7c6f95089bb24656
diff --git a/arch/arm64/include/uapi/asm/ptrace.h b/arch/arm64/include/uapi/asm/ptrace.h
index 98c4ce5..c44efed 100644
--- arch/arm64/include/uapi/asm/ptrace.h
+++ arch/arm64/include/uapi/asm/ptrace.h
@@ -23,8 +23,6 @@
#include <linux/types.h>
#include <asm/hwcap.h>
-#include <asm/sigcontext.h>
-
/*
* PSR bits
@@ -64,8 +62,6 @@
#ifndef __ASSEMBLY__
-#include <linux/prctl.h>
-
/*
* User structures for general purpose, floating point and debug registers.
*/

View file

@ -0,0 +1,14 @@
Reverts 1fe8e0f074c77aa41aaa579345a9e675acbebfa9
--- include/uapi/linux/if_tunnel.h
+++ include/uapi/linux/if_tunnel.h
@@ -2,9 +2,6 @@
#define _UAPI_IF_TUNNEL_H_
#include <linux/types.h>
-#include <linux/if.h>
-#include <linux/ip.h>
-#include <linux/in6.h>
#include <asm/byteorder.h>

View file

@ -1,17 +1,15 @@
# Template file for 'kernel-libc-headers'
pkgname=kernel-libc-headers
version=4.19.0
revision=2
version=5.10.4
revision=1
bootstrap=yes
nostrip=yes
noverifyrdeps=yes
noshlibprovides=yes
wrksrc=linux-${version%.*}
short_desc="The Linux API headers for userland development"
wrksrc=linux-${version}
short_desc="Linux API headers for userland development"
maintainer="Érico Nogueira <ericonr@disroot.org>"
license="GPL-2.0-only"
homepage="http://www.kernel.org"
distfiles="$KERNEL_SITE/kernel/v4.x/linux-${version%.*}.tar.xz"
checksum=0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
distfiles="$KERNEL_SITE/kernel/v${version%%.*}.x/linux-${version}.tar.xz"
checksum=904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
if [ "$CHROOT_READY" ]; then
hostmakedepends="perl"
@ -28,12 +26,14 @@ esac
do_build() {
make mrproper
make ARCH=${_arch} headers_check
make ARCH=${_arch} headers
}
do_install() {
make ARCH=${_arch} INSTALL_HDR_PATH=${DESTDIR}/usr headers_install
# Remove unused files.
rm -f $(find ${DESTDIR}/usr/include -name .install -or -name ..install.cmd)
find usr/include -name '.*' -delete
rm usr/include/Makefile
vmkdir usr/include
vcopy usr/include usr
# Remove drm headers, use libdrm.
rm -rf ${DESTDIR}/usr/include/drm
}