From 282e35aae03df33b9828667d70fc6991a9967d7c Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 25 Sep 2025 19:43:59 +0000 Subject: [PATCH 1/3] Re-enable the musl build on windows-gnu --- ci/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run.sh b/ci/run.sh index bc94d42fe..2ef6427e0 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -122,7 +122,7 @@ case "$target" in *thumb*) mflags+=(--exclude musl-math-sys) ;; # We can build musl on MinGW but running tests gets a stack overflow - *windows-gnu*) ;; + # *windows-gnu*) ;; # FIXME(#309): LE PPC crashes calling the musl version of some functions. It # seems like a qemu bug but should be investigated further at some point. # See . From ccf3420f21771e9137905491fc6542ad34ba3d6a Mon Sep 17 00:00:00 2001 From: ltdk Date: Wed, 17 Sep 2025 14:07:23 -0400 Subject: [PATCH 2/3] Mark float intrinsics with no preconditions as safe (cherry picked from commit 2fb3a1871bc95dbaf9a19a4bab0e7f0d042d209c) --- libm/src/math/support/float_traits.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libm/src/math/support/float_traits.rs b/libm/src/math/support/float_traits.rs index fb790e696..b5ee6413d 100644 --- a/libm/src/math/support/float_traits.rs +++ b/libm/src/math/support/float_traits.rs @@ -289,7 +289,7 @@ macro_rules! float_impl { cfg_if! { // fma is not yet available in `core` if #[cfg(intrinsics_enabled)] { - unsafe{ core::intrinsics::$fma_intrinsic(self, y, z) } + core::intrinsics::$fma_intrinsic(self, y, z) } else { super::super::$fma_fn(self, y, z) } From d6889da2d1bc95e2870c832bf20171f4ea19a9fc Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 25 Sep 2025 19:58:00 +0000 Subject: [PATCH 3/3] Add back the `unsafe` for `intrinsics::fma` but `allow(unused_unsafe)` Rustc commit 055e05a338af / builtins commit 2fb3a1871bc9 ("Mark float intrinsics with no preconditions as safe") changed `fma` and other intrinsics to not be unsafe to call. Unfortunately we can't remove the `unsafe` just yet since the rustc we pin for benchmarks is older than this. Add back `unsafe` but allow it to be unused. (cherry picked from commit 82a32c6bd1b82b55de5aea0cddb707732b54855f) --- libm/src/math/support/float_traits.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libm/src/math/support/float_traits.rs b/libm/src/math/support/float_traits.rs index b5ee6413d..4e5011f62 100644 --- a/libm/src/math/support/float_traits.rs +++ b/libm/src/math/support/float_traits.rs @@ -289,7 +289,10 @@ macro_rules! float_impl { cfg_if! { // fma is not yet available in `core` if #[cfg(intrinsics_enabled)] { - core::intrinsics::$fma_intrinsic(self, y, z) + // FIXME(msrv,bench): once our benchmark rustc version is above the + // 2022-09-23 nightly, this can be removed. + #[allow(unused_unsafe)] + unsafe { core::intrinsics::$fma_intrinsic(self, y, z) } } else { super::super::$fma_fn(self, y, z) }