-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Static variables are not exported in wasm #67453
Copy link
Copy link
Closed
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesO-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesO-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Repro https://github.com/EmbarkStudios/missing-symbols
rustc 1.40.0 (73528e339 2019-12-16)cargo build --release --target wasm32-unknown-unknown, the resulting wasm file doesn't have the symbolFOO.But if we compile with
-C link-dead-code, the symbol is correctly exported in the wasm file.RUSTFLAGS="-C link-dead-code" cargo build --release --target wasm32-unknown-unknownExpected behavior: Public static variables should get exported by default.
We believe this is a regression from 1.39.0.
Does correctly export static variables.