Skip to content

Commit c8b8087

Browse files
committed
Don't compile memory intrinsics on wasi
1 parent fafaace commit c8b8087

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

build.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ fn main() {
2222

2323
// Forcibly enable memory intrinsics on wasm32 & SGX as we don't have a libc to
2424
// provide them.
25-
if target.contains("wasm32") || (target.contains("sgx") && target.contains("fortanix")) {
25+
if (target.contains("wasm32") && !target.contains("wasi")) ||
26+
(target.contains("sgx") && target.contains("fortanix")) {
2627
println!("cargo:rustc-cfg=feature=\"mem\"");
2728
}
2829

@@ -314,7 +315,7 @@ mod c {
314315
if target_os == "freebsd" {
315316
sources.extend(&["clear_cache.c"]);
316317
}
317-
318+
318319
// First of all aeabi_cdcmp and aeabi_cfcmp are never called by LLVM.
319320
// Second are little-endian only, so build fail on big-endian targets.
320321
// Temporally workaround: exclude these files for big-endian targets.

0 commit comments

Comments
 (0)