This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Append LLVM_VERSION_SUFFIX to SOVERSION
ClosedPublic

Authored by mgorny on Nov 11 2017, 4:54 AM.

Details

Summary

Append LLVM_VERSION_SUFFIX to SOVERSION. This makes it possible
to use the suffix to differentiate binary-incompatible versions
of LLVM built via BUILD_SHARED_LIBS.

We are planning to use this to temporarily preserve ABI-incompatible
variants of LLVM while switching the system between them, e.g. when
rebuilding the system to use libc++. Normally this would mean that once
LLVM is rebuilt using libc++ all the reverse dependencies become
immediately broken. Using a distinct SOVERSION allows us to preserve
the ABI compatibility before all the packages are rebuilt.

Diff Detail

Event Timeline

mgorny created this revision.Nov 11 2017, 4:54 AM
beanz edited edge metadata.Nov 13 2017, 2:19 PM

Who is the "we" you mention in your commit message? This seems to me like a patch very specific to a single downstream user, and you describe it as temporary, so I'm not convinced we should take it upstream.

Please elaborate on who will use it, what for, and how long you foresee needing it.

We = Gentoo. What for is already described = to install libstdc++ and libc++ versions of LLVM simultaneously for rebuild period. How long = for the time being, or until we find a better working solution.

beanz added a comment.Nov 14 2017, 2:14 PM

Ok. Rather than adding a new option I think you should just add LLVM_VERSION_SUFFIX to the SOVERSION property, then that should work for you.

Hmm, that's an interesting option too. I was thinking of using LLVM_VERSION_SUFFIX originally but it obviously did not go to SOVERSION. Can this have any unforeseen consequences? Should VERSION become *major+suffix-0-minor* then?

beanz added a comment.Nov 15 2017, 1:43 PM

I think leaving VERSION as it is today, but changing SOVERSION to be ${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX} makes the most sense to me. That should meet your needs.

I'm worried that having a different first component of VERSION and SOVERSION could confuse some tools like ldconfig. I'm going to see if we can solve it via different install prefixes with RPATHs first.

mgorny updated this revision to Diff 135789.Feb 24 2018, 2:01 AM
mgorny retitled this revision from [cmake] Allow appending a free-form suffix to SOVERSION to [cmake] Append LLVM_VERSION_SUFFIX to SOVERSION.
mgorny edited the summary of this revision. (Show Details)

@beanz, updated as requested.

Erm, louder ping?

beanz accepted this revision.Aug 8 2018, 1:15 PM

Looks good. Sorry for the extended delay in review.

This revision is now accepted and ready to land.Aug 8 2018, 1:15 PM
mgorny added a comment.Aug 8 2018, 1:41 PM

No problem. Thanks for reviewing both of those patches!

This revision was automatically updated to reflect the committed changes.