From ef30f8bf80cf2e4fc494cd8822c8097e1ce77f00 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 27 Jul 2020 22:00:42 -0700 Subject: [PATCH] zmq: update to 4.3.2 Remove upstreamed patches. Add uClibc++ patch for those that need it. Signed-off-by: Rosen Penev (cherry picked from commit e169e2f9c8f34347085fe120fd1960dba4d9f40d) --- libs/zmq/Makefile | 9 +- libs/zmq/patches/010-cmake.patch | 20 ---- libs/zmq/patches/010-uclibcxx.patch | 92 +++++++++++++++++++ ...0-map_with_const_string_with_ublic++.patch | 40 -------- .../030-streamoff_missing_with_ulibc++.patch | 10 -- .../040-fix_GNUC_conditional_for_GCC5.patch | 11 --- libs/zmq/patches/050-nanosleep.patch | 54 ----------- 7 files changed, 97 insertions(+), 139 deletions(-) delete mode 100644 libs/zmq/patches/010-cmake.patch create mode 100644 libs/zmq/patches/010-uclibcxx.patch delete mode 100644 libs/zmq/patches/020-map_with_const_string_with_ublic++.patch delete mode 100644 libs/zmq/patches/030-streamoff_missing_with_ulibc++.patch delete mode 100644 libs/zmq/patches/040-fix_GNUC_conditional_for_GCC5.patch delete mode 100644 libs/zmq/patches/050-nanosleep.patch diff --git a/libs/zmq/Makefile b/libs/zmq/Makefile index 3811dd4a15..2e9778429b 100644 --- a/libs/zmq/Makefile +++ b/libs/zmq/Makefile @@ -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 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 \ diff --git a/libs/zmq/patches/010-cmake.patch b/libs/zmq/patches/010-cmake.patch deleted file mode 100644 index 712edaa686..0000000000 --- a/libs/zmq/patches/010-cmake.patch +++ /dev/null @@ -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}) diff --git a/libs/zmq/patches/010-uclibcxx.patch b/libs/zmq/patches/010-uclibcxx.patch new file mode 100644 index 0000000000..75d5feec23 --- /dev/null +++ b/libs/zmq/patches/010-uclibcxx.patch @@ -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 . + */ +- +-#if __cplusplus >= 201103L ++#include ++#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 + #include + +-#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 +-#include ++#include ++#include + + #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 + 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::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++); diff --git a/libs/zmq/patches/020-map_with_const_string_with_ublic++.patch b/libs/zmq/patches/020-map_with_const_string_with_ublic++.patch deleted file mode 100644 index a00716060b..0000000000 --- a/libs/zmq/patches/020-map_with_const_string_with_ublic++.patch +++ /dev/null @@ -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 dict_t; -+#else - typedef std::map 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("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("Peer-Address", peer_address)); -+#else - properties.insert(std::make_pair("Peer-Address", peer_address)); -+#endif - } - - // Add ZAP properties. diff --git a/libs/zmq/patches/030-streamoff_missing_with_ulibc++.patch b/libs/zmq/patches/030-streamoff_missing_with_ulibc++.patch deleted file mode 100644 index 8c137c8c54..0000000000 --- a/libs/zmq/patches/030-streamoff_missing_with_ulibc++.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/blob.hpp -+++ b/src/blob.hpp -@@ -31,6 +31,7 @@ - #define __ZMQ_BLOB_HPP_INCLUDED__ - - #include -+#include - #include - - // Borrowed from id3lib_strings.h: diff --git a/libs/zmq/patches/040-fix_GNUC_conditional_for_GCC5.patch b/libs/zmq/patches/040-fix_GNUC_conditional_for_GCC5.patch deleted file mode 100644 index dea9b480ee..0000000000 --- a/libs/zmq/patches/040-fix_GNUC_conditional_for_GCC5.patch +++ /dev/null @@ -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<> diff --git a/libs/zmq/patches/050-nanosleep.patch b/libs/zmq/patches/050-nanosleep.patch deleted file mode 100644 index 5e48c07534..0000000000 --- a/libs/zmq/patches/050-nanosleep.patch +++ /dev/null @@ -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 - #include -+#include - - #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; -- 2.30.2