From 3375e3aee6e7e608c311b20ba041b004f2b73d5d Mon Sep 17 00:00:00 2001 From: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com> Date: Mon, 15 Apr 2024 19:14:41 +0800 Subject: [PATCH 1/3] Fix math libraries not being linked on some platforms This is a continuation/fix of 018616e. In that commit, we made it add the math functions to all platforms (except apple-targets and windows), and use `weak` linking, so that it can be used if the system doesn't have those functions. Didn't notice `mod math` was behind another set of `cfg`, so removed it as well here. --- src/lib.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index a414efde..da438de7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,14 +45,6 @@ mod macros; pub mod float; pub mod int; -#[cfg(any( - all(target_family = "wasm", target_os = "unknown"), - target_os = "uefi", - target_os = "none", - target_os = "xous", - all(target_vendor = "fortanix", target_env = "sgx"), - target_os = "windows" -))] pub mod math; pub mod mem; From e0e5bb437d9d1f1030ba5ec7ed2c4b53600c9657 Mon Sep 17 00:00:00 2001 From: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com> Date: Mon, 15 Apr 2024 19:37:48 +0800 Subject: [PATCH 2/3] Fix clippy warnings in `math` The solution is not pretty, but not sure why we still get clippy warning from one of the files in `libm` even though we use `allow(clippy::all)` --- src/lib.rs | 3 +++ src/math.rs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index da438de7..e7975098 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,6 +45,9 @@ mod macros; pub mod float; pub mod int; +// For some reason, we still get clippy error `clippy::deprecated_cfg_attr` even though, we have +// used `allow(clippy::all)` in the file. So, we are disabling the clippy check for this file. +#[cfg(not(clippy))] pub mod math; pub mod mem; diff --git a/src/math.rs b/src/math.rs index 593a1a19..e47b834e 100644 --- a/src/math.rs +++ b/src/math.rs @@ -1,4 +1,6 @@ #[allow(dead_code)] +#[allow(unused_imports)] +#[allow(clippy::all)] #[path = "../libm/src/math/mod.rs"] mod libm; From dd8539525bd2dece941d014fb01698fa7d7042ad Mon Sep 17 00:00:00 2001 From: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com> Date: Tue, 30 Apr 2024 18:40:45 +0800 Subject: [PATCH 3/3] Updated `libm` to fix `clippy` warning --- libm | 2 +- src/lib.rs | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/libm b/libm index 721a5edc..a1e8a5bf 160000 --- a/libm +++ b/libm @@ -1 +1 @@ -Subproject commit 721a5edc1be6b0412e4b1704590aed76f9a55899 +Subproject commit a1e8a5bf95e99309760b764b2a332d0039d08350 diff --git a/src/lib.rs b/src/lib.rs index e7975098..da438de7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,9 +45,6 @@ mod macros; pub mod float; pub mod int; -// For some reason, we still get clippy error `clippy::deprecated_cfg_attr` even though, we have -// used `allow(clippy::all)` in the file. So, we are disabling the clippy check for this file. -#[cfg(not(clippy))] pub mod math; pub mod mem;