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

Re: Should .a library contains non-reallocatable code?



Hi,

On 14.02.2015 13:31, Dmitry Katsubo wrote:

> I wonder what is the current state-of-art concerning the code in .a
> library (archive for static linking). Should it contain PIC code?

Normally, no.

> Situation: Dynamic (.so) library needs to be linked against such (.a)
> library.

That is generally frowned upon.

I do the same thing with vxi and librevisa -- I build the static library
with PIC code and statically link into librevisa, and I justify that by
the vxi code being generated RPC stubs that really don't need an extra
shared library package.

However, your case is different: a quick hack package without a stable
ABI is the exact opposite. From a distribution point of view, it is
difficult to track what version of a static library was linked, which is
why we use shared libraries as often as we can.

The slightly suboptimal solution for a library without a stable ABI is
to use a version number in the SONAME, leave out the version from the
package name and build a shlibs file that uses a dependency with a fixed
version.

This means that all packages using this library can only be upgraded
together, but at least it doesn't introduce lots of NEW packages with
every upload.

   Simon


Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: