[libvirt] Linker error while compiling latest libvirt git source

make all-am make[3]: Entering directory `/home/dpkshetty/work/libvirt/libvirt/daemon' GEN qemu_dispatch.h GEN remote_dispatch.h CC libvirtd-remote_protocol.o CC libvirtd-qemu_protocol.o CC libvirtd-remote.o CC libvirtd-libvirtd.o CC libvirtd-stream.o In file included from remote.c:107:0: remote_dispatch.h: In function 'remoteDispatchDomainGetDiskErrorsHelper': remote.c:3611:9: warning: 'len' may be used uninitialized in this function [-Wuninitialized] At top level: cc1: warning: unrecognized command line option "-Wno-suggest-attribute=const" cc1: warning: unrecognized command line option "-Wno-suggest-attribute=pure" CCLD libvirtd libtool: link: warning: library `/usr/lib/i386-linux-gnu/libgcrypt.la' was moved. libtool: link: warning: library `/usr/lib/i386-linux-gnu/libgcrypt.la' was moved. ../src/.libs/libvirt_driver_qemu.a(libvirt_driver_qemu_la-qemu_process.o): In function `qemuProcessStart': /home/dpkshetty/work/libvirt/libvirt/src/qemu/qemu_process.c:3343: undefined reference to `virCommandAllowCap' ../src/.libs/libvirt_driver_storage.a(libvirt_driver_storage_la-storage_backend_fs.o): In function `virStorageBackendFileSystemVolResize': /home/dpkshetty/work/libvirt/libvirt/src/storage/storage_backend_fs.c:1234: undefined reference to `virStorageFileResize' collect2: ld returned 1 exit status make[3]: *** [libvirtd] Error 1 make[3]: Leaving directory `/home/dpkshetty/work/libvirt/libvirt/daemon' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/dpkshetty/work/libvirt/libvirt/daemon' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/dpkshetty/work/libvirt/libvirt' make: *** [all] Error 2

Requesting zheeshan to look, as this API was added recently by him, as i see on the list... On 02/01/2012 08:25 PM, Deepak C Shetty wrote:
make all-am make[3]: Entering directory `/home/dpkshetty/work/libvirt/libvirt/daemon' GEN qemu_dispatch.h GEN remote_dispatch.h CC libvirtd-remote_protocol.o CC libvirtd-qemu_protocol.o CC libvirtd-remote.o CC libvirtd-libvirtd.o CC libvirtd-stream.o In file included from remote.c:107:0: remote_dispatch.h: In function 'remoteDispatchDomainGetDiskErrorsHelper': remote.c:3611:9: warning: 'len' may be used uninitialized in this function [-Wuninitialized] At top level: cc1: warning: unrecognized command line option "-Wno-suggest-attribute=const" cc1: warning: unrecognized command line option "-Wno-suggest-attribute=pure" CCLD libvirtd libtool: link: warning: library `/usr/lib/i386-linux-gnu/libgcrypt.la' was moved. libtool: link: warning: library `/usr/lib/i386-linux-gnu/libgcrypt.la' was moved. ../src/.libs/libvirt_driver_qemu.a(libvirt_driver_qemu_la-qemu_process.o): In function `qemuProcessStart': /home/dpkshetty/work/libvirt/libvirt/src/qemu/qemu_process.c:3343: undefined reference to `virCommandAllowCap' ../src/.libs/libvirt_driver_storage.a(libvirt_driver_storage_la-storage_backend_fs.o): In function `virStorageBackendFileSystemVolResize': /home/dpkshetty/work/libvirt/libvirt/src/storage/storage_backend_fs.c:1234: undefined reference to `virStorageFileResize' collect2: ld returned 1 exit status make[3]: *** [libvirtd] Error 1 make[3]: Leaving directory `/home/dpkshetty/work/libvirt/libvirt/daemon' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/dpkshetty/work/libvirt/libvirt/daemon' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/dpkshetty/work/libvirt/libvirt' make: *** [all] Error 2
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 02/01/2012 11:01 AM, Deepak C Shetty wrote:
Requesting zheeshan to look, as this API was added recently by him, as i see on the list...
jdenemar just pushed a fix.
On 02/01/2012 08:25 PM, Deepak C Shetty wrote:
make all-am make[3]: Entering directory `/home/dpkshetty/work/libvirt/libvirt/daemon' GEN qemu_dispatch.h GEN remote_dispatch.h CC libvirtd-remote_protocol.o CC libvirtd-qemu_protocol.o CC libvirtd-remote.o CC libvirtd-libvirtd.o CC libvirtd-stream.o In file included from remote.c:107:0: remote_dispatch.h: In function 'remoteDispatchDomainGetDiskErrorsHelper': remote.c:3611:9: warning: 'len' may be used uninitialized in this function [-Wuninitialized] At top level: cc1: warning: unrecognized command line option "-Wno-suggest-attribute=const" cc1: warning: unrecognized command line option "-Wno-suggest-attribute=pure" CCLD libvirtd libtool: link: warning: library `/usr/lib/i386-linux-gnu/libgcrypt.la' was moved. libtool: link: warning: library `/usr/lib/i386-linux-gnu/libgcrypt.la' was moved. ../src/.libs/libvirt_driver_qemu.a(libvirt_driver_qemu_la-qemu_process.o): In function `qemuProcessStart': /home/dpkshetty/work/libvirt/libvirt/src/qemu/qemu_process.c:3343: undefined reference to `virCommandAllowCap' ../src/.libs/libvirt_driver_storage.a(libvirt_driver_storage_la-storage_backend_fs.o): In function `virStorageBackendFileSystemVolResize': /home/dpkshetty/work/libvirt/libvirt/src/storage/storage_backend_fs.c:1234: undefined reference to `virStorageFileResize' collect2: ld returned 1 exit status make[3]: *** [libvirtd] Error 1 make[3]: Leaving directory `/home/dpkshetty/work/libvirt/libvirt/daemon' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/dpkshetty/work/libvirt/libvirt/daemon' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/dpkshetty/work/libvirt/libvirt' make: *** [all] Error 2
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 02/01/2012 10:05 PM, Laine Stump wrote:
On 02/01/2012 11:01 AM, Deepak C Shetty wrote:
Requesting zheeshan to look, as this API was added recently by him, as i see on the list...
jdenemar just pushed a fix.
Do you mean the 'bogus warning about the uninit variable' fix, it does not fix the ld 'undefined reference' error i just git pull'ed and did make, it still fails as below.
On 02/01/2012 08:25 PM, Deepak C Shetty wrote:
make all-am make[3]: Entering directory `/home/dpkshetty/work/libvirt/libvirt/daemon' GEN qemu_dispatch.h GEN remote_dispatch.h CC libvirtd-remote_protocol.o CC libvirtd-qemu_protocol.o CC libvirtd-remote.o CC libvirtd-libvirtd.o CC libvirtd-stream.o In file included from remote.c:107:0: remote_dispatch.h: In function 'remoteDispatchDomainGetDiskErrorsHelper': remote.c:3611:9: warning: 'len' may be used uninitialized in this function [-Wuninitialized] At top level: cc1: warning: unrecognized command line option "-Wno-suggest-attribute=const" cc1: warning: unrecognized command line option "-Wno-suggest-attribute=pure" CCLD libvirtd libtool: link: warning: library `/usr/lib/i386-linux-gnu/libgcrypt.la' was moved. libtool: link: warning: library `/usr/lib/i386-linux-gnu/libgcrypt.la' was moved. ../src/.libs/libvirt_driver_qemu.a(libvirt_driver_qemu_la-qemu_process.o): In function `qemuProcessStart': /home/dpkshetty/work/libvirt/libvirt/src/qemu/qemu_process.c:3343: undefined reference to `virCommandAllowCap' ../src/.libs/libvirt_driver_storage.a(libvirt_driver_storage_la-storage_backend_fs.o): In function `virStorageBackendFileSystemVolResize': /home/dpkshetty/work/libvirt/libvirt/src/storage/storage_backend_fs.c:1234: undefined reference to `virStorageFileResize' collect2: ld returned 1 exit status make[3]: *** [libvirtd] Error 1 make[3]: Leaving directory `/home/dpkshetty/work/libvirt/libvirt/daemon' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/dpkshetty/work/libvirt/libvirt/daemon' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/dpkshetty/work/libvirt/libvirt' make: *** [all] Error 2
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 02/01/2012 12:00 PM, Deepak C Shetty wrote:
On 02/01/2012 10:05 PM, Laine Stump wrote:
On 02/01/2012 11:01 AM, Deepak C Shetty wrote:
Requesting zheeshan to look, as this API was added recently by him, as i see on the list...
jdenemar just pushed a fix.
Do you mean the 'bogus warning about the uninit variable' fix, it does not fix the ld 'undefined reference' error i just git pull'ed and did make, it still fails as below.
On 02/01/2012 08:25 PM, Deepak C Shetty wrote:
../src/.libs/libvirt_driver_qemu.a(libvirt_driver_qemu_la-qemu_process.o): In function `qemuProcessStart': /home/dpkshetty/work/libvirt/libvirt/src/qemu/qemu_process.c:3343: undefined reference to `virCommandAllowCap' ../src/.libs/libvirt_driver_storage.a(libvirt_driver_storage_la-storage_backend_fs.o): In function `virStorageBackendFileSystemVolResize': /home/dpkshetty/work/libvirt/libvirt/src/storage/storage_backend_fs.c:1234: undefined reference to `virStorageFileResize'
Ah, I saw the warning (which ends up being an error for me) and stopped looking. Both of those are because new patches for the first time are calling functions that were previously defined, but not being called. When those functions were initially created, they weren't added to libvirt_private.syms, and later when they were finally used, the reviewer (me) didn't think to look for the entry in libvirt_private.syms because the functions already existed (and of course make check worked for me because I don't build with loadable modules). I just pushed build-breaker patches for both errors.

Thanks Laine, that worked. On 02/02/2012 02:46 AM, Laine Stump wrote:
On 02/01/2012 12:00 PM, Deepak C Shetty wrote:
On 02/01/2012 10:05 PM, Laine Stump wrote:
On 02/01/2012 11:01 AM, Deepak C Shetty wrote:
Requesting zheeshan to look, as this API was added recently by him, as i see on the list...
jdenemar just pushed a fix.
Do you mean the 'bogus warning about the uninit variable' fix, it does not fix the ld 'undefined reference' error i just git pull'ed and did make, it still fails as below.
On 02/01/2012 08:25 PM, Deepak C Shetty wrote:
../src/.libs/libvirt_driver_qemu.a(libvirt_driver_qemu_la-qemu_process.o): In function `qemuProcessStart': /home/dpkshetty/work/libvirt/libvirt/src/qemu/qemu_process.c:3343: undefined reference to `virCommandAllowCap' ../src/.libs/libvirt_driver_storage.a(libvirt_driver_storage_la-storage_backend_fs.o): In function `virStorageBackendFileSystemVolResize': /home/dpkshetty/work/libvirt/libvirt/src/storage/storage_backend_fs.c:1234: undefined reference to `virStorageFileResize'
Ah, I saw the warning (which ends up being an error for me) and stopped looking.
Both of those are because new patches for the first time are calling functions that were previously defined, but not being called. When those functions were initially created, they weren't added to libvirt_private.syms, and later when they were finally used, the reviewer (me) didn't think to look for the entry in libvirt_private.syms because the functions already existed (and of course make check worked for me because I don't build with loadable modules).
I just pushed build-breaker patches for both errors.
participants (2)
-
Deepak C Shetty
-
Laine Stump