Giter VIP home page Giter VIP logo

Comments (7)

christinaa avatar christinaa commented on July 20, 2024

Hi,

Wanted to chime in and mention that we discussed this on libcxx-dev mailing lists and IRC and want to come up with a more compact form of mangling for versioned inline namespaces used by libc++ (Handling it at Clang's mangler/demangler's level) as we previously decided that std::__[0-9]+ was reserved for libc++'s use (since there was a request to allow to configure a custom versioning namespace so the halfway solution was to reserve numeric parts of the namespace to libc++ and allow any other legal or illegal variation or characters to be specified there via a CMake option.

Now comes the main issue, while ABIv1 (std::__1) is set in stone and is considered stable, ABIv2 isn't and Fuchsia doesn't mind ABI breaks (they're the only notable users of ABIv2 which is the current unstable ABI). I'd like to propose some variation of shorthand mangling for the reserved namespaces of libc++ that would eliminate tons of clutter as far as debug data goes (I've covered the rationale extensively in this thread):

http://lists.llvm.org/pipermail/libcxx-dev/2018-November/000063.html

However agreeing on the mangling style while at the same time keeping it as short as possible and avoiding possible conflicts with libstdcxx is one of the issues. I don't think there's much point in extending this to user configurable namespaces as we don't have any control over that but I would very much like to have a consensus on having compact mangling forms for std::__2 (ABIv2) versions of string, basic_string and all others originally covered by the IA64 doc where they're available only at the top level (aka no inline namespaces).

Chandler said that this is not up to the C++ committee and that this should be brought up here instead. Given the recent improvements in both mangling and demangling code in Clang, I could handle the needed changes myself as far as LLVM/Clang go, though said change would need to be incorporated into IA64 ABI first with some sort of standard for mangling symbols in ABIv2 and above. Since I'm notoriously bad at writing proposals, I'm not sure what the new mangling scheme could/should look like, and I failed to get much feedback from Louis and Eric seems too busy, so it seems it's down to me.

Compatibility with GCC is always a concern as well so I'm not sure how to address that as I'm not a GCC contributor and am not that familiar with the GNU side of things. I am very much hoping that someone could provide some kind of a draft of what the shorthand mangling scheme would be like, keeping in mind that we've drawn the conclusion (at least on libc++ side) that std::__N or more specifically std::__2 and above are reserved for C++ stdlib implementers.

Thanks.

from cxx-abi.

christinaa avatar christinaa commented on July 20, 2024

Rest of the discussion is on this PR: #69

from cxx-abi.

urnathan avatar urnathan commented on July 20, 2024

If the std library is ever modilarized, we'll need to attach module-names to those substitutions too. i'm not attempting to do that in the module mangling right now.
Do these substitutions greatly compress manglings in practice? We only have 6 such special cases and there are many more std types.

from cxx-abi.

rjmccall avatar rjmccall commented on July 20, 2024

I think between libstdc++ using ABI tags and libc++ using an inline namespace, the standard manglings are fairly dead, other than the one for std:: itself. But the potential for substitutions to improve symbol sizes is quite large, and it's an important issue in practice; that's what this thread is about.

from cxx-abi.

joshua-arch1 avatar joshua-arch1 commented on July 20, 2024

How is this work going now? Can we have some option to disable inline namespace in libcxx?

from cxx-abi.

joshua-arch1 avatar joshua-arch1 commented on July 20, 2024

I think between libstdc++ using ABI tags and libc++ using an inline namespace, the standard manglings are fairly dead, other than the one for std:: itself. But the potential for substitutions to improve symbol sizes is quite large, and it's an important issue in practice; that's what this thread is about.

In the issue #69, I'm still confused why versioning namespaces in libcxx will not clash with ABI tags in libstdcxx. Sometimes we may need to both use libcxx and libstdcxx, there will be conflicts.

from cxx-abi.

rjmccall avatar rjmccall commented on July 20, 2024

There hasn't been any progress since the discussion in #70, mostly because nobody is working on implementing it.

from cxx-abi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.