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

Eric Blake eblake at redhat.com
Fri Oct 24 21:09:19 UTC 2014


On 10/24/2014 06:33 AM, Julio Faracco wrote:
> In a clean build system (Ubuntu 14.04), the viridentitytest failed to compile.
> Even if all the SELINUX libraries and depedencies are installed. See the error
> message 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
> 
> Simply adding the variable SELINUX_LIBS in viridentitytest rules of
> Makefile.am to include SELINUX libraries into viridentitytest solved that
> compilation issue. A conditional was added to consider when libvirt is using
> or not SELINUX.

The conditional was overkill:

> -viridentitytest_LDADD = $(LDADDS)
>  if WITH_SELINUX
> +viridentitytest_LDADD = $(LDADDS) $(SELINUX_LIBS)

If you leave the first line, then this can be:

viridentitytest_LDADD += $(SELINUX_LIBS)

>  viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
>  	../src/libvirt.la
> -endif WITH_SELINUX
> +else ! WITH_SELINUX
> +viridentitytest_LDADD = $(LDADDS)
> +endif ! WITH_SELINUX

and you don't need an else branch.  ACK with that tweak, so I pushed it
in your name.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 539 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141024/083973c6/attachment-0001.sig>


More information about the libvir-list mailing list