net-vpn/freelan: Backport upstream patches to build with gcc7 and glibc 2.25. Bug...
authorAlexis Ballier <aballier@gentoo.org>
Wed, 13 Sep 2017 11:23:52 +0000 (13:23 +0200)
committerAlexis Ballier <aballier@gentoo.org>
Wed, 13 Sep 2017 11:24:04 +0000 (13:24 +0200)
Package-Manager: Portage-2.3.8, Repoman-2.3.3

net-vpn/freelan/files/gcc7.patch [new file with mode: 0644]
net-vpn/freelan/files/glibc225.patch [new file with mode: 0644]
net-vpn/freelan/freelan-2.0.ebuild

diff --git a/net-vpn/freelan/files/gcc7.patch b/net-vpn/freelan/files/gcc7.patch
new file mode 100644 (file)
index 0000000..71bcf3d
--- /dev/null
@@ -0,0 +1,60 @@
+commit 5014a8023b42762052d6417ebbc0cd2adb1fda90
+Author: Sebastien Vincent <sebastien.vincent@cppextrem.com>
+Date:   Sat Aug 5 20:10:55 2017 +0200
+
+    Fixes compilation with g++-7.
+
+diff --git a/libs/asiotap/src/posix/posix_tap_adapter.cpp b/libs/asiotap/src/posix/posix_tap_adapter.cpp
+index 71377cee..cdd7abf3 100644
+--- a/libs/asiotap/src/posix/posix_tap_adapter.cpp
++++ b/libs/asiotap/src/posix/posix_tap_adapter.cpp
+@@ -206,6 +206,7 @@ namespace asiotap
+                                               {
+                                                       result[name] = name;
+                                               }
++                                              break;
+                                       }
+                                       case tap_adapter_layer::ip:
+                                       {
+@@ -213,6 +214,7 @@ namespace asiotap
+                                               {
+                                                       result[name] = name;
+                                               }
++                                              break;
+                                       }
+                               }
+                       }
+diff --git a/libs/netlinkplus/include/netlinkplus/endpoint.hpp b/libs/netlinkplus/include/netlinkplus/endpoint.hpp
+index 3503cae3..74fb7e1b 100644
+--- a/libs/netlinkplus/include/netlinkplus/endpoint.hpp
++++ b/libs/netlinkplus/include/netlinkplus/endpoint.hpp
+@@ -44,6 +44,8 @@
+ 
+ #pragma once
+ 
++#include <cstring>
++
+ #include <boost/asio.hpp>
+ 
+ #include <linux/netlink.h>
+@@ -125,17 +127,17 @@ namespace netlinkplus
+ 
+                       friend bool operator==(const netlink_endpoint& lhs, const netlink_endpoint& rhs)
+                       {
+-                              return (lhs.m_sockaddr == rhs.m_sockaddr);
++                              return (std::memcmp(&lhs.m_sockaddr, &rhs.m_sockaddr, sizeof(sockaddr_nl)) == 0);
+                       }
+ 
+                       friend bool operator!=(const netlink_endpoint& lhs, const netlink_endpoint& rhs)
+                       {
+-                              return (lhs.m_sockaddr != rhs.m_sockaddr);
++                              return (std::memcmp(&lhs.m_sockaddr, &rhs.m_sockaddr, sizeof(sockaddr_nl)) != 0);
+                       }
+ 
+                       friend bool operator<(const netlink_endpoint& lhs, const netlink_endpoint& rhs)
+                       {
+-                              return (lhs.m_sockaddr < rhs.m_sockaddr);
++                              return (std::memcmp(&lhs.m_sockaddr, &rhs.m_sockaddr, sizeof(sockaddr_nl)) < 0);
+                       }
+ 
+               private:
diff --git a/net-vpn/freelan/files/glibc225.patch b/net-vpn/freelan/files/glibc225.patch
new file mode 100644 (file)
index 0000000..e21df29
--- /dev/null
@@ -0,0 +1,21 @@
+commit 597b6eb65b4ea68f0fe8015db38ce68b71c280d7
+Author: Florian Lamprecht <florian_lamprecht@gmx.de>
+Date:   Sun Mar 19 13:37:27 2017 +0100
+
+    Fix a compiler warning on linux
+    
+    include a systemmacro explictly to avoid warning, which is handled as error.
+
+diff --git a/libs/asiotap/src/posix/posix_tap_adapter.cpp b/libs/asiotap/src/posix/posix_tap_adapter.cpp
+index 74e9eb2a..71377cee 100644
+--- a/libs/asiotap/src/posix/posix_tap_adapter.cpp
++++ b/libs/asiotap/src/posix/posix_tap_adapter.cpp
+@@ -56,7 +56,7 @@
+ #ifdef LINUX
+ 
+ #include <linux/if_tun.h>
+-
++#include <sys/sysmacros.h>
+ /**
+  * \struct in6_ifreq
+  * \brief Replacement structure since the include of linux/ipv6.h introduces conflicts.
index 477b6f862c324462d8de13c40de6a33213de75ac..eb641501a7e45000823ef98c582d3dd08be5384e 100644 (file)
@@ -30,7 +30,9 @@ src_prepare() {
                "${FILESDIR}/boost158.patch" \
                "${FILESDIR}/mf.patch" \
                "${FILESDIR}/prefix.patch" \
-               "${FILESDIR}/boost163.patch"
+               "${FILESDIR}/boost163.patch" \
+               "${FILESDIR}/glibc225.patch" \
+               "${FILESDIR}/gcc7.patch"
 
        sed -e "s/CXXFLAGS='-O3'/CXXFLAGS=''/" \
                -e "s/CXXFLAGS=\['-Werror'\]/CXXFLAGS=[]/" \