[cfe-dev] RFC: Only change libclang.so SONAME when the ABI changes

Tom Stellard via cfe-dev cfe-dev at lists.llvm.org
Tue Jul 6 21:24:01 PDT 2021

On 6/25/21 9:04 PM, Tom Stellard wrote:
> Hi,
> I would like to propose that we only change the SONAME of libclang.so
> (this is the library that contains the C API for clang) when the ABI changes.
> Currently, we change the SONAME whenever we bump the major version of LLVM,
> but the C API tends to not change that often.
> This change will allow operating system maintainers to update the version
> of libclang.so in their operating system without forcing rebuilds of
> all programs that depend on it.
> The steps for implementing this change would be:
> - Hard-code the SONAME for libclang.so to libclang.so.13 (which is the current
> - Hard-code the symbol versions to LLVM_13 (which is the current symbol version)
>    for all existing symbols.
> - Add a test case that checks if a new symbol has been added and ensures it has
>    the correct symbol version.

Here is a patch that implements this first part:

I wasn't able to figure out how to write the test case that I wanted to do, so
I left that out.  I'm open to suggestions if someone has an idea how to do it.


> - Add a buildbot that uses abi-compliance-checker[1] to ensure that ABI/API does
>    not change unexpectedly.
> - The next time the ABI of libclang.so is changed, the SOANME will be updated to
>    libclang.so.$LLVM_MAJOR_VERSION.
> What do you think?
> -Tom
> [1] https://lvc.github.io/abi-compliance-checker/

More information about the cfe-dev mailing list