zmq: update to 4.3.2
Remove upstreamed patches.
Add uClibc++ patch for those that need it.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit e169e2f9c8
)
This commit is contained in:
parent
a7d129fc2d
commit
ef30f8bf80
7 changed files with 97 additions and 139 deletions
|
@ -10,12 +10,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=zeromq
|
||||
PKG_VERSION:=4.1.7
|
||||
PKG_RELEASE:=2
|
||||
PKG_VERSION:=4.3.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/zeromq/zeromq4-1/releases/download/v$(PKG_VERSION)
|
||||
PKG_HASH:=31c383cfcd3be1dc8a66e448c403029e793687e70473b89c4cc0bd626e7da299
|
||||
PKG_SOURCE_URL:=https://github.com/zeromq/libzmq/releases/download/v$(PKG_VERSION)
|
||||
PKG_HASH:=ebd7b5c830d6428956b67a0454a7f8cbed1de74b3b01e5c33c5378e22740f763
|
||||
|
||||
PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
|
@ -61,6 +61,7 @@ endef
|
|||
CMAKE_OPTIONS += \
|
||||
-DA2X_EXECUTABLE=OFF \
|
||||
-DASCIIDOC_EXECUTABLE=OFF \
|
||||
-DBUILD_STATIC=OFF \
|
||||
-DCMAKE_SKIP_INSTALL_RPATH=ON \
|
||||
-DZMQ_HAVE_SOCK_CLOEXEC=ON \
|
||||
-DZMQ_HAVE_SO_KEEPALIVE=ON \
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -3,6 +3,8 @@
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
project(ZeroMQ)
|
||||
|
||||
+include(FindPkgConfig)
|
||||
+
|
||||
option(WITH_OPENPGM "Build with support for OpenPGM" OFF)
|
||||
|
||||
if(APPLE)
|
||||
@@ -21,7 +23,7 @@ if (NOT ENABLE_CURVE)
|
||||
message (STATUS "CURVE security is disabled")
|
||||
|
||||
elseif (WITH_LIBSODIUM)
|
||||
- find_package (Sodium)
|
||||
+ pkg_search_module (SODIUM REQUIRED libsodium)
|
||||
if (SODIUM_FOUND)
|
||||
message (STATUS "Using libsodium for CURVE security")
|
||||
include_directories (${SODIUM_INCLUDE_DIRS})
|
92
libs/zmq/patches/010-uclibcxx.patch
Normal file
92
libs/zmq/patches/010-uclibcxx.patch
Normal file
|
@ -0,0 +1,92 @@
|
|||
--- a/perf/benchmark_radix_tree.cpp
|
||||
+++ b/perf/benchmark_radix_tree.cpp
|
||||
@@ -26,8 +26,8 @@
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
-
|
||||
-#if __cplusplus >= 201103L
|
||||
+#include <ios>
|
||||
+#if __cplusplus >= 201103L && !defined(__UCLIBCXX_MAJOR__)
|
||||
|
||||
#include "radix_tree.hpp"
|
||||
#include "trie.hpp"
|
||||
--- a/src/atomic_counter.hpp
|
||||
+++ b/src/atomic_counter.hpp
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
#if defined ZMQ_FORCE_MUTEXES
|
||||
#define ZMQ_ATOMIC_COUNTER_MUTEX
|
||||
-#elif (defined __cplusplus && __cplusplus >= 201103L) \
|
||||
+#elif (defined __cplusplus && __cplusplus >= 201103L && !defined(__UCLIBCXX_MAJOR__)) \
|
||||
|| (defined _MSC_VER && _MSC_VER >= 1900)
|
||||
#define ZMQ_ATOMIC_COUNTER_CXX11
|
||||
#elif defined ZMQ_HAVE_ATOMIC_INTRINSICS
|
||||
--- a/src/atomic_ptr.hpp
|
||||
+++ b/src/atomic_ptr.hpp
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
#if defined ZMQ_FORCE_MUTEXES
|
||||
#define ZMQ_ATOMIC_PTR_MUTEX
|
||||
-#elif (defined __cplusplus && __cplusplus >= 201103L) \
|
||||
+#elif (defined __cplusplus && __cplusplus >= 201103L && !defined(__UCLIBCXX_MAJOR__)) \
|
||||
|| (defined _MSC_VER && _MSC_VER >= 1900)
|
||||
#define ZMQ_ATOMIC_PTR_CXX11
|
||||
#elif defined ZMQ_HAVE_ATOMIC_INTRINSICS
|
||||
--- a/src/blob.hpp
|
||||
+++ b/src/blob.hpp
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <algorithm>
|
||||
#include <ios>
|
||||
|
||||
-#if __cplusplus >= 201103L || defined(_MSC_VER) && _MSC_VER > 1700
|
||||
+#if __cplusplus >= 201103L && !defined(__UCLIBCXX_MAJOR__) || defined(_MSC_VER) && _MSC_VER > 1700
|
||||
#define ZMQ_HAS_MOVE_SEMANTICS
|
||||
#define ZMQ_MAP_INSERT_OR_EMPLACE(k, v) emplace (k, v)
|
||||
#define ZMQ_PUSH_OR_EMPLACE_BACK emplace_back
|
||||
--- a/src/ctx.cpp
|
||||
+++ b/src/ctx.cpp
|
||||
@@ -544,7 +544,7 @@ void zmq::ctx_t::unregister_endpoints (socket_base_t *socket_)
|
||||
end = _endpoints.end ();
|
||||
it != end;) {
|
||||
if (it->second.socket == socket_)
|
||||
-#if __cplusplus >= 201103L
|
||||
+#if __cplusplus >= 201103L && !defined(__UCLIBCXX_MAJOR__)
|
||||
it = _endpoints.erase (it);
|
||||
#else
|
||||
_endpoints.erase (it++);
|
||||
--- a/src/msg.hpp
|
||||
+++ b/src/msg.hpp
|
||||
@@ -30,8 +30,8 @@
|
||||
#ifndef __ZMQ_MSG_HPP_INCLUDE__
|
||||
#define __ZMQ_MSG_HPP_INCLUDE__
|
||||
|
||||
-#include <stddef.h>
|
||||
-#include <stdio.h>
|
||||
+#include <cstddef>
|
||||
+#include <cstdio>
|
||||
|
||||
#include "config.hpp"
|
||||
#include "err.hpp"
|
||||
--- a/src/options.hpp
|
||||
+++ b/src/options.hpp
|
||||
@@ -305,7 +305,7 @@ int do_getsockopt (void *const optval_,
|
||||
template <typename T>
|
||||
int do_getsockopt (void *const optval_, size_t *const optvallen_, T value_)
|
||||
{
|
||||
-#if __cplusplus >= 201103L && (!defined(__GNUC__) || __GNUC__ > 5)
|
||||
+#if __cplusplus >= 201103L && !defined(__UCLIBCXX_MAJOR__) && (!defined(__GNUC__) || __GNUC__ > 5)
|
||||
static_assert (std::is_trivially_copyable<T>::value,
|
||||
"invalid use of do_getsockopt");
|
||||
#endif
|
||||
--- a/src/radio.cpp
|
||||
+++ b/src/radio.cpp
|
||||
@@ -126,7 +126,7 @@ void zmq::radio_t::xpipe_terminated (pipe_t *pipe_)
|
||||
end = _subscriptions.end ();
|
||||
it != end;) {
|
||||
if (it->second == pipe_) {
|
||||
-#if __cplusplus >= 201103L
|
||||
+#if __cplusplus >= 201103L && !defined(__UCLIBCXX_MAJOR__)
|
||||
it = _subscriptions.erase (it);
|
||||
#else
|
||||
_subscriptions.erase (it++);
|
|
@ -1,40 +0,0 @@
|
|||
--- a/src/metadata.hpp
|
||||
+++ b/src/metadata.hpp
|
||||
@@ -41,7 +41,11 @@ namespace zmq
|
||||
{
|
||||
public:
|
||||
|
||||
+#ifdef __UCLIBCXX_MAJOR__
|
||||
+ typedef std::map <std::string, std::string> dict_t;
|
||||
+#else
|
||||
typedef std::map <std::string, const std::string> dict_t;
|
||||
+#endif
|
||||
|
||||
metadata_t (const dict_t &dict);
|
||||
virtual ~metadata_t ();
|
||||
--- a/src/stream_engine.cpp
|
||||
+++ b/src/stream_engine.cpp
|
||||
@@ -208,7 +208,11 @@ void zmq::stream_engine_t::plug (io_thread_t *io_thread_,
|
||||
// Compile metadata.
|
||||
typedef metadata_t::dict_t properties_t;
|
||||
properties_t properties;
|
||||
+#ifdef __UCLIBCXX_MAJOR__
|
||||
+ properties.insert(std::make_pair<std::string, std::string>("Peer-Address", peer_address));
|
||||
+#else
|
||||
properties.insert(std::make_pair("Peer-Address", peer_address));
|
||||
+#endif
|
||||
zmq_assert (metadata == NULL);
|
||||
metadata = new (std::nothrow) metadata_t (properties);
|
||||
}
|
||||
@@ -824,7 +828,11 @@ void zmq::stream_engine_t::mechanism_ready ()
|
||||
|
||||
// If we have a peer_address, add it to metadata
|
||||
if (!peer_address.empty()) {
|
||||
+#ifdef __UCLIBCXX_MAJOR__
|
||||
+ properties.insert(std::make_pair<std::string, std::string>("Peer-Address", peer_address));
|
||||
+#else
|
||||
properties.insert(std::make_pair("Peer-Address", peer_address));
|
||||
+#endif
|
||||
}
|
||||
|
||||
// Add ZAP properties.
|
|
@ -1,10 +0,0 @@
|
|||
--- a/src/blob.hpp
|
||||
+++ b/src/blob.hpp
|
||||
@@ -31,6 +31,7 @@
|
||||
#define __ZMQ_BLOB_HPP_INCLUDED__
|
||||
|
||||
#include <string>
|
||||
+#include <ios>
|
||||
#include <string.h>
|
||||
|
||||
// Borrowed from id3lib_strings.h:
|
|
@ -1,11 +0,0 @@
|
|||
--- a/src/blob.hpp
|
||||
+++ b/src/blob.hpp
|
||||
@@ -38,7 +38,7 @@
|
||||
// They seem to be doing something for MSC, but since I only have gcc, I'll just do that
|
||||
// Assuming this is uneccessary on GCC 4
|
||||
// #if (defined(__GNUC__) && (__GNUC__ >= 3) || (defined(_MSC_VER) && _MSC_VER > 1000))
|
||||
-#if (defined(__GNUC__) && (__GNUC__ >= 3) && (__GNUC__ <= 4))
|
||||
+#if (defined(__GNUC__) && (__GNUC__ >= 3))
|
||||
namespace std
|
||||
{
|
||||
template<>
|
|
@ -1,54 +0,0 @@
|
|||
--- a/src/signaler.cpp
|
||||
+++ b/src/signaler.cpp
|
||||
@@ -86,7 +86,8 @@ static int sleep_ms (unsigned int ms_)
|
||||
usleep (ms_ * 1000);
|
||||
return 0;
|
||||
#else
|
||||
- return usleep (ms_ * 1000);
|
||||
+ const struct timespec req = {0, (long int)ms_ * 1000 * 1000};
|
||||
+ return nanosleep (&req, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
--- a/src/tcp_address.cpp
|
||||
+++ b/src/tcp_address.cpp
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
+#include <ctime>
|
||||
|
||||
#include "tcp_address.hpp"
|
||||
#include "platform.hpp"
|
||||
@@ -194,7 +195,8 @@ int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_
|
||||
rc = getifaddrs (&ifa);
|
||||
if (rc == 0 || (rc < 0 && errno != ECONNREFUSED))
|
||||
break;
|
||||
- usleep ((backoff_msec << i) * 1000);
|
||||
+ const struct timespec req = {0, (backoff_msec << i) * 1000 * 1000};
|
||||
+ nanosleep (&req, NULL);
|
||||
}
|
||||
errno_assert (rc == 0);
|
||||
zmq_assert (ifa != NULL);
|
||||
--- a/src/zmq.cpp
|
||||
+++ b/src/zmq.cpp
|
||||
@@ -692,7 +692,8 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
|
||||
usleep (timeout_ * 1000);
|
||||
return 0;
|
||||
#else
|
||||
- return usleep (timeout_ * 1000);
|
||||
+ const struct timespec req = {0, timeout_ * 1000 * 1000};
|
||||
+ return nanosleep (&req, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -852,7 +853,8 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
|
||||
Sleep (timeout_ > 0 ? timeout_ : INFINITE);
|
||||
return 0;
|
||||
#else
|
||||
- return usleep (timeout_ * 1000);
|
||||
+ const struct timespec req = {0, timeout_ * 1000 * 1000};
|
||||
+ return nanosleep (&req, NULL);
|
||||
#endif
|
||||
}
|
||||
zmq::clock_t clock;
|
Loading…
Reference in a new issue