Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang 15 broke ABI without bumping ABI compatibility SOVERSION #60270

Open
bonzini opened this issue Jan 24, 2023 · 4 comments
Open

clang 15 broke ABI without bumping ABI compatibility SOVERSION #60270

bonzini opened this issue Jan 24, 2023 · 4 comments
Labels
ABI Application Binary Interface clang:tooling LibTooling

Comments

@bonzini
Copy link

bonzini commented Jan 24, 2023

clang 15 changed the value of CXCursor_TranslationUnit from 300 to 350 in commit bb83f8e.

This is an ABI breakage; code compiled with new headers will fail to run with old libraries and vice versa. Therefore SOVERSION 13 should not be allowed for clang 15 even if CLANG_FORCE_MATCHING_LIBCLANG_SOVERSION=OFF.

In addition, the exact semantics of CINDEX_VERSION_MAJOR are unclear:

  • in my opinion it should only be for backwards-compatible source/API (not ABI) changes, in which case leaving it to 0 is is fine but the documentation should be updated
  • if ABI changes should also affect CINDEX_VERSION_MAJOR, then it should be bumped to 1
@nikic
Copy link
Contributor

nikic commented Jan 25, 2023

cc @tstellar

@tstellar
Copy link
Collaborator

tstellar commented Feb 8, 2023

This is unfortunate. We have tests that are supposed to catch this, but failed. Maybe we need to run the tests on the main branch and not just on the release branches.

Maybe ask on Discourse about what to do now?

@bonzini
Copy link
Author

bonzini commented Feb 8, 2023

I think for v15 it's enough to tell people not to use CLANG_FORCE_MATCHING_LIBCLANG_SOVERSION=OFF. For v16 however the SOVERSION should be pushed up to 15 when the flag is OFF (and 16 when it is ON, of course).

@h-vetinari
Copy link
Contributor

I think for v15 it's enough to tell people not to use CLANG_FORCE_MATCHING_LIBCLANG_SOVERSION=OFF.

For reference, we've been using this in conda-forge ever since llvm 14 without any reported issues. It's a pretty subtle failure. @bonzini said in an issue linked above:

Yeah, the breakage is subtle and unlikely to cause trouble outside a testsuite (I originally found it via KyleMayes/clang-rs#45), but it sucks nevertheless...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ABI Application Binary Interface clang:tooling LibTooling
Projects
None yet
Development

No branches or pull requests

5 participants