[libcxx-dev] Clarification around ABI version

Louis Dionne via libcxx-dev libcxx-dev at lists.llvm.org
Fri Oct 5 10:39:35 PDT 2018

> On Oct 3, 2018, at 18:27, Petr Hosek via libcxx-dev <libcxx-dev at lists.llvm.org> wrote:
> Thanks Marshall and Eric, this clarifies the situation.
> On Mon, Oct 1, 2018 at 9:23 PM Marshall Clow <mclow.lists at gmail.com <mailto:mclow.lists at gmail.com>> wrote:
> Since you link libc++ statically, and have no abi concerns, I would use `_LIBCPP_ABI_UNSTABLE`.
> This contains changes/improvements/bug fixes that we were unable to ship generally, because of ABI concerns.
> I've tried this and I think it'd work for us but there is one issue, with LIBCXX_ABI_UNSTABLE, libc++ build uses 1 as SOVERSION so we end up with libc++.so.1.0 as the filename which is technically incorrect. However, I don't know what would be the best solution here.
> We could use a string instead, e.g. 'unstable' but that might break clients who assume it's a number (even though in ELF it's an arbitrary string). We could also choose a meaningless number, e.g. 0, so the filename would be libc++.so.0.0.
> Alternatively, we could disable the use of SOVERSION and VERSION for unstable ABI, SOVERSION is primarily needed using the library as part of the system installation, but for unstable ABI that's unlikely to be the case. So the name of the library would be just libc++.so. However, that introduces another issue with the linkerscript which currently uses that name and uses the actual library as the input. We could rename the library to libc++_internal.so or we could make the Clang driver pass -lc++abi explicitly and avoid the need for the linkerscript. The latter is fine for Fuchsia since we don't currently support other C++ ABI libraries, but may not work for other targets.
> Do you have any opinions on this?

I would personally be more comfortable with explicitly encoding the fact that the library is unstable in its name. Exactly how we do that is not my primary concern, but just  naming it `libc++.so` would not be great IMO.


> _______________________________________________
> libcxx-dev mailing list
> libcxx-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-dev/attachments/20181005/d063a78e/attachment.html>

More information about the libcxx-dev mailing list