Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 399746 Details for
Bug 544476
sys-kernel/linux-headers-{3.18,3.19}: portability fixes for musl
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
portability fixes for musl
0001-sys-kernel-linux-headers-compatibility-fixes-for-use.patch (text/plain), 13.48 KB, created by
Travis Tilley
on 2015-03-25 15:48:47 UTC
(
hide
)
Description:
portability fixes for musl
Filename:
MIME Type:
Creator:
Travis Tilley
Created:
2015-03-25 15:48:47 UTC
Size:
13.48 KB
patch
obsolete
>From 0f6808a4d46cd47bc9dfaa73755e9172bd1c2b9a Mon Sep 17 00:00:00 2001 >From: Travis Tilley <ttilley@gmail.com> >Date: Wed, 25 Mar 2015 11:38:18 -0400 >Subject: [PATCH] sys-kernel/linux-headers: compatibility fixes for use with > musl > >--- > sys-kernel/linux-headers/Manifest | 9 ++++ > ...ecific-inclusion-of-sysinfo.h-in-kernel.h.patch | 12 +++++ > ...mpat.h-fix-some-issues-arising-from-in6.h.patch | 61 ++++++++++++++++++++++ > ...t.h-prevent-redefinition-of-struct-ethhdr.patch | 39 ++++++++++++++ > sys-kernel/linux-headers/linux-headers-3.18.ebuild | 57 ++++++++++++++++++++ > sys-kernel/linux-headers/linux-headers-3.19.ebuild | 57 ++++++++++++++++++++ > 6 files changed, 235 insertions(+) > create mode 100644 sys-kernel/linux-headers/Manifest > create mode 100644 sys-kernel/linux-headers/files/glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch > create mode 100644 sys-kernel/linux-headers/files/libc-compat.h-fix-some-issues-arising-from-in6.h.patch > create mode 100644 sys-kernel/linux-headers/files/libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch > create mode 100644 sys-kernel/linux-headers/linux-headers-3.18.ebuild > create mode 100644 sys-kernel/linux-headers/linux-headers-3.19.ebuild > >diff --git a/sys-kernel/linux-headers/Manifest b/sys-kernel/linux-headers/Manifest >new file mode 100644 >index 0000000..b54375b >--- /dev/null >+++ b/sys-kernel/linux-headers/Manifest >@@ -0,0 +1,9 @@ >+AUX glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch 275 SHA256 eea3758ded887b84e3b15031e590975b4f94dbf7b03e7b135611339bcb8ca81c SHA512 8ff3af26ac01d402641d6c775ad54922a73e5eaf1e41efe842448d08c59f51ab9290104008283fafbdacd9eb1b8e48e9d2507210a8531d05a852c6ba84d2b60e WHIRLPOOL 2cd90e18615df2f1be80c83d0d2e218d6d02437b2ea91ba3a61ced407357f972371bddfed140f18ec66817e7f6ddd61a1c85da7f9b14be04f71ca3e64c8fb687 >+AUX libc-compat.h-fix-some-issues-arising-from-in6.h.patch 2051 SHA256 9dc049392ba3b79453baa809f0aafb47283293046b84511b5ae8519a86716048 SHA512 6d6107974dcf9671dd0f1a747160adf85a22c27216b1200ce40fd410f6fc5fd47956b8b5b51055cfda4b97cc9f172cd3850ccb4daa73e4eda449e6e77c0840ca WHIRLPOOL 4245b157fd91ecba39f42126e603a166eab74ff4abc7487639ea191de22376876de25db35b295e1227da4990e2ae04bcc6bab34a1b583ef10fda4fe30341a1c1 >+AUX libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch 1037 SHA256 3297454dd7bdc3417d36f448ca2091e39a6acf475e22c6eb67ee5819d7b73c8f SHA512 895e23a36d0736ff624ad960e8a26e221d990e50910cc96b1a151789f97b94288f3e801ad76d141e421901e66422c480e511b2e20798e91a15b9e298c72533d6 WHIRLPOOL 25fc05bd3d942c27e12ede60fe07953d3c35adfb7154ee1b99cc8f02946264a4f91df9c5cce089c90bb08c5aec104c6217d55c8f7c07b454f3a4c32b4ee2f61f >+DIST gentoo-headers-3.18-1.tar.xz 3628 SHA256 d6b83a873baf83d8db535623dc9b91b52354e53238a128bb6fc29c6ff4f9f11e SHA512 89fb9b336fa3455752f6fe8626500d30245c04806890d4448a2895bbef2a5eae409940618fd4e0be57aa12784a198a695c32479f12d76450e16f2af1536e7a1f WHIRLPOOL 5a18218fef9013d5306d3ef6aa6467c1fe09dc70593c3f8f1f62a3e99d704d085420e33ded3924f0e34ee58c080952e5e007842f31d7bf648fad14a02ce3751f >+DIST gentoo-headers-3.19-1.tar.xz 3848 SHA256 f66fedf95b99130b3b43dababe40b2269552059a945f1d9f1876f773e3fcbd82 SHA512 767de6ec1870185da2ee1fc1579289d3c564d64ae57556a8534fca9b1843cea25d4d34381d4c56959e89400b8e28aa575c56d573eace0e85e7c258a8d32f3bab WHIRLPOOL 8ae320ad44de8088e29b199c4ec80657106c413fa60b7b8158088b539a547cd5b6d33b99f0bc0acfc0567715ed0e3943b69e7cd423c4a8d096cf75d723d82c2e >+DIST gentoo-headers-base-3.18.tar.xz 3776668 SHA256 12a44590e505525509556f6e973464f124f172565d3a4b29a3ff4627aa24f9a7 SHA512 6615c604e5e618d26fff5a61691f7827bb05be9790db6c9f8e16e3842bce8f056f9928f85ae5714710b75743b0d0804faba4ba9c76e934e1de22dc03ef6d5535 WHIRLPOOL 5cdd500aaac3589d6672ea365f5b29ccef207db36cbc34052f0bf1bbe35b5dbfedf3b1675079c1ec05daf1a136d2da3018b2ca91bcaeda1fe8d23e3246fda25e >+DIST gentoo-headers-base-3.19.tar.xz 3807516 SHA256 e614ab947a7d0bd5064c49aeaac43507a7a322c43fdcca9a0858855137193b1d SHA512 3ba9b5e442e53d82e5af7fced55b173cacc7edc99157eb430dad81f95d48594bc18a8d5f54cd15ba2221bad4098c7732b9ba24780fc0964ea34377933ba36333 WHIRLPOOL 6ca7f201272202e6e2bc1d36c6e62e47d85163546e317fee5e4e31af98722aa6de81c4c0c54635acd4386a515f28376517aa84eec7ae4cd17220fb549e5f51c1 >+EBUILD linux-headers-3.18.ebuild 1815 SHA256 d4edb6f0c134c701c6477b11c3a5195650e3bd4cac441985320b3695e6d6f653 SHA512 5cb9d1546ca6a843853354f5ef9e20b89bc8e43d1e2f08d448508e705ebd2ced54f45acbd0f726b0312157beec9949f68648b946796afc0696f77265c5038f13 WHIRLPOOL 54958d10172395608c7bf610af742fa5d079ea531ee49d30e2b07bdb3563eaae0969fcefca29867908954fb6eb6f415f65de90c0389845084f0569f381fbe7f0 >+EBUILD linux-headers-3.19.ebuild 1823 SHA256 c8cd2af79d41538c90262229e38c828b6a9cbbf8d28611aa86d9e0639ebb6a23 SHA512 8394a75fa93966194e7f4705c3d8874a939440e5c15b0f7cae7e2fb91e8c74b17a2bc8a4d47aa22dec9d6af1e4f2d9379a9150ce24e6a9dbfc7ad46b13cf0e2e WHIRLPOOL a21c5eb2ed4d04b081eafac19d5c879071463e75325c6059185a6a56b7795756343d52aad6dd7d60a9560e5ba8077a05ef6a763c7c9df6ea727a6f5f9382a4f6 >diff --git a/sys-kernel/linux-headers/files/glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch b/sys-kernel/linux-headers/files/glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch >new file mode 100644 >index 0000000..0b4cfb1 >--- /dev/null >+++ b/sys-kernel/linux-headers/files/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 <linux/sysinfo.h> >++#endif >+ >+ /* >+ * 'kernel.h' contains some often-used function prototypes etc >diff --git a/sys-kernel/linux-headers/files/libc-compat.h-fix-some-issues-arising-from-in6.h.patch b/sys-kernel/linux-headers/files/libc-compat.h-fix-some-issues-arising-from-in6.h.patch >new file mode 100644 >index 0000000..e4ce3d6 >--- /dev/null >+++ b/sys-kernel/linux-headers/files/libc-compat.h-fix-some-issues-arising-from-in6.h.patch >@@ -0,0 +1,61 @@ >+--- ./include/uapi/linux/libc-compat.h.orig >++++ ./include/uapi/linux/libc-compat.h >+@@ -48,35 +48,26 @@ >+ #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) >++/* 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 >+ >+-#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 the libc will check the >+ * __UAPI_DEF_* defines and adjust appropriately. */ >+ #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 >+@@ -89,7 +80,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 >+@@ -98,6 +89,6 @@ >+ #define __UAPI_DEF_IPV6_MREQ 1 >+ #define __UAPI_DEF_IPPROTO_V6 1 >+ >+-#endif /* __GLIBC__ */ >++#endif /* __KERNEL__ */ >+ >+ #endif /* _UAPI_LIBC_COMPAT_H */ >diff --git a/sys-kernel/linux-headers/files/libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch b/sys-kernel/linux-headers/files/libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch >new file mode 100644 >index 0000000..b8ac94f >--- /dev/null >+++ b/sys-kernel/linux-headers/files/libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch >@@ -0,0 +1,39 @@ >+--- ./include/uapi/linux/if_ether.h.orig >++++ ./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 >+@@ -130,11 +131,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 */ >+--- ./include/uapi/linux/libc-compat.h.orig >++++ ./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 netinet/in.h header. */ >+ #ifdef _NETINET_IN_H >+ >diff --git a/sys-kernel/linux-headers/linux-headers-3.18.ebuild b/sys-kernel/linux-headers/linux-headers-3.18.ebuild >new file mode 100644 >index 0000000..7d5f922 >--- /dev/null >+++ b/sys-kernel/linux-headers/linux-headers-3.18.ebuild >@@ -0,0 +1,57 @@ >+# Copyright 1999-2015 Gentoo Foundation >+# Distributed under the terms of the GNU General Public License v2 >+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/linux-headers/linux-headers-3.18.ebuild,v 1.3 2015/03/24 20:13:13 maekke Exp $ >+ >+EAPI="4" >+ >+ETYPE="headers" >+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 bfin cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 openrisc ppc ppc64 s390 score sh sparc tile x86 xtensa" >+inherit kernel-2 >+detect_version >+ >+PATCH_VER="1" >+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz >+ ${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}" >+ >+KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux" >+ >+DEPEND="app-arch/xz-utils >+ dev-lang/perl" >+RDEPEND="!!media-sound/alsa-headers" >+ >+S=${WORKDIR}/gentoo-headers-base-${PV} >+ >+src_unpack() { >+ unpack ${A} >+} >+ >+src_prepare() { >+ [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/${PV} >+ epatch "${FILESDIR}"/glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch >+ epatch "${FILESDIR}"/libc-compat.h-fix-some-issues-arising-from-in6.h.patch >+ epatch "${FILESDIR}"/libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch >+} >+ >+src_install() { >+ kernel-2_src_install >+ >+ # hrm, build system sucks >+ find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete >+ find "${ED}" -depth -type d -delete 2>/dev/null >+ >+ # provided by libdrm (for now?) >+ rm -rf "${ED}"/$(kernel_header_destdir)/drm >+} >+ >+src_test() { >+ einfo "Possible unescaped attribute/type usage" >+ egrep -r \ >+ -e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \ >+ -e '\<([us](8|16|32|64))\>' \ >+ . >+ >+ einfo "Missing linux/types.h include" >+ egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h >+ >+ emake ARCH=$(tc-arch-kernel) headers_check >+} >diff --git a/sys-kernel/linux-headers/linux-headers-3.19.ebuild b/sys-kernel/linux-headers/linux-headers-3.19.ebuild >new file mode 100644 >index 0000000..13e8eb2 >--- /dev/null >+++ b/sys-kernel/linux-headers/linux-headers-3.19.ebuild >@@ -0,0 +1,57 @@ >+# Copyright 1999-2015 Gentoo Foundation >+# Distributed under the terms of the GNU General Public License v2 >+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/linux-headers/linux-headers-3.19.ebuild,v 1.1 2015/02/09 19:25:54 vapier Exp $ >+ >+EAPI="4" >+ >+ETYPE="headers" >+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 bfin cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 s390 score sh sparc tile x86 xtensa" >+inherit kernel-2 >+detect_version >+ >+PATCH_VER="1" >+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz >+ ${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}" >+ >+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux" >+ >+DEPEND="app-arch/xz-utils >+ dev-lang/perl" >+RDEPEND="!!media-sound/alsa-headers" >+ >+S=${WORKDIR}/gentoo-headers-base-${PV} >+ >+src_unpack() { >+ unpack ${A} >+} >+ >+src_prepare() { >+ [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/${PV} >+ epatch "${FILESDIR}"/glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch >+ epatch "${FILESDIR}"/libc-compat.h-fix-some-issues-arising-from-in6.h.patch >+ epatch "${FILESDIR}"/libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch >+} >+ >+src_install() { >+ kernel-2_src_install >+ >+ # hrm, build system sucks >+ find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete >+ find "${ED}" -depth -type d -delete 2>/dev/null >+ >+ # provided by libdrm (for now?) >+ rm -rf "${ED}"/$(kernel_header_destdir)/drm >+} >+ >+src_test() { >+ einfo "Possible unescaped attribute/type usage" >+ egrep -r \ >+ -e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \ >+ -e '\<([us](8|16|32|64))\>' \ >+ . >+ >+ einfo "Missing linux/types.h include" >+ egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h >+ >+ emake ARCH=$(tc-arch-kernel) headers_check >+} >-- >2.0.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 544476
: 399746 |
399860
|
399862
|
416208
|
429462