[postgis-devel] liblwgeom versioning

Sebastiaan Couwenberg sebastic at xs4all.nl
Sun Oct 11 14:32:43 PDT 2015


On 09-10-15 10:10, Sandro Santilli wrote:
> On Thu, Oct 08, 2015 at 08:03:01PM +0200, Sebastiaan Couwenberg wrote:
>> On 08-10-15 13:35, Sandro Santilli wrote:
>>> As we want to ship the fix in PostGIS 2.2.1 but still avoid to
>>> trigger crashes from any binary dynamically-linking to liblwgeom
>>> the library SONAME needed to be changed.
>>
>> It's seems that the addition of the -release along with -version-info
>> now creates an invalid .so symlink. PostGIS 2.2.0 creates:
>>
>>  /usr/lib/liblwgeom-2.2.so.2.2.0
>>  /usr/lib/liblwgeom-2.2.so.2 -> liblwgeom-2.2.so.2.2.0
>>  /usr/lib/liblwgeom.so -> liblwgeom-2.2.so.2.2.0
>>
>> Whereas liblwgeom-2.2.so -> liblwgeom-2.2.so.2.2.0 was expected.
> 
> I tought this was actually a feature, as it allows for linking
> with -llwgeom. Is it not ?

The Autotools documentation seems to be conflicting. The libtool manual
'Managing release information' section [0] show this to be the expected
behaviour.

The 'Autotools Mythbuster' documentation [1] explicitly states that
combining -release & -version-info is wrong:

"
 While libtool was designed to handle the presence of multiple
 libraries implementing the same API (and even ABI) on the system,
 distributions made that necessity moot. On the other hand, it is not
 uncommon for multiple versions of a library to be installed, with
 multiple API implemented, allowing consumers to pick their supported
 version. This is the case, for instance, of Gtk+ and Glib.

 The first reaction would be to combine the two options, -release and
 -version-info; this would, though, be wrong. When using -release the
 static archive, the one with .a extension, the libtool archive (see
 Section 5, “Libtool Archives”) and the .so file used by the link
 editor would not have a revision appended, which means that two
 different version of the library can't be installed at the same time.

 In this situation, the best option is to append part of the library's
 version information to the library's name, which is exemplified by
 Glib's libglib-2.0.so.0 soname. To do so, the declaration in the
 Makefile.am has to be like this:

 lib_LTLIBRARIES = libtest-1.0.la

 libtest_1_0_la_LDFLAGS = -version-info 0:0:0
"

This was pointed out by Jakub Wilk on the debian-mentors list where
inquired about this issue [2].

>> The SOVER should probably be included in the liblwgeom.la filename too.
>>
>> This will also include it in the liblwgeom.a filename.
> 
> See above.

Ditto.

>> On the other hand, the libtool manual seems to suggest that not
>> including the release version in the .so symlink is the expected and
>> correct behaviour.
> 
> Right, and I can see how it can be useful.

As long as coinstallability of minor versions is not required on Linux I
think we can leave it as it is now (combining -release & -version-info)
despite contrary advice. It's all just a hack to accommodate Windows
anyway, for Linux -version-info alone is sufficient.

[0]
https://www.gnu.org/software/libtool/manual/html_node/Release-numbers.html
[1] https://autotools.io/libtool/version.html#idm117385101112624
[2] https://lists.debian.org/debian-mentors/2015/10/msg00162.html

Kind Regards,

Bas

-- 
 GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1



More information about the postgis-devel mailing list