about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-05 14:48:17 +0000
committerbors <bors@rust-lang.org>2022-10-05 14:48:17 +0000
commit24ac6a26bcf5be1ac841e7fe969bd992b3461f9d (patch)
treee3445397f4accfe91104d99a1866c034943b75cf /compiler/rustc_codegen_ssa/src
parent8c71b67159e1a3d0863caf28b7cefee0160cb927 (diff)
parent4c644cdbf6b0ab4cd4c6861682212c1e53cb5b57 (diff)
downloadrust-24ac6a26bcf5be1ac841e7fe969bd992b3461f9d.tar.gz
rust-24ac6a26bcf5be1ac841e7fe969bd992b3461f9d.zip
Auto merge of #102704 - Dylan-DPC:rollup-66ff8sm, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #100986 (Stop suggesting adding generic args for turbofish)
 - #101061 (panic-on-uninit: adjust checks to 0x01-filling)
 - #102440 (Only export `__tls_*` on wasm32-unknown-unknown.)
 - #102496 (Suggest `.into()` when all other coercion suggestions fail)
 - #102699 (Fix hamburger button color)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/linker.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs
index f59a753a5ce..2cd746ccb6a 100644
--- a/compiler/rustc_codegen_ssa/src/back/linker.rs
+++ b/compiler/rustc_codegen_ssa/src/back/linker.rs
@@ -1180,16 +1180,19 @@ impl<'a> WasmLd<'a> {
         //   sharing memory and instantiating the module multiple times. As a
         //   result if it were exported then we'd just have no sharing.
         //
-        // * `--export=*tls*` - when `#[thread_local]` symbols are used these
-        //   symbols are how the TLS segments are initialized and configured.
+        // On wasm32-unknown-unknown, we also export symbols for glue code to use:
+        //    * `--export=*tls*` - when `#[thread_local]` symbols are used these
+        //      symbols are how the TLS segments are initialized and configured.
         if sess.target_features.contains(&sym::atomics) {
             cmd.arg("--shared-memory");
             cmd.arg("--max-memory=1073741824");
             cmd.arg("--import-memory");
-            cmd.arg("--export=__wasm_init_tls");
-            cmd.arg("--export=__tls_size");
-            cmd.arg("--export=__tls_align");
-            cmd.arg("--export=__tls_base");
+            if sess.target.os == "unknown" {
+                cmd.arg("--export=__wasm_init_tls");
+                cmd.arg("--export=__tls_size");
+                cmd.arg("--export=__tls_align");
+                cmd.arg("--export=__tls_base");
+            }
         }
         WasmLd { cmd, sess }
     }