Unverified Commit 31b0a1df authored by Simon Giesecke's avatar Simon Giesecke Committed by GitHub

Merge pull request #3295 from bluca/hurd_freebsd_sun

Problem: build broken with Sun Studio, tests fail on debian/kfreebsd and debian/hurd, DRAFT zmq_poll is slow
parents 320741f2 25ded9e8
......@@ -303,6 +303,12 @@ src_libzmq_la_LDFLAGS = \
@LIBZMQ_EXTRA_LDFLAGS@ \
-Wl,--version-script=$(srcdir)/src/libzmq.vers
else
if ON_DEBIAN_KFREEBSD
src_libzmq_la_LDFLAGS = \
-version-info @LTVER@ \
@LIBZMQ_EXTRA_LDFLAGS@ \
-Wl,--version-script=$(srcdir)/src/libzmq.vers
else
src_libzmq_la_LDFLAGS = \
-version-info @LTVER@ \
@LIBZMQ_EXTRA_LDFLAGS@ \
......@@ -312,6 +318,7 @@ endif
endif
endif
endif
endif
src_libzmq_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) $(LIBUNWIND_CFLAGS)
src_libzmq_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(LIBUNWIND_CFLAGS)
......@@ -1014,6 +1021,7 @@ endif
if ON_GNU
XFAIL_TESTS += tests/test_ipc_wildcard \
tests/test_reqrep_ipc \
tests/test_term_endpoint
endif
......
......@@ -155,6 +155,7 @@ libzmq_on_cygwin="no"
libzmq_on_android="no"
libzmq_on_linux="no"
libzmq_on_gnu="no"
libzmq_on_debian_kfreebsd="no"
# Set some default features required by ZeroMQ code
CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE -Wno-long-long $CPPFLAGS"
......@@ -210,7 +211,7 @@ case "${host_os}" in
case "${host_os}" in
# On Debian/kFreeBSD with gnu set the --version-script flag
kfreebsd*-gnu*)
libzmq_on_gnu="yes"
libzmq_on_debian_kfreebsd="yes"
;;
esac
CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS"
......@@ -321,10 +322,11 @@ case "${host_os}" in
;;
esac
# Sun Studio does not like anonymous structures in unions
# Sun Studio does not like anonymous structures in unions and does not have weak attribute
if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
CXXFLAGS="${CXXFLAGS} -features=extensions"
CFLAGS="${CFLAGS} -features=extensions"
CPPFLAGS="${CPPFLAGS} -DUNITY_WEAK_PRAGMA"
fi
# Checks for libraries
......@@ -617,6 +619,7 @@ AM_CONDITIONAL(ON_CYGWIN, test "x$libzmq_on_cygwin" = "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")
AM_CONDITIONAL(ON_DEBIAN_KFREEBSD, test "x$libzmq_on_debian_kfreebsd" = "xyes")
# Check for __atomic_Xxx compiler intrinsics
AC_LANG_PUSH([C++])
......
This diff is collapsed.
......@@ -105,33 +105,6 @@ class session_base_t : public own_t, public io_object_t, public i_pipe_events
private:
void start_connecting (bool wait_);
typedef own_t *(session_base_t::*connecter_factory_fun_t) (
io_thread_t *io_thread, bool wait_);
typedef std::pair<std::string, connecter_factory_fun_t>
connecter_factory_entry_t;
static connecter_factory_entry_t _connecter_factories[];
typedef std::map<std::string, connecter_factory_fun_t>
connecter_factory_map_t;
static connecter_factory_map_t _connecter_factories_map;
own_t *create_connecter_vmci (io_thread_t *io_thread_, bool wait_);
own_t *create_connecter_tipc (io_thread_t *io_thread_, bool wait_);
own_t *create_connecter_ipc (io_thread_t *io_thread_, bool wait_);
own_t *create_connecter_tcp (io_thread_t *io_thread_, bool wait_);
typedef void (session_base_t::*start_connecting_fun_t) (
io_thread_t *io_thread);
typedef std::pair<std::string, start_connecting_fun_t>
start_connecting_entry_t;
static start_connecting_entry_t _start_connecting_entries[];
typedef std::map<std::string, start_connecting_fun_t>
start_connecting_map_t;
static start_connecting_map_t _start_connecting_map;
void start_connecting_pgm (io_thread_t *io_thread_);
void start_connecting_norm (io_thread_t *io_thread_);
void start_connecting_udp (io_thread_t *io_thread_);
void reconnect ();
// Handlers for incoming commands.
......
......@@ -798,12 +798,16 @@ inline int zmq_poller_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
{
// TODO: the function implementation can just call zmq_pollfd_poll with
// pollfd as NULL, however pollfd is not yet stable.
#if defined ZMQ_HAVE_POLLER
// if poller is present, use that.
return zmq_poller_poll (items_, nitems_, timeout_);
#else
// if poller is present, use that if there is at least 1 thread-safe socket,
// otherwise fall back to the previous implementation as it's faster.
for (int i = 0; i != nitems_; i++) {
if (items_[i].socket
&& as_socket_base_t (items_[i].socket)->is_thread_safe ()) {
return zmq_poller_poll (items_, nitems_, timeout_);
}
}
#endif // ZMQ_HAVE_POLLER
#if defined ZMQ_POLL_BASED_ON_POLL || defined ZMQ_POLL_BASED_ON_SELECT
if (unlikely (nitems_ < 0)) {
errno = EINVAL;
......@@ -1086,7 +1090,6 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
errno = ENOTSUP;
return -1;
#endif
#endif // ZMQ_HAVE_POLLER
}
// The poller functionality
......
......@@ -209,7 +209,7 @@ int main (void)
RUN_TEST (test_filter_with_current_process_pid);
RUN_TEST (test_filter_with_possibly_nonexistent_pid);
#else
RUN_TEST (test_filter_with_pid_fails ());
RUN_TEST (test_filter_with_pid_fails);
#endif
#else
RUN_TEST (test_filter_with_zero_uid_fails);
......
......@@ -274,7 +274,7 @@ void test_inproc ()
TEST_ASSERT_EQUAL_INT (6000, test_blocking (2000, 6000, "inproc://c"));
}
#ifndef ZMQ_HAVE_WINDOWS
#if !defined(ZMQ_HAVE_WINDOWS) && !defined(ZMQ_HAVE_GNU)
void test_ipc ()
{
......@@ -295,7 +295,7 @@ int main ()
RUN_TEST (test_tcp);
RUN_TEST (test_inproc);
#ifndef ZMQ_HAVE_WINDOWS
#if !defined(ZMQ_HAVE_WINDOWS) && !defined(ZMQ_HAVE_GNU)
RUN_TEST (test_ipc);
#endif
RUN_TEST (test_reset_hwm);
......
......@@ -68,7 +68,7 @@ void test_reconnect_ivl_against_pair_socket (const char *my_endpoint_,
test_context_socket_close (sc);
}
#ifndef ZMQ_HAVE_WINDOWS
#if !defined(ZMQ_HAVE_WINDOWS) && !defined(ZMQ_HAVE_GNU)
void test_reconnect_ivl_ipc (void)
{
const char *ipc_endpoint = "ipc:///tmp/test_reconnect_ivl";
......@@ -112,7 +112,7 @@ int main (void)
setup_test_environment ();
UNITY_BEGIN ();
#ifndef ZMQ_HAVE_WINDOWS
#if !defined(ZMQ_HAVE_WINDOWS) && !defined(ZMQ_HAVE_GNU)
RUN_TEST (test_reconnect_ivl_ipc);
#endif
RUN_TEST (test_reconnect_ivl_tcp_ipv4);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment