HaikuPorts
  • Login
  • Preferences
  • Help/Guide
  • Wiki
  • Timeline
  • Roadmap
  • View Tickets
  • Search
  • Port Log
  • Blog

Context Navigation

  • ← Previous Change
  • Wiki History
  • Next Change →

Changes between Initial Version and Version 1 of LibVersions


Ignore:
Timestamp:
05/13/10 13:51:25 (5 years ago)
Author:
scottmc
Comment:

Taken from an email from Truls Becken to the Haiku-Dev mailing list

Legend:

Unmodified
Added
Removed
Modified
  • LibVersions

    v1 v1  
     1 
     2== Library Versions == 
     3 
     4The ELF shared library system was designed to handle multiple versions. 
     5 
     6If you look inside /boot/common/lib, you see that every library has two symlinks pointing to it, e.g: 
     7 
     8~> ll /boot/common/lib/libcurl.so* 
     9lrwxrwxrwx 1 user root     16 May  9 04:11 /boot/common/lib/libcurl.so -> libcurl.so.4.2.0 
     10lrwxrwxrwx 1 user root     16 May  9 04:11 /boot/common/lib/libcurl.so.4 -> libcurl.so.4.2.0 
     11-rwxr-xr-x 1 user root 311057 May  9 04:11 /boot/common/lib/libcurl.so.4.2.0 
     12 
     13When building a program, the linker looks for libcurl.so, finds it, and looks inside the file, which in this case will actually be libcurl.so.4.2.0. From the file, the linker reads the "soname", which in this case will be libcurl.so.4 and this is what the runtime loader will be looking for when the binary is executed later. (See for instance http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html) 
     14 
     15This way, the library can be updated to an ABI compatible version, and programs will make use of the new version without any relinking or re-packaging. When an ABI incompatible version is added to the system, it will be with a bumped soname, so that they can co-exist as libcurl.so.4 and libcurl.so.5 for instance. 
     16 
     17Now, let's look at how an application is linked: 
     18 
     19~> objdump -x /boot/apps/WebPositive/WebPositive | grep NEEDED 
     20 NEEDED      libjavascriptcore.so 
     21 NEEDED      libwebcore.so 
     22 NEEDED      libwebkit.so 
     23 NEEDED      libcurl.so.4 
     24 NEEDED      libicu-common.so.4.2 
     25 NEEDED      libicu-data.so.4.2 
     26 NEEDED      libpng.so.1.4 
     27 NEEDED      libsqlite3.so.0 
     28 NEEDED      libxml2.so.2 
     29 NEEDED      libz.so.1 
     30 NEEDED      libbe.so 
     31 NEEDED      libbsd.so 
     32 NEEDED      liblocale.so 
     33 NEEDED      libnetwork.so 
     34 NEEDED      libstdc++.so 
     35 NEEDED      libtracker.so 
     36 NEEDED      libtranslation.so 
     37 NEEDED      libroot.so 
     38 
     39Javascriptcore, webcore and webkit are in WebPositive's ./lib folder, at least for the time being, and therefore do not really need versioning. 
     40 
     41The libs that expose APIs from the Haiku Kits don't need it either if the devs plan to never break binary compatibility there (and if they do, they can get around it by renaming the file even if the original name did not imply any versioning). 
     42 
     43Curl, sqlite3 and xml2 are found in /boot/common/lib and follow the scheme outlined above. ICU, libpng and libz are from /boot/system/lib, which does not include a symlink for each soname. This is a little unusual, but not a problem. The actual version of libpng.so.1.4 for instance is 1.4.x, so the filename is just missing the minor version rather than being pointed to by a symlink. This means that when libpng breaks binary compatibility, the version will be 1.5.x, and so Haiku may include both libpng.so.1.4 and libpng.so.1.5 at that point if needed. 
     44 

Trac Powered

Powered by Trac 0.13dev-r10686
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/