瀏覽代碼

Don't compile memory intrinsics on wasi

Alex Crichton 6 年之前
父節點
當前提交
c8b8087c95
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      build.rs

+ 3 - 2
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.