diff --git a/configure.ac b/configure.ac index 879ad1545..f79ec6431 100644 --- a/configure.ac +++ b/configure.ac @@ -26,12 +26,22 @@ dnl command line dnl Wrap in m4_ifdef to avoid breaking on older platforms m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) LT_PREREQ([2.2.6]) + +AC_CANONICAL_HOST + # --enable-new-dtags: Use RUNPATH instead of RPATH. # It is necessary to have this done before libtool does linker detection. # See also: https://github.com/kronosnet/kronosnet/issues/107 -AX_CHECK_LINK_FLAG([-Wl,--enable-new-dtags], - [AM_LDFLAGS=-Wl,--enable-new-dtags], - [AC_MSG_ERROR(["Linker support for --enable-new-dtags is required"])]) +case "$host_os" in + solaris*) + AC_MSG_NOTICE([Skipping --enable-new-dtags check, Solaris' RPATH logic is like RUNPATH on other platforms]) + ;; + *) + AX_CHECK_LINK_FLAG([-Wl,--enable-new-dtags], + [AM_LDFLAGS=-Wl,--enable-new-dtags], + [AC_MSG_ERROR(["Linker support for --enable-new-dtags is required"])]) + ;; +esac AC_SUBST([AM_LDFLAGS]) saved_LDFLAGS="$LDFLAGS" LDFLAGS="$AM_LDFLAGS $LDFLAGS" diff --git a/doxygen2man/doxygen2man.c b/doxygen2man/doxygen2man.c index 319796782..f8e1f2bc1 100644 --- a/doxygen2man/doxygen2man.c +++ b/doxygen2man/doxygen2man.c @@ -20,6 +20,8 @@ #define _GNU_SOURCE #define _XOPEN_SOURCE #define _XOPEN_SOURCE_EXTENDED +#define _XPG4_2 +#define _XPG7 #include #include #include diff --git a/examples/ipcclient.c b/examples/ipcclient.c index 761eabb1b..5d6e90db7 100644 --- a/examples/ipcclient.c +++ b/examples/ipcclient.c @@ -61,7 +61,7 @@ _benchmark(qb_ipcc_connection_t *conn, int write_size) hdr.size = write_size; hdr.id = QB_IPC_MSG_USER_START + 1; - iov[0].iov_base = &hdr; + iov[0].iov_base = (void*)&hdr; iov[0].iov_len = sizeof(struct qb_ipc_request_header); iov[1].iov_base = data; diff --git a/examples/ipcserver.c b/examples/ipcserver.c index d6828ff35..d96bcf7f0 100644 --- a/examples/ipcserver.c +++ b/examples/ipcserver.c @@ -130,7 +130,7 @@ s1_msg_process_fn(qb_ipcs_connection_t * c, void *data, size_t size) sl = snprintf(resp, 100, "ACK %zu bytes", size) + 1; iov[0].iov_len = sizeof(response); - iov[0].iov_base = &response; + iov[0].iov_base = (void*)&response; iov[1].iov_len = sl; iov[1].iov_base = resp; response.size += sl; @@ -365,7 +365,7 @@ main(int32_t argc, char *argv[]) qb_log_format_set(QB_LOG_STDERR, "%f:%l [%p] %b"); qb_log_ctl(QB_LOG_STDERR, QB_LOG_CONF_ENABLED, QB_TRUE); - s1 = qb_ipcs_create("ipcserver", 0, ipc_type, &sh); + s1 = qb_ipcs_create("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, ipc_type, &sh); if (s1 == 0) { qb_perror(LOG_ERR, "qb_ipcs_create"); exit(1); diff --git a/lib/ipc_setup.c b/lib/ipc_setup.c index cec92f43b..07c8466ec 100644 --- a/lib/ipc_setup.c +++ b/lib/ipc_setup.c @@ -433,7 +433,7 @@ init_ipc_auth_data(int sock, size_t len) #endif /* QB_SOLARIS */ data->len = len; - data->iov_recv.iov_base = &data->msg; + data->iov_recv.iov_base = (void *)&data->msg; data->iov_recv.iov_len = data->len; data->sock = sock; diff --git a/lib/unix.c b/lib/unix.c index 6bd3cc247..dfbf53e43 100644 --- a/lib/unix.c +++ b/lib/unix.c @@ -69,7 +69,7 @@ open_mmap_file(char *path, uint32_t file_flags) return open(path, file_flags, 0600); } -#if defined(QB_BSD) || !defined(HAVE_POSIX_FALLOCATE) +#if defined(QB_BSD) || defined(QB_SOLARIS) || !defined(HAVE_POSIX_FALLOCATE) static int local_fallocate(int fd, size_t bytes) { long page_size = sysconf(_SC_PAGESIZE); @@ -170,7 +170,7 @@ qb_sys_mmap_file_open(char *path, const char *file, size_t bytes, if (res == EINTR) { qb_util_log(LOG_DEBUG, "got EINTR trying to allocate file %s, retrying...", path); continue; -#ifdef QB_BSD +#if defined (QB_BSD) || defined(QB_SOLARIS) } else if (res == EINVAL) { /* posix_fallocate() fails on ZFS https://lists.freebsd.org/pipermail/freebsd-current/2018-February/068448.html */ qb_util_log(LOG_DEBUG, "posix_fallocate returned EINVAL - running on ZFS?"); diff --git a/tests/check_ipc.c b/tests/check_ipc.c index aba170964..d2d59e611 100644 --- a/tests/check_ipc.c +++ b/tests/check_ipc.c @@ -226,6 +226,10 @@ set_ipc_name(const char *prefix) f = fopen(IPC_TEST_NAME_FILE, "r"); if (f) { fgets(process_name, sizeof(process_name), f); + /* Remove any trailing LF that might be lurking */ + if (process_name[strlen(process_name)-1] == '\n') { + process_name[strlen(process_name)-1] = '\0'; + } fclose(f); snprintf(ipc_name, sizeof(ipc_name), "%.44s%s", prefix, process_name); } else { @@ -890,7 +894,7 @@ request_server_exit(void) req_header.size = sizeof(struct qb_ipc_request_header); iov[0].iov_len = req_header.size; - iov[0].iov_base = &req_header; + iov[0].iov_base = (void*)&req_header; ck_assert_int_eq(QB_TRUE, qb_ipcc_is_connected(conn)); @@ -1048,7 +1052,7 @@ static void test_ipc_connect_async(void) req_header.size = sizeof(struct qb_ipc_request_header); iov[0].iov_len = req_header.size; - iov[0].iov_base = &req_header; + iov[0].iov_base = (void*)&req_header; res = qb_ipcc_sendv_recv(conn, iov, 1, &res_header, @@ -1096,7 +1100,7 @@ test_ipc_txrx_timeout(void) req_header.size = sizeof(struct qb_ipc_request_header); iov[0].iov_len = req_header.size; - iov[0].iov_base = &req_header; + iov[0].iov_base = (void*)&req_header; res = qb_ipcc_sendv_recv(conn, iov, 1, &res_header, @@ -1234,7 +1238,7 @@ test_ipc_exit(void) req_header.size = sizeof(struct qb_ipc_request_header); iov[0].iov_len = req_header.size; - iov[0].iov_base = &req_header; + iov[0].iov_base = (void*)&req_header; res = qb_ipcc_sendv_recv(conn, iov, 1, &res_header, @@ -1306,7 +1310,7 @@ END_TEST START_TEST(test_ipc_us_connect_async) { qb_enter(); - ipc_type = QB_IPC_SHM; + ipc_type = QB_IPC_SOCKET; set_ipc_name(__func__); test_ipc_connect_async(); qb_leave(); @@ -1729,7 +1733,7 @@ test_ipc_stress_test(void) } iov[0].iov_len = giant_req.hdr.size; - iov[0].iov_base = &giant_req; + iov[0].iov_base = (void*)&giant_req; res = qb_ipcc_sendv_recv(conn, iov, 1, &res_header, sizeof(struct qb_ipc_response_header), -1); @@ -1949,7 +1953,7 @@ test_ipc_disconnect_after_created(void) req_header.size = sizeof(struct qb_ipc_request_header); iov[0].iov_len = req_header.size; - iov[0].iov_base = &req_header; + iov[0].iov_base = (void*)&req_header; res = qb_ipcc_sendv_recv(conn, iov, 1, &res_header, diff --git a/tests/start.test b/tests/start.test index a02357a32..3b270d7d5 100755 --- a/tests/start.test +++ b/tests/start.test @@ -8,8 +8,8 @@ # testname=$(echo `uuidgen | sed -e "s#-.*##g"`-`date +%s`) -echo -n $testname > ipc-test-name +echo $testname > ipc-test-name testname=$(echo `uuidgen | sed -e "s#-.*##g"`-`date +%s`) -echo -n $testname > ipc-test-name-sock +echo $testname > ipc-test-name-sock mkdir -p $SOCKETDIR