On Mon, Jun 28, 2010 at 18:45:31 +0200, Bastien ROUCARIES wrote: > On Mon, Jun 28, 2010 at 4:51 PM, Julien Cristau <jcris...@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
signature.asc
Description: Digital signature