You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rust symbols have hashes in them. Both the old symbol mangling format and the new one.
old format, demangled: wee_alloc::alloc_first_fit::h6af2b7fe0cb0a62f
new format, demangled: core[369c8b9e1df8da3a]::slice::sort::recurse::<Foo, <[Foo]>::sort_unstable::{closure#0}>
(Note, you can enable the new symbol format with RUSTFLAGS=-Zsymbol-mangling-version=v0 when building with cargo)
In the old format, the hash is the only thing differentiating between different monomorphizations of the same generic function. Therefore, it might make sense to keep the hash for the old symbol format.
The new format has the type parameters mangled into the symbol's name (eg Foo in the symbol above). In this case, it should be fine to strip the hash all the time (but perhaps with an option to disable the stripping?)
Good point, it should probably only be stripped if it is a unique monomorphization. Even within the same crate, we can have multiple duplicate monomorphizations in different codegen units, IIUC.
🐛 Bug Description
Rust symbols have hashes in them. Both the old symbol mangling format and the new one.
wee_alloc::alloc_first_fit::h6af2b7fe0cb0a62f
core[369c8b9e1df8da3a]::slice::sort::recurse::<Foo, <[Foo]>::sort_unstable::{closure#0}>
(Note, you can enable the new symbol format with
RUSTFLAGS=-Zsymbol-mangling-version=v0
when building withcargo
)In the old format, the hash is the only thing differentiating between different monomorphizations of the same generic function. Therefore, it might make sense to keep the hash for the old symbol format.
The new format has the type parameters mangled into the symbol's name (eg
Foo
in the symbol above). In this case, it should be fine to strip the hash all the time (but perhaps with an option to disable the stripping?)twiggy version: master
🌍 Test Case
👟 Steps to Reproduce
Precise steps describing how to reproduce the issue, including commands and
flags run. For example:
rustc --target wasm32-unknown-unknown --crate-type cdylib -C opt-level=3 -C lto=fat test_case.rs -o test_case_old_symbols.wasm
rustc -Zsymbol-mangling-version=v0 --target wasm32-unknown-unknown --crate-type cdylib -C opt-level=3 -C lto=fat test_case.rs -o test_case_new_symbols.wasm
twiggy top test_case_old_symbols.wasm
twiggy top test_case_new_symbols.wasm
😲 Actual Behavior
Function names have hashes
🤔 Expected Behavior
New symbols have hashes removed
(TBD exactly what to do with old symbols' hashes)
The text was updated successfully, but these errors were encountered: