Add SOVERSION to shared library targets - #76
Closed
rootkiller6788 wants to merge 1 commit into
Closed
Conversation
fb303 and fb303_thrift_cpp set the VERSION target property but not SOVERSION, so the shared libraries are built without a SONAME. This breaks consumers that link against the SONAME (e.g. packaging tools and applications that resolve the runtime dependency by soname). Derive SOVERSION from the major component of PACKAGE_VERSION so that the SONAME (libfb303.so.<major>) stays stable across minor and patch releases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #7. The shared libraries built by the CMake build set
VERSIONbut notSOVERSION, solibfb303.so.1.0.0andlibfb303_thrift_cpp.so.1.0.0are produced with no SONAME.Without a SONAME, the runtime linker and packaging tooling cannot identify the libraries:
ldconfig/lddreport the dependency as the raw file name rather than a stable SONAME.Provides: libfb303.so.1style dependency.dlopenor link by SONAME against an installed fb303 fail to resolve it after an upgrade.Changes
FB303_SOVERSIONfrom the major component ofPACKAGE_VERSIONinCMakeLists.txt.SOVERSION ${FB303_SOVERSION}alongside the existingVERSIONon bothfb303andfb303_thrift_cpp, so the SONAME (libfb303.so.1,libfb303_thrift_cpp.so.1) stays stable across minor/patch releases.Verification
main:set_property(TARGET ... PROPERTY VERSION ${PACKAGE_VERSION})with noSOVERSIONin bothCMakeLists.txtandfb303/thrift/CMakeLists.txt.BUILD_SHARED_LIBSboth on and off.