Skip to content

Commit 6199e01

Browse files
authored
Rollup merge of rust-lang#133244 - daxpedda:wasm32v1-none-atomic, r=alexcrichton
Account for `wasm32v1-none` when exporting TLS symbols Exporting TLS related symbols was limited to `wasm32-unknown-unknown` because WASI and Emscripten (?) have their own infrastructure to deal with TLS. However, the introduction of `wasm32v1-none` is in the same boat as `wasm32-unknown-unknown`. This PR adjust the mechanism to account for `wasm32v1-none` as well. See rust-lang#102385 and rust-lang#102440. r? `@alexcrichton`
2 parents eb9fbb0 + f37d021 commit 6199e01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_codegen_ssa/src/back/linker.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ impl<'a> WasmLd<'a> {
12791279
let mut wasm_ld = WasmLd { cmd, sess };
12801280
if sess.target_features.contains(&sym::atomics) {
12811281
wasm_ld.link_args(&["--shared-memory", "--max-memory=1073741824", "--import-memory"]);
1282-
if sess.target.os == "unknown" {
1282+
if sess.target.os == "unknown" || sess.target.os == "none" {
12831283
wasm_ld.link_args(&[
12841284
"--export=__wasm_init_tls",
12851285
"--export=__tls_size",
@@ -1403,7 +1403,7 @@ impl<'a> Linker for WasmLd<'a> {
14031403
// symbols explicitly passed via the `--export` flags above and hides all
14041404
// others. Various bits and pieces of wasm32-unknown-unknown tooling use
14051405
// this, so be sure these symbols make their way out of the linker as well.
1406-
if self.sess.target.os == "unknown" {
1406+
if self.sess.target.os == "unknown" || self.sess.target.os == "none" {
14071407
self.link_args(&["--export=__heap_base", "--export=__data_end"]);
14081408
}
14091409
}

0 commit comments

Comments
 (0)