How to use PROPERTIES VERSION and SOVERSION?

Thiago Macieira thiago at kde.org
Fri Apr 11 14:23:48 CEST 2008


On Friday 11 April 2008 14:08:39 Friedrich W. H. Kossebau wrote:
> Indicator fur human eyes or used by the linker?
> So kdelibs 4.1 the SOVERSION should be one higher than for kdelibs 4.0?
> Because code compiled against 4.1 would not see the same ABI when running
> with 4.0
>
> Yet GENERIC_LIB_SOVERSION is just set to "4". I miss something, obviously.

ELF doesn't support that. It should support two numbers: the minimum version 
and the current. That is, kdelibs 4.1 is backwards compatible with 4.0; Qt 
4.4 is backwards compatible with 4.0 as well (including all in-between).

What it supports is the concept of "SONAME". It means that, if the name 
matches, it should be usable. The idea is that *future* versions of that 
library will be compatible with the one you have now. But that doesn't mean 
your application will work with older versions.

> libmylibname.so.6.1 - the real file, name used to separate the different
> versions

Used by no one.

> libmylibname.so.5 - used by whom? linker?

Used by the dynamic linker (run time).

> libmylibname.so - used by whom? linker?

Used by the static linker (compile time).

Process is:
1) static linker (ld) gets -lfoo
2) ld finds libfoo.so
3) ld extracts the DT_SONAME symbol from the library
4) soname = "libfoo.so.N"
5) ld writes to the executable: DT_NEEDED "libfoo.so.N"

Later:
6) application is loaded
7) dynamic linker (ldd) sees DT_NEEDED libfoo.so.N
8) ldd tries to load libfoo.so.N

This is what happens on ELF-based systems. On MacOS X, it's exactly the same, 
except names change (DT_SONAME, DT_NEEDED are ELF macro names; MacOS X uses 
Mach-O executables; the dynamic linker in MacOS is called "dyld"). 

On Windows, it's also similar, but there's no version number. On the other 
hand, it's not symlink either. There's a link-time library (libfoo.a on MinGW 
or foo.lib on MS compilers) and a dynamic library (foo.dll). Somewhere in the 
link library there's the name of the dynamic library.


-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20080411/32c991c8/attachment.pgp 


More information about the Kde-buildsystem mailing list