[PATCH] D53879: Make libc++'s versioning namespace customizable

Eric Fiselier via Phabricator reviews at reviews.llvm.org
Tue Oct 30 14:00:22 PDT 2018


EricWF added a comment.

In https://reviews.llvm.org/D53879#1280924, @kristina wrote:

> LG, one suggestion, would it be possible to request the `std::` namespace (disable inline namespaces altogether) by supplying a blank string?
>
> Being able to avoid versioning is useful on embedded systems or any other systems that have a more controlled environment where only one libc++ is pretty much guaranteed? (this allows for compact mangling of certain types like std::string, which in turn saves a very significant amount of space as the full mangled name for it otherwise is fairly long and it appears in symbol tables and debug data for many kinds of template instantiations). Same applies to streams and some other types that have shorthand reserved mangled forms, at least with IA64 ABI.
>
> If I understand correctly currently a blank string is simply ignored and `__N` form is used.


Yeah, that seems reasonable to me. I'll make the change.



================
Comment at: CMakeLists.txt:685
+if (NOT LIBCXX_ABI_NAMESPACE STREQUAL "")
+  if (NOT LIBCXX_ABI_NAMESPACE MATCHES "__.*")
+    message(FATAL_ERROR "LIBCXX_ABI_NAMESPACE must be a reserved identifier.")
----------------
ldionne wrote:
> `__.+`? Or do we want to allow `__`?
In addition do we want `_Foo`. My thinking is we should probably allow users to foot-gun themselves as much as they want. 

We should probably document that we make no promises that we don't introduce names which conflict with their custom namespace name.


Repository:
  rCXX libc++

https://reviews.llvm.org/D53879





More information about the libcxx-commits mailing list