]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
fix xdr detection and use with recent glibc
authorChristophe Fergeau <cfergeau@redhat.com>
Tue, 10 May 2011 15:42:06 +0000 (17:42 +0200)
committerEric Blake <eblake@redhat.com>
Wed, 11 May 2011 20:56:57 +0000 (14:56 -0600)
glibc 2.13.90 has obsoleted its rpc implementation in favour of
the one provided by the TI-RPC library:

> * The RPC implementation in libc is obsoleted.  Old programs keep working
>   but new programs cannot be linked with the routines in libc anymore.
>   Programs in need of RPC functionality must be linked against TI-RPC.
>   The TI-RPC implemtation is IPv6 enabled and there are other benefits.
>
>   Visible changes of this change include (obviously) the inability to
>   link
>   programs using RPC functions without referencing the TI-RPC library,
>   the
>   removal of the RPC headers from the glibc headers, and the lack of
>   symbols defined in <rpc/netdb.h> when <netdb.h> is installed.
>   Implemented by Ulrich Drepper.
(from glibc NEWS)

Thus with recent glibc, we need to try linking with -ltirpc when looking
for the XDR functions. The daemon also needs to use XDR_CFLAGS to be able
to find the XDR headers stored in /usr/include/tirpc.

When using TI-RPC, there are some warnings about redundant declarations, but
the fix probably belongs in other modules:

/usr/include/tirpc/rpc/rpcent.h:68:13: warning: redundant redeclaration of
'setrpcent' [-Wredundant-decls]
/usr/include/rpc/netdb.h:53:13: note: previous declaration of 'setrpcent'
was here

/usr/include/tirpc/rpc/rpcent.h:69:13: warning: redundant redeclaration of
'endrpcent' [-Wredundant-decls]
/usr/include/rpc/netdb.h:54:13: note: previous declaration of 'endrpcent'
was here

/usr/include/tirpc/rpc/rpc.h:84:12: warning: redundant redeclaration of
'bindresvport' [-Wredundant-decls]
/usr/include/netinet/in.h:440:12: note: previous declaration of
'bindresvport' was here

configure.ac
daemon/Makefile.am

index 62c056030f4f535419cf48e4f7633d37435c51c0..71c496883c09a3521c3eda5a1ce7382185cfdf37 100644 (file)
@@ -366,16 +366,16 @@ if test x"$with_remote" = x"yes" || test x"$with_libvirtd" = x"yes"; then
     dnl Where are the XDR functions?
     dnl If portablexdr is installed, prefer that.
     dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW), -lnsl (Solaris)
-    dnl or none (most Unix)
+    dnl -ltirpc (glibc 2.13.90 or newer) or none (most Unix)
     AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[
-        AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl],[],
+        AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl tirpc],[],
             [AC_MSG_ERROR([Cannot find a XDR library])])
         ])
 
     dnl check for cygwin's variation in xdr function names
     AC_CHECK_FUNCS([xdr_u_int64_t],[],[],[#include <rpc/xdr.h>])
 
-    dnl Cygwin requires -I/usr/include/tirpc for <rpc/rpc.h>
+    dnl Cygwin/recent glibc requires -I/usr/include/tirpc for <rpc/rpc.h>
     old_CFLAGS=$CFLAGS
     AC_CACHE_CHECK([where to find <rpc/rpc.h>], [lv_cv_xdr_cflags], [
       for add_CFLAGS in '' '-I/usr/include/tirpc' 'missing'; do
index f734c890c52d2cf17fc4b1d2420d87a9fdcefb4d..2095c1c230bf09fd1c25cf43462dd36d21a4fa58 100644 (file)
@@ -87,7 +87,7 @@ libvirtd_CFLAGS = \
        -I$(top_srcdir)/src/conf \
        -I$(top_srcdir)/src/remote \
        $(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
-       $(POLKIT_CFLAGS) \
+       $(XDR_CFLAGS) $(POLKIT_CFLAGS) \
        $(WARN_CFLAGS) \
        $(COVERAGE_CFLAGS) \
        -DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \