Skip to content

Commit 8ebb85a

Browse files
committed
Adjust some build directives for wasm64
This is still an experimental target but this should get the wasm64 target to behave more like wasm32.
1 parent e742731 commit 8ebb85a

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ fn main() {
2323
return;
2424
}
2525

26-
// Forcibly enable memory intrinsics on wasm32 & SGX as we don't have a libc to
26+
// Forcibly enable memory intrinsics on wasm & SGX as we don't have a libc to
2727
// provide them.
28-
if (target.contains("wasm32") && !target.contains("wasi"))
28+
if (target.contains("wasm") && !target.contains("wasi"))
2929
|| (target.contains("sgx") && target.contains("fortanix"))
3030
|| target.contains("-none")
3131
|| target.contains("nvptx")
@@ -50,13 +50,13 @@ fn main() {
5050
if !cfg!(feature = "mangled-names") && cfg!(feature = "c") {
5151
// Don't use a C compiler for these targets:
5252
//
53-
// * wasm32 - clang 8 for wasm is somewhat hard to come by and it's
53+
// * wasm - clang for wasm is somewhat hard to come by and it's
5454
// unlikely that the C is really that much better than our own Rust.
5555
// * nvptx - everything is bitcode, not compatible with mixed C/Rust
5656
// * riscv - the rust-lang/rust distribution container doesn't have a C
5757
// compiler nor is cc-rs ready for compilation to riscv (at this
5858
// time). This can probably be removed in the future
59-
if !target.contains("wasm32") && !target.contains("nvptx") && !target.starts_with("riscv") {
59+
if !target.contains("wasm") && !target.contains("nvptx") && !target.starts_with("riscv") {
6060
#[cfg(feature = "c")]
6161
c::compile(&llvm_target, &target);
6262
}

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ pub mod int;
4040

4141
#[cfg(any(
4242
all(target_arch = "wasm32", target_os = "unknown"),
43+
all(target_arch = "wasm64", target_os = "unknown"),
4344
all(target_arch = "x86_64", target_os = "uefi"),
4445
all(target_arch = "arm", target_os = "none"),
4546
all(target_vendor = "fortanix", target_env = "sgx")

src/math.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ macro_rules! no_mangle {
1616

1717
#[cfg(any(
1818
all(
19-
target_arch = "wasm32",
19+
any(target_arch = "wasm32", target_arch = "wasm64"),
2020
target_os = "unknown",
2121
not(target_env = "wasi")
2222
),
@@ -66,7 +66,7 @@ no_mangle! {
6666

6767
#[cfg(any(
6868
all(
69-
target_arch = "wasm32",
69+
any(target_arch = "wasm32", target_arch = "wasm64"),
7070
target_os = "unknown",
7171
not(target_env = "wasi")
7272
),

0 commit comments

Comments
 (0)