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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]