]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix link errors in tools/nss and tests
authorJim Fehlig <jfehlig@suse.com>
Wed, 8 Aug 2018 16:47:57 +0000 (10:47 -0600)
committerJim Fehlig <jfehlig@suse.com>
Wed, 8 Aug 2018 23:37:03 +0000 (17:37 -0600)
While local builds succeed fine, a build worker building in a chroot
environment is encountering errors when linking some items in tools/nss
and tests, e.g.

[  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 similar problem was fixed in commit b018ada3 and inspires this fix.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
tools/Makefile.am

index 1452d984a071b2098a6cb36111e502bc323f6ee1..26c887649e2f1d9f63ffc769c8256f8efadaebdb 100644 (file)
@@ -527,7 +527,8 @@ nss_libnss_libvirt_impl_la_CFLAGS = \
 
 nss_libnss_libvirt_impl_la_LIBADD = \
        ../gnulib/lib/libgnu.la \
-       ../src/libvirt-nss.la
+       ../src/libvirt-nss.la \
+       $(DLOPEN_LIBS)
 
 nss_libnss_libvirt_la_SOURCES =
 nss_libnss_libvirt_la_LDFLAGS = \
@@ -554,7 +555,8 @@ nss_libnss_libvirt_guest_impl_la_CFLAGS = \
 
 nss_libnss_libvirt_guest_impl_la_LIBADD = \
        ../gnulib/lib/libgnu.la \
-       ../src/libvirt-nss.la
+       ../src/libvirt-nss.la \
+       $(DLOPEN_LIBS)
 
 nss_libnss_libvirt_guest_la_SOURCES =
 nss_libnss_libvirt_guest_la_LDFLAGS = \