From b7ef51cf8edb61421e56d105f28f3506bb25401e Mon Sep 17 00:00:00 2001 From: Jussi Kukkonen Date: Tue, 24 Jan 2017 11:06:32 +0200 Subject: lms8: Fix build on musl Add two patches to make lms8 build with musl libc (both generic fixes, not musl specific). Signed-off-by: Jussi Kukkonen Signed-off-by: California Sullivan --- .../lms/0001-Include-sys-select.h-for-fd_set.patch | 28 +++++++++++++++++++ .../amt/lms/0002-Use-proper-netinet-in.h-API.patch | 31 ++++++++++++++++++++++ common/recipes-bsp/amt/lms8_8.0.0-7.bb | 2 ++ 3 files changed, 61 insertions(+) create mode 100644 common/recipes-bsp/amt/lms/0001-Include-sys-select.h-for-fd_set.patch create mode 100644 common/recipes-bsp/amt/lms/0002-Use-proper-netinet-in.h-API.patch (limited to 'common/recipes-bsp') diff --git a/common/recipes-bsp/amt/lms/0001-Include-sys-select.h-for-fd_set.patch b/common/recipes-bsp/amt/lms/0001-Include-sys-select.h-for-fd_set.patch new file mode 100644 index 00000000..e28d45ac --- /dev/null +++ b/common/recipes-bsp/amt/lms/0001-Include-sys-select.h-for-fd_set.patch @@ -0,0 +1,28 @@ +From 518a3a277c89a3d6b0a9d3ee552cfa33a1dbd5c6 Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen +Date: Mon, 23 Jan 2017 20:45:08 +0200 +Subject: [PATCH 1/2] Include sys/select.h for fd_set() + +This is needed at least on musl. + +Upstream-Status: Pending +Signed-off-by: Jussi Kukkonen +--- + src/mei/MEILinux.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/mei/MEILinux.cpp b/src/mei/MEILinux.cpp +index 1e9d28f..631270e 100755 +--- a/src/mei/MEILinux.cpp ++++ b/src/mei/MEILinux.cpp +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + #include + #include + #include +-- +2.1.4 + diff --git a/common/recipes-bsp/amt/lms/0002-Use-proper-netinet-in.h-API.patch b/common/recipes-bsp/amt/lms/0002-Use-proper-netinet-in.h-API.patch new file mode 100644 index 00000000..fa2e29a5 --- /dev/null +++ b/common/recipes-bsp/amt/lms/0002-Use-proper-netinet-in.h-API.patch @@ -0,0 +1,31 @@ +From 0adc925ca9e005f93d77f373ccda2a6c6cc3ff2f Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen +Date: Mon, 23 Jan 2017 20:46:50 +0200 +Subject: [PATCH 2/2] Use proper netinet/in.h API + +in6addr is only guaranteed to contain this member: + uint8_t s6_addr[16] +Use that instead of the glibc implementation detail __in6_u. + +Upstream-Status: Pending +Signed-off-by: Jussi Kukkonen +--- + src/tools/ATNetworkTool.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/tools/ATNetworkTool.cpp b/src/tools/ATNetworkTool.cpp +index 66e27df..0789c79 100755 +--- a/src/tools/ATNetworkTool.cpp ++++ b/src/tools/ATNetworkTool.cpp +@@ -207,7 +207,7 @@ int ATNetworkTool::GetSockPeerIP(int sock, ATAddressList & peerAddresses, int &e + if(sa->sa_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&addr)) //if(IN6_IS_ADDR_V4COMPAT(&addr)) + { + struct in_addr demapped_addr; +- memcpy(&demapped_addr.s_addr, &addr.__in6_u.__u6_addr8[12], 4); ++ memcpy(&demapped_addr.s_addr, &addr.s6_addr[12], 4); + + struct sockaddr_in sa_in; + sa_in.sin_family = AF_INET; +-- +2.1.4 + diff --git a/common/recipes-bsp/amt/lms8_8.0.0-7.bb b/common/recipes-bsp/amt/lms8_8.0.0-7.bb index 7989d59e..842e34a0 100644 --- a/common/recipes-bsp/amt/lms8_8.0.0-7.bb +++ b/common/recipes-bsp/amt/lms8_8.0.0-7.bb @@ -10,6 +10,8 @@ BPN="lms" SRC_URI = "http://software.intel.com/sites/default/files/${BPN}-${PV}.tar.gz \ file://readlink-declaration.patch \ file://0001-Protocol.cpp-Add-whitespace-for-gcc6-compile-error.patch \ + file://0001-Include-sys-select.h-for-fd_set.patch \ + file://0002-Use-proper-netinet-in.h-API.patch \ " COMPATIBLE_HOST = '(i.86|x86_64).*-linux' -- cgit v1.2.3-54-g00ecf