From a806c53b2cfb1d17c6825691cf1f1a5731755df3 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 2 Apr 2019 07:46:06 -0700 Subject: [PATCH] Don't compile math symbols on wasm32-unknown-wasi These are already provided by the C sysroot, so no need for us to duplicate them! --- library/compiler-builtins/src/math.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/library/compiler-builtins/src/math.rs b/library/compiler-builtins/src/math.rs index 18def0e86c70..dfdd99cdf931 100644 --- a/library/compiler-builtins/src/math.rs +++ b/library/compiler-builtins/src/math.rs @@ -14,9 +14,14 @@ macro_rules! no_mangle { } } -// only for the wasm32-unknown-unknown target -#[cfg(any(all(target_arch = "wasm32", target_os = "unknown"), - all(target_vendor = "fortanix", target_env = "sgx")))] +#[cfg(any( + all( + target_arch = "wasm32", + target_os = "unknown", + not(target_env = "wasi") + ), + all(target_vendor = "fortanix", target_env = "sgx") +))] no_mangle! { fn acos(x: f64) -> f64; fn asin(x: f64) -> f64;