[libvirt] Re: [virt-tools-list] libvirt 0.7.2 linker issues

On 10/19/2009 08:54 AM, Laurent Léonard wrote:
Hi,
I'm trying to package libvirt 0.7.2 for Debian and get some linker issues :
make[3]: Entering directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' CC virsh-console.o CC virsh-virsh.o CCLD virsh ../src/.libs/libvirt.so: undefined reference to `security_getenforce' ../src/.libs/libvirt.so: undefined reference to `freecon' ../src/.libs/libvirt.so: undefined reference to `setexeccon' ../src/.libs/libvirt.so: undefined reference to `selinux_virtual_domain_context_path' ../src/.libs/libvirt.so: undefined reference to `context_str' ../src/.libs/libvirt.so: undefined reference to `context_range_set' ../src/.libs/libvirt.so: undefined reference to `is_selinux_enabled' ../src/.libs/libvirt.so: undefined reference to `setfilecon' ../src/.libs/libvirt.so: undefined reference to `context_new' ../src/.libs/libvirt.so: undefined reference to `getfilecon' ../src/.libs/libvirt.so: undefined reference to `getpidcon' ../src/.libs/libvirt.so: undefined reference to `context_free' ../src/.libs/libvirt.so: undefined reference to `context_range_get' ../src/.libs/libvirt.so: undefined reference to `matchpathcon' ../src/.libs/libvirt.so: undefined reference to `selinux_virtual_image_context_path' ../src/.libs/libvirt.so: undefined reference to `security_check_context' collect2: ld returned 1 exit status make[3]: *** [virsh] Error 1 make[3]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2' make: *** [all] Error 2
Any idea what's wrong ?
Thank you,
Libvirt questions should go to libvirt-list@redhat.com (cc'd now). You should pass --with-selinux=no to configure, since those are all libselinux functions. Do you have libselinux installed? If not, there's probably an error in configure.in selinux autodetection. - Cole

Le lundi 19 octobre 2009 à 15:21, Cole Robinson a écrit :
On 10/19/2009 08:54 AM, Laurent Léonard wrote:
Hi,
I'm trying to package libvirt 0.7.2 for Debian and get some linker issues :
make[3]: Entering directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' CC virsh-console.o CC virsh-virsh.o CCLD virsh ../src/.libs/libvirt.so: undefined reference to `security_getenforce' ../src/.libs/libvirt.so: undefined reference to `freecon' ../src/.libs/libvirt.so: undefined reference to `setexeccon' ../src/.libs/libvirt.so: undefined reference to `selinux_virtual_domain_context_path' ../src/.libs/libvirt.so: undefined reference to `context_str' ../src/.libs/libvirt.so: undefined reference to `context_range_set' ../src/.libs/libvirt.so: undefined reference to `is_selinux_enabled' ../src/.libs/libvirt.so: undefined reference to `setfilecon' ../src/.libs/libvirt.so: undefined reference to `context_new' ../src/.libs/libvirt.so: undefined reference to `getfilecon' ../src/.libs/libvirt.so: undefined reference to `getpidcon' ../src/.libs/libvirt.so: undefined reference to `context_free' ../src/.libs/libvirt.so: undefined reference to `context_range_get' ../src/.libs/libvirt.so: undefined reference to `matchpathcon' ../src/.libs/libvirt.so: undefined reference to `selinux_virtual_image_context_path' ../src/.libs/libvirt.so: undefined reference to `security_check_context' collect2: ld returned 1 exit status make[3]: *** [virsh] Error 1 make[3]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2' make: *** [all] Error 2
Any idea what's wrong ?
Thank you,
Libvirt questions should go to libvirt-list@redhat.com (cc'd now).
Oops, sorry for that.
You should pass --with-selinux=no to configure, since those are all libselinux functions. Do you have libselinux installed? If not, there's probably an error in configure.in selinux autodetection.
libselinux (headers and binaries) are correctly installed and I have no problem to build libvirt 0.7.1. Something wrong with the following refactoring (2009-09-20) ? * src/Makefile.am: Add -Isrc/conf to the individual build targets which need to use XML config APIs. Remove LIBXML_CFLAGS, LIBSSH2_CFLAGS and SELINUX_CFLAGS from global INCLUDES and only have them in build targets which actually need them. Create a libvirt_conf.la convenience library for all config parsers Thank you, -- Laurent Léonard

Laurent Léonard wrote:
Le lundi 19 octobre 2009 à 15:21, Cole Robinson a écrit :
On 10/19/2009 08:54 AM, Laurent Léonard wrote:
Hi,
I'm trying to package libvirt 0.7.2 for Debian and get some linker issues :
make[3]: Entering directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' CC virsh-console.o CC virsh-virsh.o CCLD virsh ../src/.libs/libvirt.so: undefined reference to `security_getenforce' ../src/.libs/libvirt.so: undefined reference to `freecon' ../src/.libs/libvirt.so: undefined reference to `setexeccon' ../src/.libs/libvirt.so: undefined reference to `selinux_virtual_domain_context_path' ../src/.libs/libvirt.so: undefined reference to `context_str' ../src/.libs/libvirt.so: undefined reference to `context_range_set' ../src/.libs/libvirt.so: undefined reference to `is_selinux_enabled' ../src/.libs/libvirt.so: undefined reference to `setfilecon' ../src/.libs/libvirt.so: undefined reference to `context_new' ../src/.libs/libvirt.so: undefined reference to `getfilecon' ../src/.libs/libvirt.so: undefined reference to `getpidcon' ../src/.libs/libvirt.so: undefined reference to `context_free' ../src/.libs/libvirt.so: undefined reference to `context_range_get' ../src/.libs/libvirt.so: undefined reference to `matchpathcon' ../src/.libs/libvirt.so: undefined reference to `selinux_virtual_image_context_path' ../src/.libs/libvirt.so: undefined reference to `security_check_context' collect2: ld returned 1 exit status make[3]: *** [virsh] Error 1 make[3]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2' make: *** [all] Error 2
Any idea what's wrong ?
Thank you,
Libvirt questions should go to libvirt-list@redhat.com (cc'd now).
Oops, sorry for that.
You should pass --with-selinux=no to configure, since those are all libselinux functions. Do you have libselinux installed? If not, there's probably an error in configure.in selinux autodetection.
libselinux (headers and binaries) are correctly installed and I have no problem to build libvirt 0.7.1. Something wrong with the following refactoring (2009-09-20) ?
* src/Makefile.am: Add -Isrc/conf to the individual build targets which need to use XML config APIs. Remove LIBXML_CFLAGS, LIBSSH2_CFLAGS and SELINUX_CFLAGS from global INCLUDES and only have them in build targets which actually need them. Create a libvirt_conf.la convenience library for all config parsers
I'm seeing the same issue. Attached patch fixes it for me. Regards, Jim

Le lundi 19 octobre 2009 à 19:48, Jim Fehlig a écrit :
Laurent Léonard wrote:
Le lundi 19 octobre 2009 à 15:21, Cole Robinson a écrit :
On 10/19/2009 08:54 AM, Laurent Léonard wrote:
Hi,
I'm trying to package libvirt 0.7.2 for Debian and get some linker issues
make[3]: Entering directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' CC virsh-console.o CC virsh-virsh.o CCLD virsh ../src/.libs/libvirt.so: undefined reference to `security_getenforce' ../src/.libs/libvirt.so: undefined reference to `freecon' ../src/.libs/libvirt.so: undefined reference to `setexeccon' ../src/.libs/libvirt.so: undefined reference to `selinux_virtual_domain_context_path' ../src/.libs/libvirt.so: undefined reference to `context_str' ../src/.libs/libvirt.so: undefined reference to `context_range_set' ../src/.libs/libvirt.so: undefined reference to `is_selinux_enabled' ../src/.libs/libvirt.so: undefined reference to `setfilecon' ../src/.libs/libvirt.so: undefined reference to `context_new' ../src/.libs/libvirt.so: undefined reference to `getfilecon' ../src/.libs/libvirt.so: undefined reference to `getpidcon' ../src/.libs/libvirt.so: undefined reference to `context_free' ../src/.libs/libvirt.so: undefined reference to `context_range_get' ../src/.libs/libvirt.so: undefined reference to `matchpathcon' ../src/.libs/libvirt.so: undefined reference to `selinux_virtual_image_context_path' ../src/.libs/libvirt.so: undefined reference to `security_check_context' collect2: ld returned 1 exit status make[3]: *** [virsh] Error 1 make[3]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2' make: *** [all] Error 2
Any idea what's wrong ?
Thank you,
Libvirt questions should go to libvirt-list@redhat.com (cc'd now).
Oops, sorry for that.
You should pass --with-selinux=no to configure, since those are all libselinux functions. Do you have libselinux installed? If not, there's probably an error in configure.in selinux autodetection.
libselinux (headers and binaries) are correctly installed and I have no problem to build libvirt 0.7.1. Something wrong with the following refactoring (2009-09-20) ?
* src/Makefile.am: Add -Isrc/conf to the individual build targets which need to use XML config APIs. Remove LIBXML_CFLAGS, LIBSSH2_CFLAGS and SELINUX_CFLAGS from global INCLUDES and only have them in build targets which actually need them. Create a libvirt_conf.la convenience library for all config parsers
I'm seeing the same issue. Attached patch fixes it for me.
The patch fixes the issue for me too. -- Laurent Léonard

On Mon, Oct 19, 2009 at 11:48:09AM -0600, Jim Fehlig wrote:
Laurent Léonard wrote:
Le lundi 19 octobre 2009 à 15:21, Cole Robinson a écrit :
On 10/19/2009 08:54 AM, Laurent Léonard wrote:
commit 1e0ec790a0f1f8b8d54c862db42050a51f62ba61 Author: Jim Fehlig <jfehlig@novell.com> Date: Mon Oct 19 11:45:19 2009 -0600
Add selinux CFLAGS and linker flags to security driver
diff --git a/src/Makefile.am b/src/Makefile.am index d0ef7d1..8e27ea7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -657,6 +657,8 @@ libvirt_driver_security_la_CFLAGS = \ libvirt_driver_security_la_LDFLAGS = if WITH_SECDRIVER_SELINUX libvirt_driver_security_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES) +libvirt_driver_security_la_CFLAGS += $(SELINUX_CFLAGS) +libvirt_driver_security_la_LDFLAGS += $(SELINUX_LIBS) endif if WITH_SECDRIVER_APPARMOR libvirt_driver_security_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
ACK, this is correct. I can't help wondering if we need it against libvirt_driver_storage_la too, since that links to selinux routines too Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Mon, Oct 19, 2009 at 11:48:09AM -0600, Jim Fehlig wrote:
Laurent Léonard wrote:
You should pass --with-selinux=no to configure, since those are all libselinux functions. Do you have libselinux installed? If not, there's probably an error in configure.in selinux autodetection.
libselinux (headers and binaries) are correctly installed and I have no problem to build libvirt 0.7.1. Something wrong with the following refactoring (2009-09-20) ?
* src/Makefile.am: Add -Isrc/conf to the individual build targets which need to use XML config APIs. Remove LIBXML_CFLAGS, LIBSSH2_CFLAGS and SELINUX_CFLAGS from global INCLUDES and only have them in build targets which actually need them. Create a libvirt_conf.la convenience library for all config parsers
I'm seeing the same issue. Attached patch fixes it for me.
Yup looks fine, applied and pushed to git, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (5)
-
Cole Robinson
-
Daniel P. Berrange
-
Daniel Veillard
-
Jim Fehlig
-
Laurent Léonard