SHA256
1
0
forked from pool/libvirt
libvirt/temp-build-fix.patch

41 lines
1.8 KiB
Diff
Raw Normal View History

Fix link errors in tools/nss and tests
Although a simple 'make' of libvirt.git works, building libvirt 4.6.0
with 'osc build ...' fails in tools/nss and tests, with output along
the lines of:
[ 469s] libtool: link: gcc -shared -fPIC -DPIC -Wl,--whole-archive nss/.libs/libnss_libvirt_impl.a -Wl,--no-whole-archive -lpthread -lutil -ltirpc -fstack-protector-strong -grecord-gcc-switches -O2 -fstack-protector-strong -g -Wl,--version-script=./nss/libvirt_nss.syms -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,--no-copy-dt-needed-entries -Wl,-z -Wl,defs -grecord-gcc-switches -O2 -fstack-protector-strong -g -pthread -Wl,-soname -Wl,libnss_libvirt.so.2 -o nss/.libs/libnss_libvirt.so.2
[ 469s] nss/.libs/libnss_libvirt_impl.a(libvirt_nss_la-virjsoncompat.o): In function `virJSONJanssonOnce':
[ 469s] /home/abuild/rpmbuild/BUILD/libvirt-4.6.0/src/util/virjsoncompat.c:63: undefined reference to `dlopen'
[ 469s] /home/abuild/rpmbuild/BUILD/libvirt-4.6.0/src/util/virjsoncompat.c:79: undefined reference to `dlsym'
...
A quick hack is to add '-ldl' to the linker flags for libnss_libvirt_impl
and /libnss_libvirt_guest_impl. Will ask about a proper fix on libvirt
dev list.
Index: libvirt-4.6.0/tools/Makefile.am
===================================================================
--- libvirt-4.6.0.orig/tools/Makefile.am
+++ libvirt-4.6.0/tools/Makefile.am
@@ -525,6 +525,9 @@ nss_libnss_libvirt_impl_la_CFLAGS = \
$(AM_CFLAGS) \
$(NULL)
+nss_libnss_libvirt_impl_la_LDFLAGS = \
+ -ldl
+
nss_libnss_libvirt_impl_la_LIBADD = \
../gnulib/lib/libgnu.la \
../src/libvirt-nss.la
@@ -552,6 +555,9 @@ nss_libnss_libvirt_guest_impl_la_CFLAGS
$(AM_CFLAGS) \
$(NULL)
+nss_libnss_libvirt_guest_impl_la_LDFLAGS = \
+ -ldl
+
nss_libnss_libvirt_guest_impl_la_LIBADD = \
../gnulib/lib/libgnu.la \
../src/libvirt-nss.la