bug-gnulib
[Top][All Lists]
Advanced

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

Re: [libvirt] namespace clean shared libraries


From: Wido den Hollander
Subject: Re: [libvirt] namespace clean shared libraries
Date: Thu, 02 Aug 2012 13:18:12 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]