[libvirt] [PATCH] Fix several undefined symbol errors in loadable driver modules

Matthias Bolte matthias.bolte at googlemail.com
Wed Jun 23 11:11:49 UTC 2010


2010/6/23 Daniel P. Berrange <berrange at redhat.com>:
> On Wed, Jun 23, 2010 at 12:33:54PM +0200, Matthias Bolte wrote:
>> Link all loadable driver modules to libvirt.la and libgnu.la.
>>
>> Add several missing symbols to libvirt_private.syms in order to
>> have them properly exported.
>> ---
>>  src/Makefile.am          |   25 ++++++++++++++++++++++---
>>  src/libvirt_private.syms |   25 +++++++++++++++++++++++++
>>  tests/Makefile.am        |    6 +++++-
>>  3 files changed, 52 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/Makefile.am b/src/Makefile.am
>> index ece18a6..588adf5 100644
>> --- a/src/Makefile.am
>> +++ b/src/Makefile.am
>> @@ -456,6 +456,7 @@ libvirt_driver_test_la_CFLAGS = \
>>               -I at top_srcdir@/src/conf
>>  if WITH_DRIVER_MODULES
>>  libvirt_driver_test_la_LDFLAGS = -module -avoid-version
>> +libvirt_driver_test_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
>
> I don't think it is right to link to libvirt.la here or with other
> driver modules.
>
> The libvirtd daemon links to libvirt.la already, and is built such
> that all exported symbols are available to modules that are dlopen()d
> Thus it should be sufficient to add symbols to libvirt_private.syms
> and not link to libvirt.la in driver modules.
>
> It might still be neccessary to link to libgnu.la because that is
> statically linked into libvirtd and thus only gets symbols that
> libvirtd needs. The modules might need further symbols from libgnu.la
> so its reasonable to link to it directly.
>

Hm, you're right. I just tested it and I don't need to link to
libvirt.la in order to have libvirtd and virsh work properly. But
virt-manager or just importing the libvirt python module fails with
undefined symbol error for symbols that are listed in
libvirt_private.syms.

I'll have to investigate more.

Matthias




More information about the libvir-list mailing list