[Pkg-gmagick-im-team] Bug#587227: libmagick++3: ABI breakage without SONAME change (yet again)

Julien Cristau jcristau at debian.org
Mon Jun 28 17:23:29 UTC 2010


On Mon, Jun 28, 2010 at 18:45:31 +0200, Bastien ROUCARIES wrote:

> On Mon, Jun 28, 2010 at 4:51 PM, Julien Cristau <jcristau at debian.org> wrote:
> > On Mon, Jun 28, 2010 at 16:14:23 +0200, Bastien ROUCARIES wrote:
> >
> >> upstream does not seems how to use libtools in order to create a publi
> >> private list of symbols using the procedure described in
> >> http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=12841
> >>
> > Oh and fwiw libtool does not create a list.  It takes a list (or regexp)
> > and ensures that only the matching symbols are exported.  You can
> > achieve the same with a linker script or adding visibility attributes in
> > the source code.  But neither of those prevent ABI breakage if public
> > functions or symbols change signature or are removed, which is what
> > happened here.  The only way to prevent this is to either bump SONAME
> > when that happens, or not do those changes in the first place.
> 
> yes but with a list of symbols publically exported we could use a
> script to detect change between version, and ask to bump soname in
> case of missmatch.
> 
> We used with kind of stuff a long time ago, but upstream does not
> always bump soname saying it is a private symbols. We therefore ask to
> only export public symbols and they do not know how to use libtool
> facility. So if you post a patch, we could create a list and after a
> few iteration only export abi stable symbols.
> 
You can get a basic list with:
$ objdump -T /usr/lib/libMagick++.so.3 | grep -v UND

For a demangled list:
$ objdump -T /usr/lib/libMagick++.so.3 | grep -v UND | \
  awk '/Base/ { print $NF }' | c++filt

You can use this as input to a symbols file, see dpkg-gensymbols(1) and
deb-symbols(5).

e.g.:
$ echo 'libMagick++.so.3 libmagick++3 #MINVER#' > libmagick++3.symbols
$ objdump -T /usr/lib/libMagick++.so.3 | grep -v UND | \
  awk '/Base/ { print $NF }'| c++filt | sed -e 's/.*/ (c++)&@Base 0/' \
  >> libmagick++3.symbols

Then adjust for the unavoidable architecture differences.  subsequent
builds of the package will fail if any of those symbols disappear (and
if any new ones appear, you should update the file (so that you'll
notice if they are removed again).  You can do the same with the mangled
symbols if you prefer, just remove the c++filt step and the '(c++)' tag
from the symbols file.

Cheers,
Julien
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-gmagick-im-team/attachments/20100628/59096d1b/attachment-0001.pgp>


More information about the Pkg-gmagick-im-team mailing list