about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2021-10-28 10:58:16 -0700
committerAlex Crichton <alex@alexcrichton.com>2021-11-10 08:35:42 -0800
commit7f3ffbc8c22d0084987966b0496a63ce4d6278d5 (patch)
treea1c4eda31c419cbfdc47be846ef4dc4d5743d12c /compiler
parent68ca579406f2fa9ec62710e4a4d5d3e07a168d3c (diff)
downloadrust-7f3ffbc8c22d0084987966b0496a63ce4d6278d5.tar.gz
rust-7f3ffbc8c22d0084987966b0496a63ce4d6278d5.zip
std: Get the standard library compiling for wasm64
This commit goes through and updates various `#[cfg]` as appropriate to
get the wasm64-unknown-unknown target behaving similarly to the
wasm32-unknown-unknown target. Most of this is just updating various
conditions for `target_arch = "wasm32"` to also account for `target_arch
= "wasm64"` where appropriate. This commit also lists `wasm64` as an
allow-listed architecture to not have the `restricted_std` feature
enabled, enabling experimentation with `-Z build-std` externally.

The main goal of this commit is to enable playing around with
`wasm64-unknown-unknown` externally via `-Z build-std` in a way that's
similar to the `wasm32-unknown-unknown` target. These targets are
effectively the same and only differ in their pointer size, but wasm64
is much newer and has much less ecosystem/library support so it'll still
take time to get wasm64 fully-fledged.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_target/src/spec/wasm64_unknown_unknown.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_target/src/spec/wasm64_unknown_unknown.rs b/compiler/rustc_target/src/spec/wasm64_unknown_unknown.rs
index fb6526c0e72..7eacbb43640 100644
--- a/compiler/rustc_target/src/spec/wasm64_unknown_unknown.rs
+++ b/compiler/rustc_target/src/spec/wasm64_unknown_unknown.rs
@@ -23,11 +23,10 @@ pub fn target() -> Target {
     // For now this target just never has an entry symbol no matter the output
     // type, so unconditionally pass this.
     clang_args.push("-Wl,--no-entry".to_string());
-    options
-        .pre_link_args
-        .get_mut(&LinkerFlavor::Lld(LldFlavor::Wasm))
-        .unwrap()
-        .push("--no-entry".to_string());
+
+    let lld_args = options.pre_link_args.get_mut(&LinkerFlavor::Lld(LldFlavor::Wasm)).unwrap();
+    lld_args.push("--no-entry".to_string());
+    lld_args.push("-mwasm64".to_string());
 
     Target {
         llvm_target: "wasm64-unknown-unknown".to_string(),