-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking issue for RFC 2603, "Rust Symbol Mangling (v0)" #60705
Copy link
Copy link
Open
Labels
A-name-manglingArea: Name mangling / decoration aka symbol manglingArea: Name mangling / decoration aka symbol manglingB-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.Blocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: 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.Status: 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.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-name-manglingArea: Name mangling / decoration aka symbol manglingArea: Name mangling / decoration aka symbol manglingB-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.Blocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: 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.Status: 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.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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-Z unstable-options(to allow for eventual removal after
v0becomes 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 changerustflagsin.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_BACKTRACEandrustfiltshould work out of the box with either mangling version.Steps:
binutils/gdb(GNUlibiberty)committed as gcc-mirror/gcc@979526c
committed as gcc-mirror/gcc@42bf58b
committed as gcc-mirror/gcc@e1cb00d
(original submission) committed as gcc-mirror/gcc@32fc371
(original submission) committed as gcc-mirror/gcc@8409649
perf(throughbinutils 2.36and/orlibiberty 11.0, or later versions - may vary between distros)valgrindUnresolved questions:
Desired availability of tooling:
Linux:
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:
llvm-cxxfilt): v0 supported since Xcode 13 (note: remember to add extra_in front of symbols to match Mach-O convention).objdump --demangle: v0 supported since Xcode 13.ld -demangle: Does not support v0.CoreSymbolication.framework): Does not support v0.backtrace_symbols/-[NSException callStackSymbols]: Does not demangle.Footnotes
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) ↩
https://sourceware.org/bugzilla/show_bug.cgi?id=27194 ↩
https://github.com/llvm/llvm-project/commit/0a2d4f3f24a377dc7d3cbed16d30603dc27554a8 ↩
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/ ↩
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 ↩