[libvirt] namespace clean shared libraries

Wido den Hollander wido at widodh.nl
Thu Aug 2 11:18:12 UTC 2012


On 07/08/2012 07:51 PM, Bruno Haible wrote:
> Daniel P. Berrange wrote:
>> If its better to just do it in libvirt config.h, then we
>> can do that too
>
> Yes, doing '#define foo libvirt_foo' in config.h is the preferred way
> of achieving a namespace clean shared library.
>
> There are two ways to generate these #defines:
>
> 1) You collect manually, on various systems, the set of symbols that you
>     don't want to clash with symbols from other shared libraries. You need
>     to do this on various systems, because gnulib may define functions
>     'rpl_fflush' or 'dprintf' on some systems and not on others.
>
> 2) You collect, from a set of header files, the set of symbols that you
>     want to have exported, and process all other symbols with
>       '#define foo libvirt_foo'
>
>     This approach is more robust, but requires to compile all *.o files
>     twice: Once with the initial settings (no #define), and once for real.
>
>     This approach is implemented in libunistring. Look at the config.h rule
>     in this Makefile.am [1]. There are two auxiliary scripts: 'declared.sh' [2]
>     extracts the symbols from a .h file (assuming a particular coding style).
>     'exported.sh' [3] extracts te symbols of a .o file.
>

I don't want to rush anything, but I see that libvirt 0.10 will be 
coming out soon and I don't think this has been corrected?

Right now this means that libvirt is not usable on Ubuntu 12.04 systems 
when you want to use the secrets of libvirt.

Is it feasible to have this fixed before 0.10 comes out?

Wido

> Bruno
>
> [1] http://git.savannah.gnu.org/gitweb/?p=libunistring.git;a=blob;f=lib/Makefile.am
> [2] http://git.savannah.gnu.org/gitweb/?p=libunistring.git;a=blob;f=lib/declared.sh
> [3] http://git.savannah.gnu.org/gitweb/?p=libunistring.git;a=blob;f=lib/exported.sh.in
>




More information about the libvir-list mailing list