[Top][All Lists]

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

bug#8765: Incorrect library versioning on *BSDs

From: Lasse Collin
Subject: bug#8765: Incorrect library versioning on *BSDs
Date: Mon, 30 May 2011 11:46:56 +0300
User-agent: KMail/1.13.7 (Linux/2.6.38-ARCH; KDE/4.6.3; x86_64; ; )

(Please CC replies to me, I'm not subscribed to the list.)

It seems that libtool does library versioning wrong on FreeBSD, NetBSD, 
OpenBSD, MirOS BSD (based on OpenBSD), and probably also DragonFly BSD 
(based on FreeBSD). I'm not an expert with *BSDs, but I have understood 
that the versioning should be similar to version_type=linux:

    GNU/Linux:  libfoo.so.$major.$age.$revision
    FreeBSD:    libfoo.so.$major  (It's ELF. a.out is dead.)
    NetBSD:     libfoo.so.$major.$age
    OpenBSD:    libfoo.so.$major.$age

That is, it shouldn't be libfoo.so.$current or 
libfoo.so.$current.$revision. Should this be fixed? The hard part is 
dealing with the (temporary) breakage that the fix would cause. It is 
problematic especially because the version numbers will get smaller 
(current vs. current-age) and thus may conflict with older versions of 
the library that have been built with older libtool versions.

There are some operating system specific hacks that fix the incorrect 
versioning used by unpatched GNU libtool. At least some packages in the 
FreeBSD ports use FreeBSD-specific "ltverhack". I don't know if it is 
used with all ports that use libtool.

On OpenBSD it's packager's job to handle library versioning, so upstream 
versioning is overriden. Also, most packages needing libtool get built 
using OpenBSD's own libtool (a Perl script) instead of GNU libtool.

MirOS BSD has a patched libtool which does the versioning correctly.

GNU libtool in NetBSD's pkgsrc has patches that change library 
versioning for multiple operating systems, including the *BSDs mentioned 

If GNU libtool is fixed to use correct versioning on *BSDs, the 
existence of the OS-specific hacks might mean that many libraries won't 
be affected at all because the old libraries have already been built 
with corrected versioning. On the other hand, some libs might not have 
used those hacks so some breakage may still happen. Fixing the 
versioning in GNU libtool might also break the hacks that have been in 
use for many years.

Below are some references I happened to find.


  From FreeBSD Developer's Handbook:

  Look for "ltverhack" on this page:

  Something more about ltverhack:


  Patches in pkgsrc, see especially manual-libtool.m4:


  Library versioning:

  OpenBSD libtool:


  A recent request to get MirOS BSD support into GNU libtool:

Lasse Collin  |  IRC: Larhzu @ IRCnet & Freenode

reply via email to

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