summaryrefslogtreecommitdiff
path: root/meta/recipes-kernel/linux-libc-headers
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/linux-libc-headers')
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc57
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch90
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-ptrace.h-remove-ptrace_peeksiginfo_args.patch50
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch56
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch29
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers/connector-msg-size-fix.patch29
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers/scripts-Makefile.headersinst-install-headers-from-sc.patch46
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers_3.10.bb8
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.10.bb10
9 files changed, 237 insertions, 138 deletions
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
index 96fe2ffd62..1657df6e92 100644
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
@@ -1,23 +1,58 @@
-DESCRIPTION = "Sanitized set of kernel headers for the C library's use."
+SUMMARY = "Sanitized set of kernel headers for the C library's use"
SECTION = "devel"
LICENSE = "GPLv2"
+#########################################################################
+#### PLEASE READ
+#########################################################################
+#
+# You're probably looking here thinking you need to create some new copy
+# of linux-libc-headers since you have your own custom kernel. To put
+# this simply, you DO NOT.
+#
+# Why? These headers are used to build the libc. If you customise the
+# headers you are customising the libc and the libc becomes machine
+# specific. Most people do not add custom libc extensions to the kernel
+# and have a machine specific libc.
+#
+# But you have some kernel headers you need for some driver? That is fine
+# but get them from STAGING_KERNEL_DIR where the kernel installs itself.
+# This will make the package using them machine specific but this is much
+# better than having a machine specific C library. This does mean your
+# recipe needs a
+# do_configure[depends] += "virtual/kernel:do_shared_workdir"
+# but again, that is fine and makes total sense.
+#
+# There can also be a case where your kernel extremely old and you want
+# an older libc ABI for that old kernel. The headers installed by this
+# recipe should still be a standard mainline kernel, not your own custom
+# one.
+#
+# -- RP
+
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
python __anonymous () {
- major = d.getVar("PV",True).split('.')[0]
+ major = d.getVar("PV").split('.')[0]
if major == "3":
d.setVar("HEADER_FETCH_VER", "3.0")
+ elif major == "4":
+ d.setVar("HEADER_FETCH_VER", "4.x")
else:
d.setVar("HEADER_FETCH_VER", "2.6")
}
-inherit kernel-arch
+inherit kernel-arch pkgconfig multilib_header
+
+KORG_ARCHIVE_COMPRESSION ?= "xz"
-SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v${HEADER_FETCH_VER}/linux-${PV}.tar.bz2"
+SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v${HEADER_FETCH_VER}/linux-${PV}.tar.${KORG_ARCHIVE_COMPRESSION}"
+UPSTREAM_CHECK_URI = "https://www.kernel.org/"
S = "${WORKDIR}/linux-${PV}"
+EXTRA_OEMAKE = " HOSTCC="${BUILD_CC}" HOSTCPP="${BUILD_CPP}""
+
do_configure() {
oe_runmake allnoconfig
}
@@ -34,9 +69,21 @@ do_install() {
find ${D}${includedir} -name ..install.cmd | xargs rm -f
}
+do_install_append_aarch64 () {
+ do_install_armmultilib
+}
+
+do_install_append_arm () {
+ do_install_armmultilib
+}
+
+do_install_armmultilib () {
+ oe_multilib_header asm/auxvec.h asm/bitsperlong.h asm/byteorder.h asm/fcntl.h asm/hwcap.h asm/ioctls.h asm/kvm.h asm/mman.h asm/param.h asm/perf_regs.h
+ oe_multilib_header asm/posix_types.h asm/ptrace.h asm/setup.h asm/sigcontext.h asm/siginfo.h asm/signal.h asm/stat.h asm/statfs.h asm/swab.h asm/types.h asm/unistd.h
+}
+
BBCLASSEXTEND = "nativesdk"
-#DEPENDS = "cross-linkage"
RDEPENDS_${PN}-dev = ""
RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch
new file mode 100644
index 0000000000..8bb775ccf7
--- /dev/null
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch
@@ -0,0 +1,90 @@
+From 2872f5d8bcef84e62b15b37ba4ffeccfb6402dad Mon Sep 17 00:00:00 2001
+From: rofl0r <retnyg@gmx.net>
+Date: Wed, 22 Jan 2014 00:48:28 +0100
+Subject: [PATCH 1/3] libc-compat.h: fix some issues arising from in6.h
+
+namely redefinition of some structs provided by netinet/in.h.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Submitted
+
+ include/uapi/linux/libc-compat.h | 25 ++++++++-----------------
+ 1 file changed, 8 insertions(+), 17 deletions(-)
+
+Index: linux-4.8-rc4/include/uapi/linux/libc-compat.h
+===================================================================
+--- linux-4.8-rc4.orig/include/uapi/linux/libc-compat.h
++++ linux-4.8-rc4/include/uapi/linux/libc-compat.h
+@@ -48,13 +48,12 @@
+ #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 net/if.h header. */
+-#if defined(_NET_IF_H) && defined(__USE_MISC)
++/* Coordinate with libc net/if.h header. */
++#if defined(_NET_IF_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_IF_IFCONF 0
+@@ -98,15 +97,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
+@@ -114,10 +105,10 @@
+ #define __UAPI_DEF_IN6_PKTINFO 0
+ #define __UAPI_DEF_IP6_MTUINFO 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
++ * 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
+@@ -127,7 +118,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
+@@ -149,7 +140,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 if.h */
+ #define __UAPI_DEF_IF_IFCONF 1
+@@ -182,6 +173,6 @@
+ /* Definitions for xattr.h */
+ #define __UAPI_DEF_XATTR 1
+
+-#endif /* __GLIBC__ */
++#endif /* __KERNEL__ */
+
+ #endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-ptrace.h-remove-ptrace_peeksiginfo_args.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-ptrace.h-remove-ptrace_peeksiginfo_args.patch
deleted file mode 100644
index da2e117a48..0000000000
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-ptrace.h-remove-ptrace_peeksiginfo_args.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 7dddfb8fec5317ea16154d30e8e18b6559979b60 Mon Sep 17 00:00:00 2001
-From: Bruce Ashfield <bruce.ashfield@windriver.com>
-Date: Sun, 25 Aug 2013 22:51:07 -0400
-Subject: [PATCH] ptrace.h: remove ptrace_peeksiginfo_args
-
-The addition of ptrace_peeksiginfo_args to the uapi in kernel commit
-84c751bd [ptrace: add ability to retrieve signals without removing from a queue (v4)]
-means that existing applications using glibc versions that define ptrace_peeksiginfo_args
-in sys/ptrace.h will get duplicate structure definitions like:
-
- | In file included from /poky-master/build/tmp/work/i586-poky-linux/strace/4.8-r0/strace-4.8/process.c:66:0:
- | /poky-master/build/tmp/sysroots/qemux86/usr/include/linux/ptrace.h:58:8: error: redefinition of 'struct ptrace_peeksiginfo_args'
- | struct ptrace_peeksiginfo_args {
- | ^
- | In file included from /poky-master/build/tmp/work/i586-poky-linux/strace/4.8-r0/strace-4.8/defs.h:159:0,
- | from /poky-master/build/tmp/work/i586-poky-linux/strace/4.8-r0/strace-4.8/process.c:37:
- | /poky-master/build/tmp/sysroots/qemux86/usr/include/sys/ptrace.h:191:8: note: originally defined here
- | struct ptrace_peeksiginfo_args
- | ^
- | make[2]: *** [process.o] Error 1
-
-Reverting to the previous status of not exporting this structure temporarily
-fixes applications, until they can be adjusted to not mix sys/ptrace.h and
-linux/ptrace.h includes.
-
-Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
----
- include/uapi/linux/ptrace.h | 6 ------
- 1 file changed, 6 deletions(-)
-
-diff --git a/include/uapi/linux/ptrace.h b/include/uapi/linux/ptrace.h
-index 52ebcc8..524599d 100644
---- a/include/uapi/linux/ptrace.h
-+++ b/include/uapi/linux/ptrace.h
-@@ -55,12 +55,6 @@
-
- #define PTRACE_PEEKSIGINFO 0x4209
-
--struct ptrace_peeksiginfo_args {
-- __u64 off; /* from which siginfo to start */
-- __u32 flags;
-- __s32 nr; /* how may siginfos to take */
--};
--
- /* Read signals from a shared (process wide) queue */
- #define PTRACE_PEEKSIGINFO_SHARED (1 << 0)
-
---
-1.7.10.4
-
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
new file mode 100644
index 0000000000..8dc1edc33b
--- /dev/null
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
@@ -0,0 +1,56 @@
+From 75ba4a547282f91d653872a4bba5f5eae234ea6c Mon Sep 17 00:00:00 2001
+From: rofl0r <retnyg@gmx.net>
+Date: Wed, 22 Jan 2014 00:57:48 +0100
+Subject: [PATCH 2/3] libc-compat.h: prevent redefinition of struct ethhdr
+
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Submitted
+
+ include/uapi/linux/if_ether.h | 4 +++-
+ include/uapi/linux/libc-compat.h | 6 ++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+Index: linux-4.8-rc4/include/uapi/linux/if_ether.h
+===================================================================
+--- linux-4.8-rc4.orig/include/uapi/linux/if_ether.h
++++ linux-4.8-rc4/include/uapi/linux/if_ether.h
+@@ -22,6 +22,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
+@@ -138,11 +139,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 */
+Index: linux-4.8-rc4/include/uapi/linux/libc-compat.h
+===================================================================
+--- linux-4.8-rc4.orig/include/uapi/linux/libc-compat.h
++++ linux-4.8-rc4/include/uapi/linux/libc-compat.h
+@@ -50,6 +50,12 @@
+
+ #ifndef __KERNEL__ /* we're used from userspace */
+
++#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 net/if.h header. */
+ #if defined(_NET_IF_H) && defined(__USE_MISC)
+
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
new file mode 100644
index 0000000000..b5c4e1750e
--- /dev/null
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
@@ -0,0 +1,29 @@
+From 8e69b663d6ddef132041a1186f081fdd74d4a31d Mon Sep 17 00:00:00 2001
+From: rofl0r <retnyg@gmx.net>
+Date: Mon, 20 Jan 2014 21:31:34 +0100
+Subject: [PATCH 3/3] remove inclusion of sysinfo.h in kernel.h
+
+the declaration of struct sysinfo clashes with userspace.
+it's not quite clear why that header was included from kernel.h,
+as none of its functionality is needed.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Submitted
+
+ include/uapi/linux/kernel.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+Index: linux-4.8-rc4/include/uapi/linux/kernel.h
+===================================================================
+--- linux-4.8-rc4.orig/include/uapi/linux/kernel.h
++++ linux-4.8-rc4/include/uapi/linux/kernel.h
+@@ -1,7 +1,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 --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/connector-msg-size-fix.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/connector-msg-size-fix.patch
deleted file mode 100644
index 5d531d65e4..0000000000
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/connector-msg-size-fix.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Upstream-Status: Inappropriate [embedded specific]
-
-Currently default header is linux-libc-header, which leads the dismatch
-with wrs kernel.
-
-The different headers for same file cause trouble between kerenl module and
-user level binary. E.g. segfault in v86d due to different
-CONNECTOR_MAX_MSG_SIZE in connector.h from the one used by uvesafb.
-
-This fix is work around to sync with wrs kernel headers, and should be removed
-after switching to linux-libc-headers-wrs.
-
-[BUGID #279] fixed by this.
-
-Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
-
-Index: linux-2.6.34/include/linux/connector.h
-===================================================================
---- linux-2.6.34.orig/include/linux/connector.h 2010-09-30 14:15:25.000000000 +0800
-+++ linux-2.6.34/include/linux/connector.h 2010-09-30 14:15:43.000000000 +0800
-@@ -48,7 +48,7 @@
- /*
- * Maximum connector's message size.
- */
--#define CONNECTOR_MAX_MSG_SIZE 16384
-+#define CONNECTOR_MAX_MSG_SIZE 65536
-
- /*
- * idx and val are unique identifiers which
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/scripts-Makefile.headersinst-install-headers-from-sc.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/scripts-Makefile.headersinst-install-headers-from-sc.patch
deleted file mode 100644
index 9bc59823a3..0000000000
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/scripts-Makefile.headersinst-install-headers-from-sc.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From e60cc1b011bf0f1acdb7e5168b7bed4ebb78c91f Mon Sep 17 00:00:00 2001
-From: Bruce Ashfield <bruce.ashfield@windriver.com>
-Date: Wed, 9 Jan 2013 16:24:39 -0500
-Subject: [PATCH] scripts/Makefile.headersinst: install headers from scratch file
-
-If headers_install is executed from a deep/long directory structure, the
-shell's maximum argument length can be execeeded, which breaks the operation
-with:
-
-| make[2]: execvp: /bin/sh: Argument list too long
-| make[2]: ***
-
-By dumping the input files to a scratch file and using xargs to read the
-input list from the scratch file, we can avoid blowing out the maximum
-argument size and install headers in a long path name environment.
-
-Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
----
-RP: Refreshed for 3.10 as the problem still exists there on the autobuilders
-
- scripts/Makefile.headersinst | 4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
-
-Index: linux-3.10/scripts/Makefile.headersinst
-===================================================================
---- linux-3.10.orig/scripts/Makefile.headersinst
-+++ linux-3.10/scripts/Makefile.headersinst
-@@ -72,7 +72,7 @@ printdir = $(patsubst $(INSTALL_HDR_PATH
- quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\
- file$(if $(word 2, $(all-files)),s))
- cmd_install = \
-- $(CONFIG_SHELL) $< $(installdir) $(input-files); \
-+ xargs $(CONFIG_SHELL) $< $(installdir) < $(INSTALL_HDR_PATH)/.input-files; \
- for F in $(wrapper-files); do \
- echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \
- done; \
-@@ -101,7 +101,9 @@ targets += $(install-file)
- $(install-file): scripts/headers_install.sh $(input-files) FORCE
- $(if $(unwanted),$(call cmd,remove),)
- $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@)))
-+ @echo $(input-files) > $(INSTALL_HDR_PATH)/.input-files
- $(call if_changed,install)
-+ @rm $(INSTALL_HDR_PATH)/.input-files
-
- else
- __headerscheck: $(subdirs) $(check-file)
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_3.10.bb b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_3.10.bb
deleted file mode 100644
index 65df230c4b..0000000000
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_3.10.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-require linux-libc-headers.inc
-
-SRC_URI += "file://0001-ptrace.h-remove-ptrace_peeksiginfo_args.patch"
-SRC_URI += "file://scripts-Makefile.headersinst-install-headers-from-sc.patch"
-
-SRC_URI[md5sum] = "72d0a9b3e60cd86fabcd3f24b1708944"
-SRC_URI[sha256sum] = "46c9e55e1fddf40813b8d697d5645037a8e2af5c1a8dff52b3fe82b5021582b8"
-
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.10.bb b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.10.bb
new file mode 100644
index 0000000000..108446aa34
--- /dev/null
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.10.bb
@@ -0,0 +1,10 @@
+require linux-libc-headers.inc
+
+SRC_URI_append_libc-musl = "\
+ file://0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch \
+ file://0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch \
+ file://0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch \
+ "
+
+SRC_URI[md5sum] = "b5e7f6b9b2fe1b6cc7bc56a3a0bfc090"
+SRC_URI[sha256sum] = "3c95d9f049bd085e5c346d2c77f063b8425f191460fcd3ae9fe7e94e0477dc4b"