3 ms·
The default name mangling of Rust library symbols is already kinda versioned because it includes a hash of the library, so two different versions of a library c
by kimundi 11y ago
The default name mangling of Rust library symbols is already kinda versioned because it includes a hash of the library, so two different versions of a library can coexist at the same time.
As far explicitly using the symbol versioning scheme you mentioned, you can do it with an attribute today:
https://play.rust-lang.org/?gist=92be155702d53c6411b2&version=stable https://play.rust-lang.org/?gist=92be155702d53c6411b2&versio...
(Disclaimer: I haven't actually compiled this as a dynamic library and checked, but its what that attribute is for, and the names seem to be used verbatim in the ASM output)
- 102030485868 11y agoWoah, I didn't know that is a thing. Thank you! It seems as if symbol versioning in Rust is nicer than in C. I'll have to play around with that a little bit. I'm hoping I never to have to deal with writing version scripts or inline assembly again -- or at least having to write less.
- kimundi 11y agoNote that I'm not really familiar enough with versioned symbols to know whether there is much more to it than just a specially formatted name.