libntirpc 1.6.0 GA

Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
This commit is contained in:
Kaleb S. KEITHLEY 2018-01-17 11:19:58 -05:00
parent 1da720aa3a
commit b363fda0fb
9 changed files with 59 additions and 196 deletions

View File

@ -1,47 +0,0 @@
From 21ff8f02500477bda460cb5a5b363dacd97ef360 Mon Sep 17 00:00:00 2001
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
Date: Thu, 19 Oct 2017 12:01:14 -0400
Subject: [PATCH] At the time of this writing, glibc-2.26 has a bug where
sysconf(_SC_IOV_MAX); always returns -1.
Versions known to have this bug are glibc-2.26-8 in Fedora 27 beta
and glibc-2.26.90-16 in Fedora 28 rawhide.
Upstream glibc BZ at
https://sourceware.org/bugzilla/show_bug.cgi?id=22321
Linux does have a limit on the size of the iovec that is passed in
readv/writev syscalls; defined as UIO_MAXIOV (i.e. 1024) in
.../include/uapi/linux/uio.h. See kernel source readv/writev syscalls.
It's also possible to get _XOPEN_IOV_MAX (i.e. 16) and IOV_MAX (1024)
by wrapping <limits.h> with #define __USE_XOPEN ... #undef but that's
XOpen and theoretically Linux could change.
---
src/svc.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/svc.c b/src/svc.c
index 9ca5b791..eec79604 100644
--- a/src/svc.c
+++ b/src/svc.c
@@ -227,7 +227,15 @@ svc_init(svc_init_params *params)
mutex_unlock(&__svc_params->mtx);
#if defined(_SC_IOV_MAX) /* IRIX, MacOS X, FreeBSD, Solaris, ... */
- __svc_maxiov = sysconf(_SC_IOV_MAX);
+ {
+ /*
+ * some glibc (e.g. 2.26 in Fedora 27 beta) always
+ * return -1
+ */
+ int i = sysconf(_SC_IOV_MAX);
+ if (i != -1 && i > __svc_maxiov)
+ __svc_maxiov = i;
+ }
#endif
return true;
}
--
2.13.5

49
0001-libnsl2.patch Normal file
View File

@ -0,0 +1,49 @@
--- ntirpc-1.6.0/CMakeLists.txt.orig 2018-01-17 08:30:42.506183812 -0500
+++ ntirpc-1.6.0/CMakeLists.txt 2018-01-17 11:08:33.232183812 -0500
@@ -153,14 +153,14 @@
# Find misc system libs
find_library(LIBRT rt) # extended Pthreads functions
-find_library(LIBNSL nsl) # sockets
+find_package(NSL) # sockets
set(SYSTEM_LIBRARIES
${LIBTIRPC_LIBRARIES}
${KRB5_LIBRARIES}
${SYSTEM_LIBRARIES}
${LIBRT}
- ${LIBNSL}
+ ${NSL_LIBRARY}
)
set(LIBNTIRPC_MAP "${PROJECT_BINARY_DIR}/src/libntirpc.map")
--- /dev/null 2018-01-12 15:32:04.693000000 -0500
+++ ntirpc-1.6.0/cmake/modules/FindNSL.cmake 2018-01-17 11:09:30.624183812 -0500
@@ -0,0 +1,27 @@
+# - Find NSL
+#
+# This module defines the following variables:
+# NSL_FOUND = Was NSL found or not?
+#
+# On can set NSL_PATH_HINT before using find_package(NSL) and the
+# module with use the PATH as a hint to find NSL.
+#
+# The hint can be given on the command line too:
+# cmake -DNSL_PATH_HINT=/DATA/ERIC/NSL /path/to/source
+
+#find_path(NSL_INCLUDE_DIR
+ #NAMES yp.h
+ #PATHS ${NSL_HINT_PATH}
+ #PATH_SUFFIXES nsl/rpcsvc
+ #DOC "The NSL include headers")
+
+find_library(NSL_LIBRARY nsl PATH_SUFFIXES nsl)
+
+# handle the QUIETLY and REQUIRED arguments and set PRELUDE_FOUND to TRUE if
+# all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+#FIND_PACKAGE_HANDLE_STANDARD_ARGS(NSL REQUIRED_VARS NSL_INCLUDE_DIR NSL_LIBRARY)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(NSL REQUIRED_VARS NSL_LIBRARY)
+
+mark_as_advanced(NSL_INCLUDE_DIR)
+mark_as_advanced(NSL_LIBRARY)

View File

@ -1,42 +0,0 @@
--- ntirpc-1.2.1/src/CMakeLists.txt.orig 2015-07-16 11:03:14.229249461 -0400
+++ ntirpc-1.2.1/src/CMakeLists.txt 2015-07-16 11:06:01.195249461 -0400
@@ -6,10 +6,11 @@
)
# XXX FreeBSD?
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+set(CMAKE_C_FLAGS "-fPIC -isystem ${PROJECT_SOURCE_DIR}/ntirpc ${CMAKE_C_FLAGS}")
include_directories(
- ${PROJECT_SOURCE_DIR}/tirpc
+ ${PROJECT_SOURCE_DIR}/ntirpc
)
########### next target ###############
@@ -109,10 +110,15 @@
svc_msk.c
xdr_msk.c
)
+ add_definitions(-DUSE_RPC_RDMA)
endif(USE_NFS_MSK)
+if(TIRPC_EPOLL)
+ add_definitions(-DTIRPC_EPOLL)
+endif(TIRPC_EPOLL)
+
# declares the library
-add_library(ntirpc STATIC
+add_library(ntirpc
${ntirpc_common_SRCS}
${ntirpc_des_SRCS}
${ntirpc_gss_SRCS}
@@ -124,7 +130,7 @@
target_link_libraries(ntirpc ${CMAKE_THREAD_LIBS_INIT})
# fixme!
-set_target_properties(ntirpc PROPERTIES VERSION 4.2.0 SOVERSION 4)
+set_target_properties(ntirpc PROPERTIES VERSION 1.2.1 SOVERSION 1)
install(TARGETS ntirpc DESTINATION bin)
########### install files ###############

View File

@ -1,71 +0,0 @@
--- ntirpc-1.3.0/CMakeLists.txt.standalone.orig 2015-09-09 12:31:57.130344661 -0400
+++ ntirpc-1.3.0/CMakeLists.txt.standalone 2015-09-09 12:42:32.016344661 -0400
@@ -33,6 +33,8 @@
option (USE_GSS "enable RPCSEC_GSS support" ON)
+option (USE_NFS_RDMA "enable NFS_RDMA support" ON)
+
option(TIRPC_EPOLL "platform supports EPOLL or emulation" ON)
# MSPAC support -lwbclient link flag
@@ -148,6 +150,11 @@
"platform has EPOLL or emulation"
FORCE)
+set(USE_NFS_RDMA ${USE_NFS_RDMA}
+ CACHE BOOL
+ "platform has RDMA"
+ FORCE)
+
# grist files
configure_file(
"${PROJECT_SOURCE_DIR}/config-h.in.cmake"
--- ntirpc-1.3.0/src/CMakeLists.txt.orig 2015-09-08 21:28:58.178344661 -0400
+++ ntirpc-1.3.0/src/CMakeLists.txt 2015-09-09 12:35:52.867344661 -0400
@@ -6,10 +6,11 @@
)
# ok on Linux and FreeBSD w/GCC and clang compilers
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+set(CMAKE_C_FLAGS "-fPIC -isystem ${PROJECT_SOURCE_DIR}/ntirpc ${CMAKE_C_FLAGS}")
include_directories(
- ${PROJECT_SOURCE_DIR}/tirpc
+ ${PROJECT_SOURCE_DIR}/ntirpc
)
########### next target ###############
@@ -110,8 +111,13 @@
svc_rdma.c
xdr_rdma.c
)
+ add_definitions(-DUSE_RPC_RDMA)
endif(USE_NFS_RDMA)
+if(TIRPC_EPOLL)
+ add_definitions(-DTIRPC_EPOLL)
+endif(TIRPC_EPOLL)
+
# declares the library
add_library(ntirpc SHARED
${ntirpc_common_SRCS}
@@ -126,11 +132,16 @@
# set library version and symbol namespace(s) from gen'd map file
set_target_properties(ntirpc PROPERTIES LINK_FLAGS
- "-Wl,--version-script=${LIBNTIRPC_MAP}"
+ "-Wl,--version-script=${PROJECT_SOURCE_DIR}/src/libntirpc.map"
VERSION ${NTIRPC_VERSION}
SOVERSION "${NTIRPC_MAJOR_VERSION}.${NTIRPC_MINOR_VERSION}"
)
+configure_file(
+ "${PROJECT_SOURCE_DIR}/src/libntirpc.map.in.cmake"
+ "${PROJECT_SOURCE_DIR}/src/libntirpc.map"
+)
+
install(TARGETS ntirpc DESTINATION ${LIB_INSTALL_DIR})
########### install files ###############

View File

@ -1,11 +0,0 @@
--- ntirpc-1.4.1/CMakeLists.txt.orig 2016-09-20 07:38:29.503597713 -0400
+++ ntirpc-1.4.1/CMakeLists.txt 2016-09-20 07:41:51.190597713 -0400
@@ -15,7 +15,7 @@
# version numbers
set(NTIRPC_MAJOR_VERSION 1)
set(NTIRPC_MINOR_VERSION 4)
-set(NTIRPC_PATCH_LEVEL 0)
+set(NTIRPC_PATCH_LEVEL 1)
set(VERSION_COMMENT
"Full-duplex and bi-directional ONC RPC on TCP."
)

View File

@ -1,11 +0,0 @@
--- ntirpc-1.4.2/CMakeLists.txt.orig 2016-09-20 07:38:29.503597713 -0400
+++ ntirpc-1.4.2/CMakeLists.txt 2016-09-20 07:41:51.190597713 -0400
@@ -15,7 +15,7 @@
# version numbers
set(NTIRPC_MAJOR_VERSION 1)
set(NTIRPC_MINOR_VERSION 4)
-set(NTIRPC_PATCH_LEVEL 0)
+set(NTIRPC_PATCH_LEVEL 2)
set(VERSION_COMMENT
"Full-duplex and bi-directional ONC RPC on TCP."
)

View File

@ -2,18 +2,21 @@
%global _hardened_build 1
Name: libntirpc
Version: 1.5.3
Release: 4%{?dev:%{dev}}%{?dist}
Version: 1.6.0
Release: 1%{?dev:%{dev}}%{?dist}
Summary: New Transport Independent RPC Library
Group: System Environment/Libraries
License: BSD
Url: https://github.com/nfs-ganesha/ntirpc
Source0: https://github.com/nfs-ganesha/ntirpc/archive/v%{version}/ntirpc-%{version}.tar.gz
Patch0: 0001-At-the-time-of-this-writing-glibc-2.26-has-a-bug-whe.patch
Patch0: 0001-libnsl2.patch
BuildRequires: cmake
BuildRequires: krb5-devel
%if ( 0%{?fedora} && 0%{?fedora} > 27 )
BuildRequires: libnsl2-devel
%endif
# libtirpc has /etc/netconfig, most machines probably have it anyway
# for NFS client
Requires: libtirpc
@ -74,6 +77,9 @@ install -p -m 644 libntirpc.pc %{buildroot}%{_libdir}/pkgconfig/
%{_libdir}/pkgconfig/libntirpc.pc
%changelog
* Wed Jan 17 2018 Kaleb S. KEITHLEY <kkeithle at redhat.com> 1.6.0-1
- libntirpc 1.6.0 GA
* Thu Oct 19 2017 Kaleb S. KEITHLEY <kkeithle at redhat.com> 1.5.3-4
- libntirpc 1.5.3 PR https://github.com/nfs-ganesha/ntirpc/pull/85

View File

@ -1,10 +0,0 @@
--- ntirpc-1.3.0/config-h.in.cmake.orig 2015-10-09 13:35:16.137664072 -0400
+++ ntirpc-1.3.0/config-h.in.cmake 2015-10-09 13:41:34.648664072 -0400
@@ -25,6 +25,7 @@
#cmakedefine HAVE_STRINGS_H 1
#cmakedefine LITTLEEND 1
#cmakedefine BIGEND 1
+#cmakedefine TIRPC_EPOLL 1
/* Package stuff */
#define PACKAGE "libntirpc"

View File

@ -1 +1 @@
SHA512 (ntirpc-1.5.3.tar.gz) = fecb7ebf86f9a5c5fe3db0c4ff93b40a41d1d3b27bfc536f8f3c5f1e090e9bff2cb224b84da9daec10c036d4d8c1707fbc4fb3f164936b49435cf5e6bb203eb5
SHA512 (ntirpc-1.6.0.tar.gz) = 22e631b758f2f3b85a0f18cd0ec340324a4b906306d0fe23aa7a6a5083c25388064ade8de78aadbd9503ccec3ce79319d1b73006ec981d3906669fcdb060eb55