From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12335 Path: news.gmane.org!.POSTED!not-for-mail From: Hauke Mehrtens Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH v2] Add additional uapi guards for Linux kernel header files Date: Sat, 6 Jan 2018 23:32:52 +0100 Message-ID: <20180106223252.3904-1-hauke@hauke-m.de> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1515277882 26757 195.159.176.226 (6 Jan 2018 22:31:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 6 Jan 2018 22:31:22 +0000 (UTC) Cc: felix.janda@posteo.de, Hauke Mehrtens To: musl@lists.openwall.com Original-X-From: musl-return-12351-gllmg-musl=m.gmane.org@lists.openwall.com Sat Jan 06 23:31:18 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1eXwzl-0006bp-6F for gllmg-musl@m.gmane.org; Sat, 06 Jan 2018 23:31:17 +0100 Original-Received: (qmail 28080 invoked by uid 550); 6 Jan 2018 22:33:18 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 28032 invoked from network); 6 Jan 2018 22:33:17 -0000 X-Virus-Scanned: amavisd-new at heinlein-support.de Xref: news.gmane.org gmane.linux.lib.musl.general:12335 Archived-At: With Linux kernel 4.16 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 into the netdev tree and will be integrated in Linux 4.16: https://patchwork.ozlabs.org/patch/854342/ https://patchwork.ozlabs.org/patch/855293/ --- include/net/if.h | 7 +++++++ include/netinet/if_ether.h | 1 + include/sys/xattr.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/include/net/if.h b/include/net/if.h index 2f2fcc10..0ee48cd7 100644 --- 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 diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h index d9a131aa..c2c6e944 100644 --- 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 diff --git a/include/sys/xattr.h b/include/sys/xattr.h index 6479fcc6..52e3dd89 100644 --- 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 -- 2.11.0