[libvirt] [PATCH] tests: Adding SELINUX_LIBS to fix viridentitytest linker bug.

Julio Faracco jcfaracco at gmail.com
Sat Oct 18 03:59:15 UTC 2014


Recently, I tryed to recompile libvirt in a clean build system, but the
process failed when it tryed to compile the test v:iridentitytest. See the
error below:

[...]
  CC       viridentitytest.o
  CCLD     viridentitytest
/usr/bin/ld: viridentitytest.o: undefined reference to symbol
                                                       'security_disable'
//lib/x86_64-linux-gnu/libselinux.so.1: error adding symbols: DSO missing
                                                           from command line
collect2: error: ld returned 1 exit status
make: *** [viridentitytest] Error 1

So, adding the variable SELINUX_LIBS in viridentitytest rules solved the
issue.

Signed-off-by: Julio Faracco <jcfaracco at gmail.com>
---
 tests/Makefile.am | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4c3d4ef..363c902 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -926,11 +926,13 @@ virstoragetest_LDADD = $(LDADDS) \
 
 viridentitytest_SOURCES = \
 	viridentitytest.c testutils.h testutils.c
-viridentitytest_LDADD = $(LDADDS)
 if WITH_SELINUX
+viridentitytest_LDADD = $(LDADDS) $(SELINUX_LIBS)
 viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
 	../src/libvirt.la
-endif WITH_SELINUX
+else ! WITH_SELINUX
+viridentitytest_LDADD = $(LDADDS)
+endif ! WITH_SELINUX
 
 viriscsitest_SOURCES = \
 	viriscsitest.c testutils.h testutils.c
-- 
1.9.1




More information about the libvir-list mailing list