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

Re: libntl (was Re: Debian singular packages team)



* Andrés Goens <andres@goens.org> [110807 21:15]:
> On Sat, Aug 6, 2011 at 10:10 PM, Bernhard R. Link <brlink@debian.org> wrote:
> > As libntl (at least the Debian version) has a dynamic version added
> > manually (though the patch looks a bit like it comes from SAGE) and
> > has a very specific soname (including all three digits of the version),
> > and some reverse dependencies (not yet even looked at the reverse
> > build dependencies) it might make sense to start with a new source package
> > for newer versions of libntl with it's own -dev package name and
> > gradually use the new one until the old is no longer needed.
>
> I'm not sure I understand exactly what you mean. This new package
> would not include said patch, and just give the static upstream
> libraries?

Currently it looks like that

/usr/lib/libntl-4.5.2.so
/usr/lib/libntl.so -> libntl-4.5.2.so
/usr/lib/libntl.a

So if something get linked against it with -lntl (and static linking
was not requested), then ld opens the libntl.so file and uses that.

In the file it also finds a SONAME header:

$ readelf -d usr/lib/libntl-5.4.2.so | grep SONAME
 0x000000000000000e (SONAME)             Library soname: [libntl-5.4.2.so]

So the generated program/library will get a NEEDED entry:

$ readelf -d a.out | grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [libntl-5.4.2.so]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

That means every time that program is run, it looks for a file
libntl-5.4.2.so in the library search path and uses that for missing
functionality.

Now as the patch in the 5.4.2 packages in Debian have this soname
containing the whole version in them means that every program compiled
against it will only work with a library of the same version installed.
(Which is also the reason why the current lib package is called
libntl-5.4.2 as policy mandates it, as a package with an other file
in it will not be enough for programs depending on it).

While that has the advantage of not having to look for binary
compatibility between versions, it also means that every time
a new version of the library is released (and even if it only
adds 0.0.1), there has to be a new soname, so a new package name,
so new NEW processing, and all packages using this needing recompilation
or Debian keeping a large number of different versions around.

Current upstream uses libtool using --version-info, which means they
have more useful (if upstream would not have already done so, it
would have made sense to introduce this in Debian):

libntl-0.1.0.so
libntl.so.0 -> libntl-0.1.0.so
libntl.so -> libntl-0.1.0.so
libntl.a

and $ readelf -d usr/lib/libntl.so | grep SONAME
 0x000000000000000e (SONAME)             Library soname: [libntl.so.0]

this means that (with some luck of no incompabtible changes needing
a new soname), package names do not need to change, programs not be
recompiled and so on and so forth.

	Bernhard R. Link


Reply to: