Skip to content

Tracking issue for RFC 2603, "Rust Symbol Mangling (v0)" #60705

@Centril

Description

@Centril

This is a tracking issue for the RFC "Rust Symbol Mangling (v0)" (rust-lang/rfcs#2603).

Current status:

Since #90128, you can control the mangling scheme with -C symbol-mangling-version, which can be:

  • legacy: the older mangling version, still the default currently
    • explicitly specifying this is unstable-only and also requires -Z unstable-options
      (to allow for eventual removal after v0 becomes the default)
  • v0: the new RFC mangling version, as implemented by Introduce Rust symbol mangling scheme. #57967

(Before #90128, this flag was the nightly-only -Z symbol-mangling-version)

To test the new mangling, set RUSTFLAGS=-Csymbol-mangling-version=v0 (or change rustflags in .cargo/config.toml). Please note that only symbols from crates built with that flag will use the new mangling, and that tool support (e.g. debuggers) will be limited initially, until everything is upstreamed. However, RUST_BACKTRACE and rustfilt should work out of the box with either mangling version.

Steps:

Unresolved questions:

Desired availability of tooling:

Linux:

  • Tools: binutils, gdb, lldb, perf, valgrind
Distro binutils1 gdb2 lldb3 perf4 valgrind5
Debian (latest stable): 13 2.44 ✅ 16.3 ✅ 19.0 ✅ 6.12 ❌ 3.24 ✅
Arch 2.45 ✅ 16.3 ✅ 21.1 ✅ 6.17 ✅ 3.25 ✅
Ubuntu (latest release): 25.10 2.45 ✅ 16.3 ✅ 20.0 ✅ 6.17 ✅ 3.25 ✅
Ubuntu (latest LTS): 24.04 2.42 ✅ 15.0 ✅ 18.0 ✅ 6.8 ❌ 3.22 ✅
Fedora (latest release): 42 2.44 ✅ 16.2 ✅ 20.1 ✅ 6.14 ❌ 3.24 ✅
Alpine (latest release): 3.22 2.44 ✅ 15.2 ✅ 20.1 ✅ 6.15 ❌ 3.25 ✅

Windows:

Windows does not have support for demangling either legacy or v0 Rust symbols and requires debuginfo to load the appropriate function name. As such, no special support is required.

macOS:

  • Xcode lldb / Xcode debugger: v0 supported since Xcode 13.
  • Xcode c++filt (llvm-cxxfilt): v0 supported since Xcode 13 (note: remember to add extra _ in front of symbols to match Mach-O convention).
  • Xcode objdump --demangle: v0 supported since Xcode 13.
  • ld -demangle: Does not support v0.
  • System Crash Reporter: Does not support v0.
  • dtrace / Instruments.app (CoreSymbolication.framework): Does not support v0.
  • dsymutil: Relies on DWARF debuginfo, does not demangle.
  • backtrace_symbols / -[NSException callStackSymbols]: Does not demangle.

Footnotes

  1. https://github.com/rust-lang/rust/issues/60705#:~:text=However%2C%20looking%20closer%20at%20how%20it%27s%20driven%2C%20Rust%20v0%20support%20seems%20to%20%22just%22%20require%20libbfd%20from%20binutils%202.36%20(or%20later)

  2. https://sourceware.org/bugzilla/show_bug.cgi?id=27194

  3. https://github.com/llvm/llvm-project/commit/0a2d4f3f24a377dc7d3cbed16d30603dc27554a8

  4. https://github.com/rust-lang/rust/issues/60705#:~:text=The%20patches%20have%20been%20included%20into%20Linux%20v6.16%3A%0Ahttps%3A//lore.kernel.org/lkml/20250603203501.1961487%2D1%2Dacme%40kernel.org/

  5. https://valgrind.org/docs/manual/dist.news.html#:~:text=*%C2%A0%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%C2%A0CORE%C2%A0CHANGES%C2%A0%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D-,*%C2%A0Fix%C2%A0Rust%C2%A0v0%C2%A0name%C2%A0demangling.,-*%C2%A0The%C2%A0Linux%C2%A0rseq

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-name-manglingArea: name mangling / decorationB-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-needs-to-bakeStatus: The implementation is "complete" but it needs time to bake.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions