bug-gnulib
[Top][All Lists]
Advanced

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

library symbol versioning hassles


From: Simon Josefsson
Subject: library symbol versioning hassles
Date: Thu, 04 Feb 2010 16:42:51 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)

This isn't strictly gnulib related, but this list is the best community
I know that would be able to answer this question, so pardon this
slightly off-topic discussion...

I maintain some packages that contain shared libraries, for example
libidn and libgsasl, and in recent releases I've added support for
linker version scripts using Wl,--version-script.

People have noticed that this breaks old applications linked against
older libraries without symbol versions, because those applications
cannot find the old symbols.

That observation is correct, and it suggests that I should have
incremented the shared library version of my libraries when I added
symbol versioning.  But that is very unfortunate, since the whole point
of adding symbol versioning was to avoid versioning issues.

Can anyone think of a solution out my problem?  I see two painful
solutions:

1) Increment the shared library version and ask people to rebuild their
   applications against the new shared library.  The API would be
   identical, but the ABI has changed to used versioned symbols.

2) Drop the linker version script, declaring switching to it a failure,
   and reverting back to the stable API/ABI with unversioned symbols.
   This will break applications that were linked against the shared
   libraries with symbol versioning, so arguable I should increment the
   shared library version when I do this...

What I'd like to do is:

3) Make my library export BOTH versioned and unversioned symbols, so
   that old applications built against an unversioned library will
   continue to work, and that new applications will work.  Compatibility
   with the old symbols needs to be kept around forever, but it seems I
   could get the advantages of symbol versioning.

I feel I'm not seeing the great benefit of symbol versioning when it is
creating issues like this in practice, so it is likely that I'm missing
some fundamental insight.  I have read Drepper's DSO-Howto, but it is
more targeted towards people who like to know how things work, rather
than as a guide for maintainers, and I'm having trouble translating the
theory into a best practice.  It's also rather focused on ELF/glibc
systems.

Thanks for any guidance,
/Simon




reply via email to

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