tags 799235 patch
usertag 799235 hurd
user [email protected]
thanks
Source: zeromq3
Version: 4.0.5+dfsg-3
Severity: important
Justification: fails to build from source
Hello,
The attached patch adds support for zeromq3 on GNU/Hurd. Two tests
fails causing ssh to hang and crashes a translator in a hurd terminal:
test_pair_ipc and test_reqrep_ipc. Partial problems with these tests
are that option SO_ERROR is not yet supported for gsetsockopt() on
Hurd.
Investigation is ongoing. This is reflected in tests/Makefile.am which
excludes these tests.
Are these tests crucial for rsyslog to work correctly with czmq?
Thanks!
Index: zeromq3-4.0.5+dfsg/configure.ac
===================================================================
--- zeromq3-4.0.5+dfsg.orig/configure.ac
+++ zeromq3-4.0.5+dfsg/configure.ac
@@ -115,6 +115,7 @@ libzmq_dso_visibility="yes"
libzmq_on_mingw32="no"
libzmq_on_android="no"
libzmq_on_linux="no"
+libzmq_on_gnu="no"
# Set some default features required by 0MQ code.
CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
@@ -122,6 +123,20 @@ CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $C
# For host type checks
AC_CANONICAL_HOST
+#For a working getsockopt() optname=SO_ERROR
+dnl AC_MSG_CHECKING([for getsockopt optname SO_ERROR)])
+dnl AC_TRY_COMPILE([
+dnl #include <sys/types.h>
+dnl #include <sys/socket.h>
+dnl ], [socklen_t t;], ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no)
+dnl if test "x$ac_cv_type_socklen_t" = "xyes"; then
+dnl AC_MSG_RESULT([yes])
+dnl AC_DEFINE(HAVE_SOCKLEN_T,1,
+dnl [Define if socklen_t is available])
+dnl else
+dnl AC_MSG_RESULT([no])
+dnl fi
+
# OS-specific tests
case "${host_os}" in
*linux*)
@@ -249,6 +264,17 @@ case "${host_os}" in
AC_MSG_ERROR([Building static libraries is not supported under Cygwin])
fi
;;
+ gnu*)
+ # Define on GNU/Hurd to enable all library features. Define if using a gnu compiler
+ if test "x$GXX" = "xyes"; then
+ CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
+ fi
+ AC_DEFINE(ZMQ_HAVE_GNU, 1, [Have GNU/Hurd OS])
+ libzmq_on_gnu="yes"
+ AC_CHECK_LIB(rt, sem_init)
+dnl AC_CHECK_LIB(uuid, uuid_generate, ,
+dnl [AC_MSG_ERROR([cannot link with -luuid, install uuid-dev.])])
+ ;;
*)
AC_MSG_ERROR([unsupported system: ${host_os}.])
;;
@@ -431,6 +457,7 @@ AM_CONDITIONAL(BUILD_PGM, test "x$libzmq
AM_CONDITIONAL(ON_MINGW, test "x$libzmq_on_mingw32" = "xyes")
AM_CONDITIONAL(ON_ANDROID, test "x$libzmq_on_android" = "xyes")
AM_CONDITIONAL(ON_LINUX, test "x$libzmq_on_linux" = "xyes")
+AM_CONDITIONAL(ON_GNU, test "x$libzmq_on_gnu" = "xyes")
# Checks for library functions.
AC_TYPE_SIGNAL
Index: zeromq3-4.0.5+dfsg/src/poller.hpp
===================================================================
--- zeromq3-4.0.5+dfsg.orig/src/poller.hpp
+++ zeromq3-4.0.5+dfsg/src/poller.hpp
@@ -73,6 +73,13 @@
#elif defined ZMQ_HAVE_CYGWIN
#define ZMQ_USE_SELECT
#include "select.hpp"
+#elif defined ZMQ_HAVE_GNU
+#define ZMQ_USE_SELECT
+#include "select.hpp"
+#if 0
+#define ZMQ_USE_POLL
+#include "poll.hpp"
+#endif
#else
#error Unsupported platform
#endif
Index: zeromq3-4.0.5+dfsg/tests/Makefile.am
===================================================================
--- zeromq3-4.0.5+dfsg.orig/tests/Makefile.am
+++ zeromq3-4.0.5+dfsg/tests/Makefile.am
@@ -43,10 +43,12 @@ noinst_PROGRAMS = test_system \
if !ON_MINGW
noinst_PROGRAMS += test_shutdown_stress \
- test_pair_ipc \
- test_reqrep_ipc \
test_timeo \
test_fork
+if !ON_GNU
+noinst_PROGRAMS += test_pair_ipc \
+ test_reqrep_ipc
+endif
endif
test_system_SOURCES = test_system.cpp
@@ -100,4 +102,8 @@ TESTS = $(noinst_PROGRAMS)
if !ON_LINUX
XFAIL_TESTS = test_abstract_ipc
+# Does just hang, no error exit, see above
+#if ON_GNU
+#XFAIL_TESTS += test_pair_ipc test_reqrep_ipc
+#endif
endif
Index: zeromq3-4.0.5+dfsg/src/ipc_connecter.cpp
===================================================================
--- zeromq3-4.0.5+dfsg.orig/src/ipc_connecter.cpp
+++ zeromq3-4.0.5+dfsg/src/ipc_connecter.cpp
@@ -249,10 +249,16 @@ zmq::fd_t zmq::ipc_connecter_t::connect
// Assert if the error was caused by 0MQ bug.
// Networking problems are OK. No need to assert.
errno = err;
+#if defined ZMQ_HAVE_GNU
+ errno_assert (errno == ECONNREFUSED || errno == ECONNRESET ||
+ errno == ETIMEDOUT || errno == EHOSTUNREACH ||
+ errno == ENETUNREACH || errno == ENETDOWN ||
+ errno == ENOPROTOOPT);
+#else
errno_assert (errno == ECONNREFUSED || errno == ECONNRESET ||
errno == ETIMEDOUT || errno == EHOSTUNREACH ||
errno == ENETUNREACH || errno == ENETDOWN);
-
+#endif
return retired_fd;
}
Index: zeromq3-4.0.5+dfsg/src/zmq.cpp
===================================================================
--- zeromq3-4.0.5+dfsg.orig/src/zmq.cpp
+++ zeromq3-4.0.5+dfsg/src/zmq.cpp
@@ -28,7 +28,7 @@
defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_SOLARIS ||\
defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_QNXNTO ||\
defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_AIX ||\
- defined ZMQ_HAVE_NETBSD
+ defined ZMQ_HAVE_NETBSD || defined ZMQ_HAVE_GNU
#define ZMQ_POLL_BASED_ON_POLL
#elif defined ZMQ_HAVE_WINDOWS || defined ZMQ_HAVE_OPENVMS ||\
defined ZMQ_HAVE_CYGWIN
Index: zeromq3-4.0.5+dfsg/src/proxy.cpp
===================================================================
--- zeromq3-4.0.5+dfsg.orig/src/proxy.cpp
+++ zeromq3-4.0.5+dfsg/src/proxy.cpp
@@ -30,7 +30,7 @@
defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_SOLARIS ||\
defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_QNXNTO ||\
defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_AIX ||\
- defined ZMQ_HAVE_NETBSD
+ defined ZMQ_HAVE_NETBSD || defined ZMQ_HAVE_GNU
#define ZMQ_POLL_BASED_ON_POLL
#elif defined ZMQ_HAVE_WINDOWS || defined ZMQ_HAVE_OPENVMS ||\
defined ZMQ_HAVE_CYGWIN
Index: zeromq3-4.0.5+dfsg/src/signaler.cpp
===================================================================
--- zeromq3-4.0.5+dfsg.orig/src/signaler.cpp
+++ zeromq3-4.0.5+dfsg/src/signaler.cpp
@@ -27,7 +27,7 @@
defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_SOLARIS ||\
defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_QNXNTO ||\
defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_AIX ||\
- defined ZMQ_HAVE_NETBSD
+ defined ZMQ_HAVE_NETBSD || defined ZMQ_HAVE_GNU
#define ZMQ_SIGNALER_WAIT_BASED_ON_POLL
#elif defined ZMQ_HAVE_WINDOWS || defined ZMQ_HAVE_OPENVMS ||\
defined ZMQ_HAVE_CYGWIN
Index: zeromq3-4.0.5+dfsg/src/tcp_address.cpp
===================================================================
--- zeromq3-4.0.5+dfsg.orig/src/tcp_address.cpp
+++ zeromq3-4.0.5+dfsg/src/tcp_address.cpp
@@ -146,7 +146,8 @@ int zmq::tcp_address_t::resolve_nic_name
#elif ((defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\
defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_OPENBSD ||\
- defined ZMQ_HAVE_QNXNTO || defined ZMQ_HAVE_NETBSD)\
+ defined ZMQ_HAVE_QNXNTO || defined ZMQ_HAVE_NETBSD ||\
+ defined ZMQ_HAVE_GNU)\
&& defined ZMQ_HAVE_IFADDRS)
#include <ifaddrs.h>