This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Reintroduce (ldconfig-compatible) SOVERSIONs on shared libraries
ClosedPublic

Authored by mgorny on Sep 20 2016, 3:14 AM.

Details

Summary

Reintroduce versioning of shared libraries via SOVERSION, addressing the issues with the previous design, since Gentoo is relying on shared-split install of LLVM. The SOVERSIONs were originally introduced in r229720 for all libraries, and removed in r252093 in favor of custom SONAME. As far as I understand, the major concern with the old versioning was that the used versions were incompatible with ldconfig.

Having considered that, this commit introduce SOVERSIONS with the following considerations:

  1. SOVERSIONs are formed of major & minor version concatenated -- i.e. for 4.0 its .so.40. This matches the common practice where the first version number indicates ABI breakage, and therefore fixes the issues

with ldconfig. Additionally, VERSION with the remaining verion components appended is used, however this is not strictly necessary.

  1. The versioning is only applied to libraries with no explicit SONAME specified -- i.e. it won't apply to libLLVM but only to the split libraries. It will also apply to libraries installed by the subprojects.
  1. The versioning is only done on *nix systems, Darwin excluded. This matches the current use of SONAME.

Diff Detail

Event Timeline

mgorny updated this revision to Diff 71911.Sep 20 2016, 3:14 AM
mgorny retitled this revision from to [cmake] Reintroduce (ldconfig-compatible) SOVERSIONs on shared libraries.
mgorny updated this object.
mgorny added a subscriber: llvm-commits.
ismail added a subscriber: ismail.Sep 20 2016, 3:19 AM

Gentle ping. I would really like to get this settled before we unleash LLVM 3.9.0 on Gentoo since we need SONAMEs, and I would rather avoid continuing to use custom SONAMEs if we could agree on something.

beanz accepted this revision.Oct 3 2016, 2:45 PM
beanz edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Oct 3 2016, 2:45 PM
mgorny closed this revision.Oct 3 2016, 11:18 PM

r283189, thanks.