summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2018-01-18 15:57:33 -0500
committerKaleb S. KEITHLEY <kkeithle@redhat.com>2018-01-25 10:56:37 -0500
commit8c32648d0d4034fb301168e11eadaf0827eb971d (patch)
tree8759646d26c587d8f148e004bd0ad10993c02549
parentee067308c35bf0c0c7509be4931182926617d2f2 (diff)
build: glibc has removed rpc headers and rpcgen in Fedora28, use libtirpc
Other Linux distributions are doing the same; some have already done so. Switch to libtirpc(-devel) and unbundled rpcgen packages. For now rpcgen is still provided by the glibc-rpcgen RPM, but rpcsvc-proto's rpcgen subpackage is available now; it will not be used until glibc-rpcgen is retired. (note, rpcsvc-proto's rpcgen is just named rpcgen-...rpm. I.e. not rpcsvc-proto-rpcgen-...rpm.) Either one will satisfy the BuildRequires: rpcgen. Also, when a .spec file has BuildRequires: foo-devel it is not necessary to also have: BuildRequires: foo or even: BuildRequires: foo foo-devel The foo-devel package has a dependency on foo, which will install foo automatically. It's usually also not necessary to have a corresponding Requires: foo as the rpmbuild process will also automatically determine the install-time dependencies. See also Change-Id: I4a8292de2eddad16137df5998334133fc1e11261 and/or https://review.gluster.org/19311 and Change-Id: I97dc39c7844f44c36fe210aa813480c219e1e415 and/or https://review.gluster.org/#/c/19330/ Change-Id: I86f847dfda0fef83e22c6e8b761342d652a2d9ba BUG: 1536187 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
-rw-r--r--api/src/Makefile.am2
-rw-r--r--configure.ac60
-rw-r--r--glusterfs.spec.in94
-rw-r--r--libglusterfs/src/Makefile.am2
-rw-r--r--rpc/xdr/src/Makefile.am2
5 files changed, 108 insertions, 52 deletions
diff --git a/api/src/Makefile.am b/api/src/Makefile.am
index 625183c8dbc..3d25823925b 100644
--- a/api/src/Makefile.am
+++ b/api/src/Makefile.am
@@ -21,7 +21,7 @@ AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src \
AM_CFLAGS = -Wall $(GF_CFLAGS)
-libgfapi_la_LDFLAGS = -version-info $(GFAPI_LT_VERSION) \
+libgfapi_la_LDFLAGS = -version-info $(GFAPI_LT_VERSION) $(GF_LDFLAGS) \
$(GFAPI_EXTRA_LDFLAGS) $(ACL_LIBS)
xlator_LTLIBRARIES = api.la
diff --git a/configure.ac b/configure.ac
index 14fc0b826bf..1706c5c9853 100644
--- a/configure.ac
+++ b/configure.ac
@@ -261,9 +261,9 @@ AC_CONFIG_FILES([Makefile
heal/Makefile
heal/src/Makefile
glusterfs.spec
- tools/glusterfind/src/tool.conf
- tools/glusterfind/glusterfind
- tools/glusterfind/Makefile
+ tools/glusterfind/src/tool.conf
+ tools/glusterfind/glusterfind
+ tools/glusterfind/Makefile
tools/glusterfind/src/Makefile
tools/setgfid2path/Makefile
tools/setgfid2path/src/Makefile])
@@ -293,16 +293,20 @@ else
CFLAGS="${CFLAGS} -g -rdynamic"
fi
-AC_ARG_WITH([ipv6-default], AC_HELP_STRING([--with-ipv6-default], [Set IPv6 as default.]))
-if test "x$with_ipv6_default" = "xyes"; then
- IPV6_DEFAULT=yes
-else
- IPV6_DEFAULT=no
-fi
+AC_ARG_WITH([libtirpc],
+ [AC_HELP_STRING([--without-libtirpc], [Use legacy glibc RPC.])],
+ [], [with_libtirpc=yes])
+AC_MSG_RESULT([$with_libtirpc])
+
+AC_ARG_WITH([ipv6-default],
+ AC_HELP_STRING([--with-ipv6-default], [Set IPv6 as default.]),
+ [with_ipv6_default=$with_libtirpc], [with_ipv6_default=no])
+AC_MSG_RESULT([$with_ipv6_default])
+
if test "x$ac_cv_file__etc_redhat_release" = "xyes"; then
if rpm -qa centos-release | grep centos; then
if rpm -q centos-release | grep "release-6"; then
- IPV6_DEFAULT=no;
+ with_ipv6_default=no
fi
fi
fi
@@ -1066,14 +1070,34 @@ AC_SUBST(GF_DISTRIBUTION)
GF_HOST_OS=""
GF_LDFLAGS="-rdynamic"
+DISABLE_LIBTIRPC=no
dnl include tirpc for IPv6 builds
-if test "x$IPV6_DEFAULT" = "xyes"; then
- AC_CHECK_LIB([tirpc], [xdr_string], , AC_MSG_ERROR([libtirpc is required to build glusterfs with IPv6 default]))
- TIRPC_CFLAGS="-I/usr/include/tirpc"
- GF_LDFLAGS="-ltirpc $GF_LDFLAGS"
- GF_CFLAGS="$GF_CFLAGS $TIRPC_CFLAGS -DIPV6_DEFAULT"
+if test "x$with_libtirpc" = "xyes" || test "x$with_ipv6_default" = "xyes" ; then
+ PKG_CHECK_MODULES([TIRPC], [libtirpc],
+ [GF_CFLAGS="$GF_CFLAGS $TIRPC_CFLAGS"; GF_LDFLAGS="$GF_LDFLAGS $TIRPC_LIBS";],
+ [DISABLE_LIBTIRPC=yes])
fi
+if test "x$DISABLE_LIBTIRPC" = "xyes" ; then
+ with_libtirpc=no; with_ipv6_default=no
+ AC_CHECK_HEADERS([rpc/rpc.h],[
+ AC_MSG_WARN([
+ ---------------------------------------------------------------------------------
+ libtirpc or ipv6-default were enabled (by default) but libtirpc-devel is not
+ installed. Disabling libtirpc and ipv6-default and using legacy glibc rpc headers
+ This is a transistional warning message. Eventually it will be an error message
+ ---------------------------------------------------------------------------------])],[
+ AC_MSG_ERROR([
+ ---------------------------------------------------------------------------------
+ libtirpc or ipv6-default were enabled (by default) but libtirpc-devel is not
+ installed and there were no legacy glibc rpc headers and library to fall back to.
+ ---------------------------------------------------------------------------------])])
+fi
+
+if test "x$with_ipv6_default" = "xyes" ; then
+ GF_CFLAGS="$GF_CFLAGS -DIPV6_DEFAULT"
+ fi
+
dnl check for gcc -Werror=format-security
saved_CFLAGS=$CFLAGS
CFLAGS="-Wformat -Werror=format-security"
@@ -1138,11 +1162,11 @@ fi
old_prefix=$prefix
if test "x$prefix" = xNONE; then
- prefix=$ac_default_prefix
+ prefix=$ac_default_prefix
fi
old_exec_prefix=$exec_prefix
if test "x$exec_prefix" = xNONE; then
- exec_prefix="$(eval echo $prefix)"
+ exec_prefix="$(eval echo $prefix)"
fi
GLUSTERFS_LIBEXECDIR="$(eval echo $libexecdir)/glusterfs"
GLUSTERFSD_MISCDIR="$(eval echo $prefix)/var/lib/misc/glusterfsd"
@@ -1613,4 +1637,6 @@ echo "EC dynamic support : $EC_DYNAMIC_SUPPORT"
echo "Use memory pools : $USE_MEMPOOL"
echo "Nanosecond m/atimes : $BUILD_NANOSECOND_TIMESTAMPS"
echo "Legacy gNFS server : $BUILD_GNFS"
+echo "IPV6 default : $with_ipv6_default"
+echo "Use TIRPC : $with_libtirpc"
echo
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index d6637336dcc..e25b7a40f93 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -9,39 +9,36 @@
## All argument definitions should be placed here and keep them sorted
##
-# if you wish to compile an rpm with debugging...
-# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --with debug
-%{?_with_debug:%global _with_debug --enable-debug}
-
-# if you wish to compile an rpm to run all processes under valgrind...
-# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --with valgrind
-%{?_with_valgrind:%global _with_valgrind --enable-valgrind}
+# bd
+# if you wish to compile an rpm without the BD map support...
+# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without bd
+%{?_without_bd:%global _without_bd --disable-bd-xlator}
-# if you wish to compile an rpm with IPv6 default...
-# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --with ipv6default
-%{?_with_ipv6default:%global _with_ipv6default --with-ipv6default}
+%if ( 0%{?rhel} && 0%{?rhel} < 6 || 0%{?sles_version} )
+%global _without_bd --disable-bd-xlator
+%endif
+# cmocka
# if you wish to compile an rpm with cmocka unit testing...
# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --with cmocka
%{?_with_cmocka:%global _with_cmocka --enable-cmocka}
-# if you wish to compile an rpm without rdma support, compile like this...
-# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without rdma
-%{?_without_rdma:%global _without_rdma --disable-ibverbs}
-
-# No RDMA Support on s390(x)
-%ifarch s390 s390x armv7hl
-%global _without_rdma --disable-ibverbs
-%endif
+# debug
+# if you wish to compile an rpm with debugging...
+# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --with debug
+%{?_with_debug:%global _with_debug --enable-debug}
+# epoll
# if you wish to compile an rpm without epoll...
# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without epoll
%{?_without_epoll:%global _without_epoll --disable-epoll}
+# fusermount
# if you wish to compile an rpm without fusermount...
# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without fusermount
%{?_without_fusermount:%global _without_fusermount --disable-fusermount}
+# geo-rep
# if you wish to compile an rpm without geo-replication support, compile like this...
# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without georeplication
%{?_without_georeplication:%global _without_georeplication --disable-georeplication}
@@ -51,14 +48,44 @@
%global _without_georeplication --disable-georeplication
%endif
+# gnfs
# if you wish to compile an rpm with the legacy gNFS server xlator
# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --with gnfs
%{?_with_gnfs:%global _with_gnfs --enable-gnfs}
+# ipv6default
+# if you wish to compile an rpm with IPv6 default...
+# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --with ipv6default
+%{?_with_ipv6default:%global _with_ipv6default --with-ipv6-default}
+
+# libtirpc
+# if you wish to compile an rpm without TIRPC (i.e. use legacy glibc rpc)
+# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without libtirpc
+%{?_without_libtirpc:%global _without_libtirpc --without-libtirpc}
+
+# Do not use libtirpc on EL6, it does not have xdr_uint64_t() and xdr_uint32_t
+# Do not use libtirpc on EL7, it does not have xdr_sizeof()
+%if ( 0%{?rhel} && 0%{?rhel} <= 7 )
+%global _without_libtirpc --without-libtirpc
+%endif
+
+
+# ocf
# if you wish to compile an rpm without the OCF resource agents...
# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without ocf
%{?_without_ocf:%global _without_ocf --without-ocf}
+# rdma
+# if you wish to compile an rpm without rdma support, compile like this...
+# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without rdma
+%{?_without_rdma:%global _without_rdma --disable-ibverbs}
+
+# No RDMA Support on s390(x)
+%ifarch s390 s390x armv7hl
+%global _without_rdma --disable-ibverbs
+%endif
+
+# syslog
# if you wish to build rpms without syslog logging, compile like this
# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without syslog
%{?_without_syslog:%global _without_syslog --disable-syslog}
@@ -71,19 +98,17 @@
%global _without_syslog --disable-syslog
%endif
-# if you wish to compile an rpm without the BD map support...
-# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without bd
-%{?_without_bd:%global _without_bd --disable-bd-xlator}
-
-%if ( 0%{?rhel} && 0%{?rhel} < 6 || 0%{?sles_version} )
-%global _without_bd --disable-bd-xlator
-%endif
-
+# tier
# Disable data-tiering on EL5, sqlite is too old
%if ( 0%{?rhel} && 0%{?rhel} < 6 )
%global _without_tiering --disable-tiering
%endif
+# valgrind
+# if you wish to compile an rpm to run all processes under valgrind...
+# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --with valgrind
+%{?_with_valgrind:%global _with_valgrind --enable-valgrind}
+
##-----------------------------------------------------------------------------
## All %%global definitions should be placed here and keep them sorted
##
@@ -219,8 +244,11 @@ BuildRequires: python2-devel
%if ( 0%{?fedora} && 0%{?fedora} < 26 ) || ( 0%{?rhel} )
BuildRequires: python-ctypes
%endif
-%if ( 0%{?_with_ipv6default:1} )
-BuildRequires: libtirpc libtirpc-devel
+%if ( 0%{?_with_ipv6default:1} ) || ( 0%{!?_without_libtirpc:1} )
+BuildRequires: libtirpc-devel
+%endif
+%if ( 0%{?fedora} && 0%{?fedora} > 27 )
+BuildRequires: rpcgen
%endif
BuildRequires: userspace-rcu-devel >= 0.7
%if ( 0%{?rhel} && 0%{?rhel} <= 6 )
@@ -560,9 +588,6 @@ Requires: %{name}-cli%{?_isa} = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
# some daemons (like quota) use a fuse-mount, glusterfsd is part of -fuse
Requires: %{name}-fuse%{?_isa} = %{version}-%{release}
-%if ( 0%{?_with_ipv6default:1} )
-Requires: libtirpc
-%endif
# self-heal daemon, rebalance, nfs-server etc. are actually clients
Requires: %{name}-api%{?_isa} = %{version}-%{release}
Requires: %{name}-client-xlators%{?_isa} = %{version}-%{release}
@@ -680,7 +705,8 @@ export CFLAGS
%{?_without_rdma} \
%{?_without_syslog} \
%{?_without_tiering} \
- %{?_with_ipv6default}
+ %{?_with_ipv6default} \
+ %{?_with_libtirpc}
# fix hardening and remove rpath in shlibs
%if ( 0%{?fedora} && 0%{?fedora} > 17 ) || ( 0%{?rhel} && 0%{?rhel} > 6 )
@@ -1373,6 +1399,10 @@ exit 0
%endif
%changelog
+* Thu Jan 18 2018 Kaleb S. KEITHLEY <kkeithle@redhat.com>
+- Fedora 28 glibc has removed rpc headers and rpcgen, use libtirpc
+- #1536187
+
* Tue Aug 22 2017 Kaleb S. KEITHLEY <kkeithle@redhat.com>
- libibverbs-devel, librdmacm-devel -> rdma-core-devel #1483995
diff --git a/libglusterfs/src/Makefile.am b/libglusterfs/src/Makefile.am
index 094646c5e3f..8a770134198 100644
--- a/libglusterfs/src/Makefile.am
+++ b/libglusterfs/src/Makefile.am
@@ -13,7 +13,7 @@ libglusterfs_la_CPPFLAGS = $(GF_CPPFLAGS) -D__USE_FILE_OFFSET64 \
-I$(CONTRIBDIR)/xxhash
libglusterfs_la_LIBADD = $(ZLIB_LIBS) $(MATH_LIB) $(UUID_LIBS)
-libglusterfs_la_LDFLAGS = -version-info $(LIBGLUSTERFS_LT_VERSION)
+libglusterfs_la_LDFLAGS = -version-info $(LIBGLUSTERFS_LT_VERSION) $(GF_LDFLAGS)
lib_LTLIBRARIES = libglusterfs.la
libgfchangelogdir = $(includedir)/glusterfs/gfchangelog
diff --git a/rpc/xdr/src/Makefile.am b/rpc/xdr/src/Makefile.am
index 77f545646d6..e0b01375186 100644
--- a/rpc/xdr/src/Makefile.am
+++ b/rpc/xdr/src/Makefile.am
@@ -16,7 +16,7 @@ libgfxdr_la_CPPFLAGS = $(GF_CPPFLAGS) -D__USE_FILE_OFFSET64 \
libgfxdr_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la
-libgfxdr_la_LDFLAGS = -version-info $(LIBGFXDR_LT_VERSION)
+libgfxdr_la_LDFLAGS = -version-info $(LIBGFXDR_LT_VERSION) $(GF_LDFLAGS)
libgfxdr_la_SOURCES = xdr-generic.c xdr-nfs3.c msg-nfs3.c
nodist_libgfxdr_la_SOURCES = $(XDRSOURCES)