Opened 10 years ago

Closed 10 years ago

#41 closed defect (fixed)

libtool: DLL version suffix doesn't follow version-info idea

Reported by: Silvan Scherrer Owned by:
Priority: major Milestone:
Component: libtool Version:
Severity: Keywords:
Cc:

Description

in the dll creation stage we add the $current number to the dll name. but when i read the docs https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html it seems we should do $current - $age

Change History (6)

comment:1 by Silvan Scherrer, 10 years ago

Component: *nonelibtool

comment:2 by dmik, 10 years ago

This article sheds some light on the -version-info magic: https://www.sourceware.org/autobook/autobook/autobook_91.html. From it it's pretty clear what the age part in the current:revision:age scheme actually means. It's the number of previous interfaces starting from the current one that the current one also supports (i.e. is backward compatible). So if we have, say, 6:0:3 it means that the current interface 6 is backward compatible with interfaces 5, 4 and 3. So if we want to express this in terms of binary DLL compatibility on OS/2 (where a number is used to differentiate between incompatible DLLs), we should indeed subtract age from current to get an number that uniquely identifies incompatible ABIs. So in case of the above example this will be number 3.

The unusual thing here is that when the ABI changes so that backward compatibility is broken (by e.g. removing or changing APIs), many projects usually set current to a value which is greater by 1 than the last value of current that it had when age was 0. On a straight line this looks like current goes backwards (gets decreased), but what is surely increased in this case (by 1) is the difference between current and age.

So, for example in poppler we will see this: http://trac.netlabs.org/ports/log/poppler/vendor/current/qt4/src/Makefile.am?rev=889:

  1. 0.16.3 changes version info from 6:0:3 to 7:0:4, the diff is 3, ABI is backward compatible.
  2. 0.18.1 changes version info from 7:0:4 to 10:0:7, the diff is 3, ABI is backward compatible.
  3. 0.20.3 changes version info from 10:0:7 to 4:0:0, the diff is 4, ABI is NOT backward compatible.
  4. 0.22.0 changes version info from 4:0:0 to 6:0:2, the diff is 4, ABI is backward compatible.

And so on.

I will change libtool in the next days as it's important (used in many projects now).

comment:3 by dmik, 10 years ago

Summary: libtoollibtool: DLL version suffix doesn't follow version-info idea

comment:4 by dmik, 10 years ago

I also checked binary builds of other software on Linux (like curl, expat): all use subtraction to get the major DLL version number. Or, to be exact, the mapping between version-info and the full DLL suffix is as follows: name.so.(current-age).age.revision. In our case it must be only current-age (i.e. the major number which is responsible for backward compatibility). This is also proven by reading ltmain.m4sh (around line 6750).

comment:5 by dmik, 10 years ago

I fixed the problem in r891. The RPM packages are now being rebuilt and will be uploaded shortly.

Note that we will also have to rebuild at least curl and expat packages since they already got wrong version numbers (just $current). There is a potential problem with the CURL DLL because Yuri also missed the -version-info logic when manually hacking the CURL makefiles back then so his DLL was named curl7.dll. This is wrong. The correct name is curl4.dll. All packages using it will have to be rebuilt. The list is quite big, a quick search across all .spec files gives: clamav, git, liboauth, openssh, rpm, rpm48. I will ask Yuri to assist me here.

Version 0, edited 10 years ago by dmik (next)

comment:6 by dmik, 10 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.