[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    Re: [cfe-dev] RFC: Only change libclang.so SONAME when the ABI changes
From:       Fāng-ruì Sòng via cfe-dev <cfe-dev () lists ! llvm ! org>
Date:       2021-06-28 23:20:30
Message-ID: CAFP8O3LuWRwbAj9g3wmTEgyoQJK3k6k8aOoXO+G2MBDV-KQEUA () mail ! gmail ! com
[Download RAW message or body]

On Mon, Jun 28, 2021 at 4:02 PM Tom Stellard via cfe-dev
<cfe-dev@lists.llvm.org> wrote:
> 
> On 6/26/21 3:28 AM, Dimitry Andric wrote:
> > On 26 Jun 2021, at 06:04, Tom Stellard via cfe-dev <cfe-dev@lists.llvm.org> \
> > wrote:
> > > 
> > > 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
> > > SONAME).
> > > - 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.
> > > - 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?
> > 
> > This sounds like a good plan in general (not only for libclang :), but
> > how strict is this ABI check? Does *any* change (even like adding a new
> > function) trigger an ABI check error?
> > 
> 
> New functions don't trigger an ABI check error.  The things I've seen
> it flag in the past are: function signature changes, struct size changes,
> and enum value changes.
> 
> -Tom
> 
> > E.g., what are the criteria for bumping the version?
> > 
> > -Dimitry

I find the following two paragraphs in
https://www.debian.org/doc/debian-policy/ch-sharedlibs.html#run-time-shared-libraries
useful

> Every time the shared library ABI changes in a way that may break binaries linked \
> against older versions of the shared library, the SONAME of the library and the \
> corresponding name for the binary package containing the runtime shared library \
> should change.

> The SONAME and binary package name need not, and indeed normally should not, change \
> if new interfaces are added but none are removed or changed, since this will not \
> break binaries linked against the old shared library. ...
_______________________________________________
cfe-dev mailing list
cfe-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic