New Pixman Naming Scheme

Daniel Stone daniel at fooishbar.org
Tue Aug 7 15:51:52 PDT 2007


On Tue, Aug 07, 2007 at 11:19:14PM +0100, Colin Guthrie wrote:
> Soeren Sandmann wrote:
> > Having a version number in the library name is just good practice
> > IMO. It doesn't hurt anything and it substantially reduces the pain
> > involved if an incompatible version has to be released.
> 
> Forgive me if I'm missing something but have major numbers not been part
> of libraries for ages???
> 
> if I have
> /usr/lib/libpixman.so.1.0
> 
> installed with cairo linked against it, there is nothing wrong with me
> also having
> /usr/lib/libpixman.so.2.0 installed and having Xserver link against that!!

The problem is that if you have libpixman.so.1 with int foo(long bar),
and libpixman.so.2 with void foo(int bar), which are _both linked into
the same executable_: say Cairo links against 2, and GTK+ links against
1.  Resolution for foo will be random, thanks to a flat namespace, so
eventually you're going to hit the wrong one.

You can fix this pretty easily with versioned symbols, but pixman
doesn't do that.

OTOH, if you avoid function name reuse (i.e. rename any function that
changes signature or behaviour, which includes all dependent signatures:
if you change a structure size, you must rename all functions that get
that structure passed in), then you're fine without versioned symbols.

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20070808/670859c2/attachment.pgp>


More information about the xorg mailing list