-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Declare main
as visibility hidden on targets that default to hidden.
#102424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
On targets with `default_hidden_visibility` set, which is currrently just WebAssembly, declare the generated `main` function with visibility hidden. This makes it consistent with clang's WebAssembly target, where `main` is just a user function that gets the same visibility as any other user function, which is hidden on WebAssembly unless explicitly overridden. This will help simplify use cases which in the future may want to automatically wasm-export all visibility-"default" symbols. `main` isn't intended to be wasm-exported, and marking it hidden prevents it from being wasm-exported in that scenario.
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
r? @nagisa |
@bors r+ |
…n, r=nagisa Declare `main` as visibility hidden on targets that default to hidden. On targets with `default_hidden_visibility` set, which is currrently just WebAssembly, declare the generated `main` function with visibility hidden. This makes it consistent with clang's WebAssembly target, where `main` is just a user function that gets the same visibility as any other user function, which is hidden on WebAssembly unless explicitly overridden. This will help simplify use cases which in the future may want to automatically wasm-export all visibility-"default" symbols. `main` isn't intended to be wasm-exported, and marking it hidden prevents it from being wasm-exported in that scenario.
@bors r+ rollup=never |
☀️ Test successful - checks-actions |
Finished benchmarking commit (47b2eee): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Footnotes |
… r=nagisa Declare `main` as visibility hidden on targets that default to hidden. On targets with `default_hidden_visibility` set, which is currrently just WebAssembly, declare the generated `main` function with visibility hidden. This makes it consistent with clang's WebAssembly target, where `main` is just a user function that gets the same visibility as any other user function, which is hidden on WebAssembly unless explicitly overridden. This will help simplify use cases which in the future may want to automatically wasm-export all visibility-"default" symbols. `main` isn't intended to be wasm-exported, and marking it hidden prevents it from being wasm-exported in that scenario.
On targets with
default_hidden_visibility
set, which is currrently just WebAssembly, declare the generatedmain
function with visibility hidden. This makes it consistent with clang's WebAssembly target, wheremain
is just a user function that gets the same visibility as any other user function, which is hidden on WebAssembly unless explicitly overridden.This will help simplify use cases which in the future may want to automatically wasm-export all visibility-"default" symbols.
main
isn't intended to be wasm-exported, and marking it hidden prevents it from being wasm-exported in that scenario.