libvirt: fix build w/glibc-2.32

This commit is contained in:
Maximilian Bosch 2020-08-17 19:50:54 +02:00
parent 81cf190882
commit 24fd601640
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E
2 changed files with 115 additions and 3 deletions

View File

@ -0,0 +1,106 @@
From a9ce1217742d542a5ae4b154b6f55342aace374e Mon Sep 17 00:00:00 2001
From: Maximilian Bosch <maximilian@mbosch.me>
Date: Mon, 17 Aug 2020 19:35:44 +0200
Subject: [PATCH] Fix build with libtirpc
Derived from https://github.com/libvirt/libvirt/commit/d7147b3797380de2d159ce6324536f3e1f2d97e3.patch
---
libvirt.spec.in | 4 +++-
src/Makefile.am | 2 +-
src/admin/Makefile.inc.am | 1 +
src/locking/Makefile.inc.am | 2 ++
src/logging/Makefile.inc.am | 1 +
src/remote/Makefile.inc.am | 1 +
6 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 6abf97d..71fc4e6 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -405,11 +405,13 @@ BuildRequires: wireshark-devel >= 2.4.0
BuildRequires: libssh-devel >= 0.7.0
%endif
+# On RHEL-7 rpcgen is still part of glibc-common package
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: rpcgen
-BuildRequires: libtirpc-devel
%endif
+BuildRequires: libtirpc-devel
+
%if %{with_firewalld_zone}
BuildRequires: firewalld-filesystem
%endif
diff --git a/src/Makefile.am b/src/Makefile.am
index 12dd6b8..8d0d4e1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -439,7 +439,7 @@ libvirt_la_LDFLAGS += -Wl,-flat_namespace
endif WITH_MACOS
libvirt_la_LDFLAGS += $(NULL)
libvirt_la_LIBADD += \
- $(DRIVER_MODULES_LIBS)
+ $(DRIVER_MODULES_LIBS) $(XDR_LIBS)
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
# Because we specify libvirt_la_DEPENDENCIES for $(LIBVIRT_SYMBOL_FILE), we
# lose automake's automatic dependencies on an appropriate subset of
diff --git a/src/admin/Makefile.inc.am b/src/admin/Makefile.inc.am
index 0a9717a..8556a3b 100644
--- a/src/admin/Makefile.inc.am
+++ b/src/admin/Makefile.inc.am
@@ -72,6 +72,7 @@ libvirt_admin_la_LDFLAGS = \
libvirt_admin_la_LIBADD = \
libvirt.la \
+ $(XDR_LIBS) \
$(CAPNG_LIBS) \
$(YAJL_LIBS) \
$(DEVMAPPER_LIBS) \
diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am
index d1bf49c..ab01d8e 100644
--- a/src/locking/Makefile.inc.am
+++ b/src/locking/Makefile.inc.am
@@ -120,6 +120,7 @@ lockd_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
lockd_la_LIBADD = \
libvirt.la \
$(GLIB_LIBS) \
+ $(XDR_LIBS) \
$(NULL)
augeas_DATA += locking/libvirt_lockd.aug
if WITH_DTRACE_PROBES
@@ -161,6 +162,7 @@ virtlockd_CFLAGS = \
virtlockd_LDFLAGS = \
$(AM_LDFLAGS) \
$(PIE_LDFLAGS) \
+ $(XDR_LIBS) \
$(NO_UNDEFINED_LDFLAGS) \
$(NULL)
virtlockd_LDADD = \
diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am
index dc09cfe..4be3376 100644
--- a/src/logging/Makefile.inc.am
+++ b/src/logging/Makefile.inc.am
@@ -99,6 +99,7 @@ virtlogd_CFLAGS = \
virtlogd_LDFLAGS = \
$(AM_LDFLAGS) \
$(PIE_LDFLAGS) \
+ $(XDR_LIBS) \
$(NO_UNDEFINED_LDFLAGS) \
$(NULL)
virtlogd_LDADD = \
diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am
index 1b1be83..8a40c96 100644
--- a/src/remote/Makefile.inc.am
+++ b/src/remote/Makefile.inc.am
@@ -69,6 +69,7 @@ REMOTE_DAEMON_LD_ADD = \
$(LIBXML_LIBS) \
$(GNUTLS_LIBS) \
$(SASL_LIBS) \
+ $(XDR_LIBS) \
$(DBUS_LIBS) \
$(LIBNL_LIBS) \
$(NULL)
--
2.25.4

View File

@ -4,7 +4,7 @@
, iproute, iptables, readline, lvm2, utillinux, systemd, libpciaccess, gettext , iproute, iptables, readline, lvm2, utillinux, systemd, libpciaccess, gettext
, libtasn1, ebtables, libgcrypt, yajl, pmutils, libcap_ng, libapparmor , libtasn1, ebtables, libgcrypt, yajl, pmutils, libcap_ng, libapparmor
, dnsmasq, libnl, libpcap, libxslt, xhtml1, numad, numactl, perlPackages , dnsmasq, libnl, libpcap, libxslt, xhtml1, numad, numactl, perlPackages
, curl, libiconv, gmp, zfs, parted, bridge-utils, dmidecode, dbus , curl, libiconv, gmp, zfs, parted, bridge-utils, dmidecode, dbus, libtirpc, rpcsvc-proto
, enableXen ? false, xen ? null , enableXen ? false, xen ? null
, enableIscsi ? false, openiscsi , enableIscsi ? false, openiscsi
, enableCeph ? false, ceph , enableCeph ? false, ceph
@ -33,10 +33,15 @@ in stdenv.mkDerivation rec {
fetchSubmodules = true; fetchSubmodules = true;
}; };
nativeBuildInputs = [ makeWrapper pkgconfig docutils ] ++ optionals (!buildFromTarball) [ autoreconfHook ]; patches = [
./0001-Fix-build-with-libtirpc.patch
];
nativeBuildInputs = [ makeWrapper pkgconfig docutils rpcsvc-proto ]
++ optionals (!buildFromTarball) [ autoreconfHook ];
buildInputs = [ buildInputs = [
libxml2 gnutls perl python2 readline gettext libtasn1 libgcrypt yajl libxml2 gnutls perl python2 readline gettext libtasn1 libgcrypt yajl
libxslt xhtml1 perlPackages.XMLXPath curl libpcap glib dbus libxslt xhtml1 perlPackages.XMLXPath curl libpcap glib dbus libtirpc
] ++ optionals stdenv.isLinux [ ] ++ optionals stdenv.isLinux [
libpciaccess lvm2 utillinux systemd libnl numad zfs libpciaccess lvm2 utillinux systemd libnl numad zfs
libapparmor libcap_ng numactl attr parted libapparmor libcap_ng numactl attr parted
@ -80,6 +85,7 @@ in stdenv.mkDerivation rec {
"QEMU_BRIDGE_HELPER=/run/wrappers/bin/qemu-bridge-helper" "QEMU_BRIDGE_HELPER=/run/wrappers/bin/qemu-bridge-helper"
"QEMU_PR_HELPER=/run/libvirt/nix-helpers/qemu-pr-helper" "QEMU_PR_HELPER=/run/libvirt/nix-helpers/qemu-pr-helper"
"EBTABLES_PATH=${ebtables}/bin/ebtables-legacy" "EBTABLES_PATH=${ebtables}/bin/ebtables-legacy"
"CFLAGS=-I${libtirpc.dev}/include/tirpc"
"--with-attr" "--with-attr"
"--with-apparmor" "--with-apparmor"
"--with-secdriver-apparmor" "--with-secdriver-apparmor"