experiment: use #[rustc_std_internal_symbol]
to make #[no_mangle]
tables have hidden visibility
#1448
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on @ahomescu's investigation:
#[export_visibility = ...]
attribute. rust-lang/rfcs#3834I tried using
#[rustc_std_internal_symbol]
onrav1d
's#[no_mangle]
symbols (some of the tables intables.rs
). Per rust-lang/rust#143422,#[rustc_std_internal_symbol]
is unstable and not meant to be used for this, and in fact, no longer works on#[no_mangle]
symbols (so I had to move our pinned nightly back 1 day), but this is just for experimenting. This is able to successfully build as acdylib
withcargo build
, not withcargo build --release
, where I geterror: undefined symbol
for all of these symbols. So I don't think this works even for the hidden visibility issue (note: also fixed in #1367 through small changes to the assembly).As for the performance issues raised in #1417, I don't think this addresses them. #1417 is about Rust calls to asm functions having unnecessary indirection, not about any symbols that Rust defines having any issues. And it can be fixed by using
RUSTFLAGS="-Z plt=yes"
.