From: Ming Liu <peter.x....@external.atlascopco.com>

[YOCTO #10313]

Signed-off-by: Ming Liu <peter.x....@external.atlascopco.com>
---
 .../libnl/libnl/0001-Fix-build-with-musl.patch     | 43 ++++++++++++++++++++++
 meta/recipes-support/libnl/libnl_3.2.28.bb         |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 
meta/recipes-support/libnl/libnl/0001-Fix-build-with-musl.patch

diff --git a/meta/recipes-support/libnl/libnl/0001-Fix-build-with-musl.patch 
b/meta/recipes-support/libnl/libnl/0001-Fix-build-with-musl.patch
new file mode 100644
index 0000000..8a2dad5
--- /dev/null
+++ b/meta/recipes-support/libnl/libnl/0001-Fix-build-with-musl.patch
@@ -0,0 +1,43 @@
+From 963d9818d13a025b857380c84d53b11c3aceff54 Mon Sep 17 00:00:00 2001
+From: Peter Liu <peter.x....@external.atlascopco.com>
+Date: Wed, 21 Sep 2016 09:07:12 +0200
+Subject: [PATCH] Fix build with musl
+
+Upstream-Status: Pending
+
+Due to both <netinet/in.h> and <linux/in6.h> being included, the
+in6_addr is being redefined: once from the C library headers and once
+from the kernel headers. This causes some build failures with for
+example the musl C library:
+| In file included from 
../../libnl-3.2.28/include/linux-private/linux/if_bridge.h:18:0,
+|                  from ../../libnl-3.2.28/lib/route/link/bridge.c:26:
+| /mnt/ale-build/tmp/musl/sysroots/itmk2/usr/include/linux/in6.h:32:8: error: 
redefinition of 'struct in6_addr'
+|  struct in6_addr {
+|         ^~~~~~~~
+| In file included from 
/mnt/ale-build/tmp/musl/sysroots/itmk2/usr/include/arpa/inet.h:9:0,
+|                  from 
../../libnl-3.2.28/include/netlink-private/netlink.h:33,
+|                  from ../../libnl-3.2.28/lib/route/link/bridge.c:20:
+| /mnt/ale-build/tmp/musl/sysroots/itmk2/usr/include/netinet/in.h:23:8: note: 
originally defined here
+
+In order to fix this, use just the C library header <netinet/in.h>.
+
+Signed-off-by: Peter Liu <peter.x....@external.atlascopco.com>
+---
+ include/linux-private/linux/if_bridge.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/include/linux-private/linux/if_bridge.h 
b/include/linux-private/linux/if_bridge.h
+index f24050b..8f7490c 100644
+--- a/include/linux-private/linux/if_bridge.h
++++ b/include/linux-private/linux/if_bridge.h
+@@ -15,7 +15,6 @@
+ 
+ #include <linux/types.h>
+ #include <linux/if_ether.h>
+-#include <linux/in6.h>
+ 
+ #define SYSFS_BRIDGE_ATTR     "bridge"
+ #define SYSFS_BRIDGE_FDB      "brforward"
+-- 
+1.9.1
+
diff --git a/meta/recipes-support/libnl/libnl_3.2.28.bb 
b/meta/recipes-support/libnl/libnl_3.2.28.bb
index 26982f3..f8f3e53 100644
--- a/meta/recipes-support/libnl/libnl_3.2.28.bb
+++ b/meta/recipes-support/libnl/libnl_3.2.28.bb
@@ -15,6 +15,7 @@ SRC_URI = 
"https://github.com/thom311/${BPN}/releases/download/${BPN}${@d.getVar
            file://0001-lib-add-utility-function-nl_strerror_l.patch \
            
file://0002-lib-switch-to-using-strerror_l-instead-of-strerror_r.patch \
            
file://0003-src-switch-to-using-strerror_l-instead-of-strerror_r.patch \
+           file://0001-Fix-build-with-musl.patch \
 "
 UPSTREAM_CHECK_URI = "https://github.com/thom311/${BPN}/releases";
 
-- 
1.9.1

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to