From 8d0fdce9ca55b5d8f7732a35a452e0dcfbb364c2 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 13 Mar 2019 08:19:30 -0700 Subject: [PATCH] Don't compile memory intrinsics on wasi --- library/compiler-builtins/build.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/compiler-builtins/build.rs b/library/compiler-builtins/build.rs index 9a7c05eb0a78..5d555d608286 100644 --- a/library/compiler-builtins/build.rs +++ b/library/compiler-builtins/build.rs @@ -22,7 +22,8 @@ fn main() { // Forcibly enable memory intrinsics on wasm32 & SGX as we don't have a libc to // provide them. - if target.contains("wasm32") || (target.contains("sgx") && target.contains("fortanix")) { + if (target.contains("wasm32") && !target.contains("wasi")) || + (target.contains("sgx") && target.contains("fortanix")) { println!("cargo:rustc-cfg=feature=\"mem\""); } @@ -314,7 +315,7 @@ mod c { if target_os == "freebsd" { sources.extend(&["clear_cache.c"]); } - + // First of all aeabi_cdcmp and aeabi_cfcmp are never called by LLVM. // Second are little-endian only, so build fail on big-endian targets. // Temporally workaround: exclude these files for big-endian targets.