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

Re: [libvirt] [PATCH] build: Fix VPATH build with new probes

On 10/11/2011 08:49 AM, Jiri Denemark wrote:
Note that make check still fails for me in VPATH build because od
undefined references in libvirt_test.a which I don't really understand
since src/Makefile.am contains
libvirt_la_LIBADD += probes.o
libvirt_test_la_LIBADD = $(libvirt_la_LIBADD)

This is a sample of the erros I get:

In function `virNetClientCallDispatch':
undefined reference to `libvirt_rpc_client_msg_rx_semaphore'
In function `virNetClientRef':
undefined reference to `libvirt_rpc_client_ref_semaphore'

In looking at this further, it looks like the libtool warnings are relevant:

*** Warning: Linking the shared library libvirt.la against the non-libtool
*** objects  probes.o is not portable!

When creating libvirt.la (the libtool driver for the eventual installed libvirt.so), the warning is issued, but libtool still compiles probe.o into the overall library for any platform that can handle it (Linux can, and we don't build probe.o anywhere else, so we are okay). This compilation is done via $CC.

But libvirt_test.la is a different beast - since it is never installed, but just a convenience library, libtool creates the library using raw invocations of '$AR cru' from the piecemeal list of .o files extracted from each other convenience library, and omits probe.o.

Perhaps we could argue that this is a libtool bug for not putting .o files into convenience libraries, even though it does so for installed libraries. But getting that fixed in libtool, then requiring the newer libtool before we can build libvirt in the future, seems time-consuming.

On the other hand, looking further, src/Makefile.am ends up building the libvirt_lxc executable, and explicitly adds probes.o to libvirt_lxc_LDADD, which then gets compiled in without any warnings.

So it looks like instead of trying to jam probes.o into libvirt_test.la, we should instead tweak tests/Makefile.am so that every executable that links against libvirt_test.la also links against probes.o, similar to how libvirt_lxc_LDADD worked for that executable.

I'm still playing with the issue, but hope to have 'make check' working again sometime today.

Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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