[libcxx-dev] Option to disable inline namespacing completely?

Kristina Brooks via libcxx-dev libcxx-dev at lists.llvm.org
Fri Nov 16 14:31:14 PST 2018

I think the ABI breaking part goes without saying, it's the reason we have
unstable (currently sitting at version 2) ABI, it's already massively
incompatible with ABI version 1 due to different layouts of things like
std::basic_string (due to SBO changes).

As far as enabling it goes, currently to use version 2 of the ABI (which is
still unstable), one has to explicitly specify that when building libc++,
said libc++ is not going to be ABI compatible with anything earlier than
it. Currently one can simulate that by enabling LIBCXX_ABI_UNSTABLE without
bumping up the ABI version which basically toggles ABI v2 without changing
the versioning prefix from __1 causing anything linked to it to break
during early initialization.

Regarding the heuristic, yes that was my suggestion since this can be
handled in the Clang mangler, meaning we could simply check if it's __1
(the reserved "stable" inline namespace, which is currently in use, as
such, short mangling would be disabled during IR CodeGen). Otherwise if the
namespace is a reserved (as discussed previously regarding numeric
versioning being reserved for libc++'s own use while) and is in the form of
__N with N above 1, short mangling could be applied, for example
with LIBCXX_ABI_VERSION=2 (Currently in use by Fuchsia, although they do
not mind breaking changes so far, as explicitly stated during discussions
of marking 2 as "stable").

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-dev/attachments/20181116/00e9983e/attachment.html>

More information about the libcxx-dev mailing list