-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Static variables are not exported on multiple platforms. #99596
Comments
Regression range: d68e7eb...62b272d I expect this to be caused by #93718 cc @thomcc |
This also seems to affect at least |
Hm, interesting. I don't have time to fix this right now, and it's very non-obvious to me why this would happen, so if it's as broken as @robbert-vdh suggests, the PR should probably be reverted. (Removing O-wasm based on the previous comment) |
wasm32-unknown-unknown
The first PR should definitely fix this. The second fixes the bug. I don't really have the ability to dig into this at the moment, but this should unblock either option. That said, some evidence in favor of reverting is that this may have been fixed between when I wrote that PR and when it landed (which was quite a long time), perhaps by #95604 ? Not sure. |
Don't overwrite CodegenFnAttrs when adding used compiler/linker Pointed out by `@tmiasko` in rust-lang#93718 (comment). Probably a better fix than rust-lang#99674 for rust-lang#99596, assuming it does fix the latter. I don't have the ability to write a regression test for this at the moment, and am quite surprised this didn't cause other failures. The old code is clearly wrong though, but I'm not picky as to which of these is better to go with.
@Jake-Shadle @robbert-vdh Can you confirm that this is fixed in |
Confirmed, nightly build went green again, I'll mark this issue as fixed. |
It appears that #88092 has regressed in nightly, The last working nightly we used was
rustc 1.64.0-nightly (d68e7ebc3 2022-07-20)
,rustc 1.64.0-nightly (62b272d25 2022-07-21)
was the first nightly that stopped working correctly.I tried this code:
I expected to see this happen:
cargo build --release --target wasm32-unknown-unknown && wasm2wat target/wasm32-unknown-unknown/release/missing_symbols.wasm
In
rustc 1.62.0 (a8314ef7d 2022-06-27)
, this properly exports theFOO
static.Instead, this happened:
cargo +nightly build --release --target wasm32-unknown-unknown && wasm2wat target/wasm32-unknown-unknown/release/missing_symbols.wasm
In
rustc 1.64.0-nightly (62b272d25 2022-07-21)
,FOO
is not exported.(module (table (;0;) 1 1 funcref) (memory (;0;) 16) (global $__stack_pointer (mut i32) (i32.const 1048576)) (global (;1;) i32 (i32.const 1048576)) (global (;2;) i32 (i32.const 1048576)) (export "memory" (memory 0)) (export "__data_end" (global 1)) (export "__heap_base" (global 2)))
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: