New unresolved question section: Rust standard library#1
Conversation
| The following options have been identified so far as a potential way for | ||
| hiding symbols coming from Rust standard library: | ||
|
|
||
| * Do nothing. |
There was a problem hiding this comment.
The other option is to use partial linking or object file rewriting when building a staticlib to make the symbol visibility match cdylib.
There was a problem hiding this comment.
Thank you for thinking about and pointing out this alternative. I've tried to cover it in the text of the RFC. Please shout if I misunderstood or misrepresented anything. (In particular, I am not sure if I have a good grasp on how/if this alternative would affect handling of rlibs.)
text/0000-export-visibility.md
Outdated
| [equivalent `BUILD.gn` rules](https://source.chromium.org/chromium/chromium/src/+/main:build/rust/std/rules/BUILD.gn;drc=35fb76c686b55acc25b53f7e5c9b58e56dca7f4a)), | ||
| which is one reason why this RFC is a viable UB fix for | ||
| https://crbug.com/418073233. | ||
| * Alternative: change the semantics of `#[rustc_std_internal_symbol]` |
There was a problem hiding this comment.
I haven't thought that through - let me remove this.
I've initially wondered whether #[rustc_std_internal_symbol] could imply #[export_visibility = "inherit"], but this doesn't do anything unless the standard library is rebuilt. And we can't imply #[export_visibility = "hidden"], because this would break linking standard library into cdylibs.
/cc @bjorn3 - thank you for pointing out the questions related to Rust standard library in rust-lang#3834 (comment)
PS. I still need to cover the
SymbolExportLevel::Rust-based alternative solution that you suggested in rust-lang#3834 (comment) (thanks!). I need to find more time to do it, sorry. I feel that I should prototype this solution to double-check that it does indeed offer an alternative fix for https://crbug.com/418073233. Hopefully I'll find time to get to it in the next 1-2 weeks... :-/