summaryrefslogtreecommitdiffstats
path: root/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Define-in_-structs-for-non-glibc-system-libs.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Define-in_-structs-for-non-glibc-system-libs.patch')
-rw-r--r--meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Define-in_-structs-for-non-glibc-system-libs.patch85
1 files changed, 85 insertions, 0 deletions
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Define-in_-structs-for-non-glibc-system-libs.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Define-in_-structs-for-non-glibc-system-libs.patch
new file mode 100644
index 000000000..8d1ec69ae
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Define-in_-structs-for-non-glibc-system-libs.patch
@@ -0,0 +1,85 @@
1From f414dea1316a48aba3e8e293201ebd51652d3ef4 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 9 Jul 2017 15:17:29 -0700
4Subject: [PATCH] Define in_* structs for non-glibc system libs
5
6These defines and structs are required to be coming from
7userspace netinet/in.h, which is being overridden in klibc
8however, libc-compat.h from kernel is only written keeping
9glibc in mind, and does not provide adequate guards for musl
10to infer that these structs should be defined in linux/in.h
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 usr/include/netinet/in.h | 33 +++++++++++++++++++++++++++++++++
15 1 file changed, 33 insertions(+)
16
17Index: git/usr/include/netinet/in.h
18===================================================================
19--- git.orig/usr/include/netinet/in.h
20+++ git/usr/include/netinet/in.h
21@@ -5,6 +5,42 @@
22 #ifndef _NETINET_IN_H
23 #define _NETINET_IN_H
24
25+#ifndef __GLIBC__
26+#include <linux/libc-compat.h>
27+
28+#undef __UAPI_DEF_IN_ADDR
29+#undef __UAPI_DEF_IN_IPPROTO
30+#undef __UAPI_DEF_IN_PKTINFO
31+#undef __UAPI_DEF_IP_MREQ
32+#undef __UAPI_DEF_SOCKADDR_IN
33+#undef __UAPI_DEF_IN_CLASS
34+#undef __UAPI_DEF_IN6_ADDR
35+#undef __UAPI_DEF_IN6_ADDR_ALT
36+#undef __UAPI_DEF_SOCKADDR_IN6
37+#undef __UAPI_DEF_IPV6_MREQ
38+#undef __UAPI_DEF_IPPROTO_V6
39+#undef __UAPI_DEF_IPV6_OPTIONS
40+#undef __UAPI_DEF_IN6_PKTINFO
41+#undef __UAPI_DEF_IP6_MTUINFO
42+#undef __UAPI_DEF_IF_IFREQ
43+
44+#define __UAPI_DEF_IN_ADDR 1
45+#define __UAPI_DEF_IN_IPPROTO 1
46+#define __UAPI_DEF_IN_PKTINFO 1
47+#define __UAPI_DEF_IP_MREQ 1
48+#define __UAPI_DEF_SOCKADDR_IN 1
49+#define __UAPI_DEF_IN_CLASS 1
50+#define __UAPI_DEF_IN6_ADDR 1
51+#define __UAPI_DEF_IN6_ADDR_ALT 1
52+#define __UAPI_DEF_SOCKADDR_IN6 1
53+#define __UAPI_DEF_IPV6_MREQ 1
54+#define __UAPI_DEF_IPPROTO_V6 1
55+#define __UAPI_DEF_IPV6_OPTIONS 1
56+#define __UAPI_DEF_IN6_PKTINFO 1
57+#define __UAPI_DEF_IP6_MTUINFO 1
58+#define __UAPI_DEF_IF_IFREQ 1
59+#endif
60+
61 #include <klibc/extern.h>
62 #include <stdint.h>
63 #include <endian.h> /* Must be included *before* <linux/in.h> */
64Index: git/usr/include/net/if.h
65===================================================================
66--- git.orig/usr/include/net/if.h
67+++ git/usr/include/net/if.h
68@@ -1,6 +1,17 @@
69 #ifndef _NET_IF_H
70 #define _NET_IF_H
71
72+#ifndef __GLIBC__
73+#include <linux/libc-compat.h>
74+#undef __UAPI_DEF_IF_IFREQ
75+#define __UAPI_DEF_IF_IFREQ 1
76+#undef __UAPI_DEF_IF_IFNAMSIZ
77+#define __UAPI_DEF_IF_IFNAMSIZ 1
78+#undef __UAPI_DEF_IF_IFMAP
79+#define __UAPI_DEF_IF_IFMAP 1
80+#undef __UAPI_DEF_IF_NET_DEVICE_FLAGS
81+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
82+#endif
83 #include <sys/socket.h>
84 #include <sys/types.h>
85 #include <linux/if.h>