[libcxx-commits] [PATCH] D103160: [libc++] Update ABI docs

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 29 02:56:25 PDT 2021


Quuxplusone added a comment.

@ldionne and @mclow.lists , how does this look now? I still claim it's a step in the forward direction, and would like to get it landed.



================
Comment at: libcxx/docs/DesignDocs/ABIVersioning.rst:15
+frozen and new ABI-breaking changes will start being applied to version ``3``;
+but this has not happened yet.
 
----------------
SeanP wrote:
> What is the intension when version "2" becomes stable?  Vendors will have compilers in service that support version 1 and the vendor customers will have many applications and shared libraries that use version 1.  What will happen when the vendor wants to step up to version 2?  Will the vendor be able to ship both version 1 & version 2?  Will applications be able to use both versions either via object file dependencies (eg. static libs) or via shared libraries?  Or is there a complete breakage?  I hope that is not the case as that would force 3rd party providers to provide two versions of any shared library they sell.
I don't know, but I bet "there is a complete breakage" is closest to the truth.
One thing that's not mentioned in this doc (that probably should be): libc++ nests everything under a C++11 "inline namespace," e.g. `std::any` is really named `std::__1::any`. The `__1` corresponds to C++ macro `_LIBCPP_ABI_NAMESPACE`, which is constructed out of the `_LIBCPP_ABI_VERSION`. So, if you step up to version 2, you'll find that all your standard library stuff has moved to e.g. `std::__2::any`.
You almost certainly won't be able to ship a shared library that works //equally well with either// `std::__1` or `std::__2`. That's kind of the definition of an ABI break.
Vice versa, while `_LIBCPP_ABI_NAMESPACE` affects the mangling of `std::any`, it doesn't affect the mangling of `struct Your::M : std::any {}`, which has all the same problems as `std::any`, ABI-wise. https://godbolt.org/z/qj7fWzbrx


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103160/new/

https://reviews.llvm.org/D103160



More information about the libcxx-commits mailing list