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

Daniel P. Berrange berrange at redhat.com
Wed Jun 23 10:50:55 UTC 2010


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.


Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list