diff --git a/Cargo.toml b/Cargo.toml index 33d5c06b..50fbbe7d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,3 +83,13 @@ panic = 'abort' [profile.dev] panic = 'abort' + +[lints.rust] +# Values used during testing +unexpected_cfgs = { level = "warn", check-cfg = [ + 'cfg(feature, values("arch"))', + 'cfg(feature, values("force-soft-floats"))', + 'cfg(feature, values("unstable-float"))', + 'cfg(feature, values("unstable-intrinsics"))', + 'cfg(feature, values("unstable-test-support"))', +] } diff --git a/build.rs b/build.rs index 22ec9e4d..238d9179 100644 --- a/build.rs +++ b/build.rs @@ -1,6 +1,8 @@ use std::{collections::BTreeMap, env, path::PathBuf, sync::atomic::Ordering}; mod configure; +#[path = "libm/configure.rs"] +mod libm_configure; use configure::{configure_f16_f128, Target}; @@ -14,12 +16,9 @@ fn main() { configure_check_cfg(); configure_f16_f128(&target); - println!("cargo:compiler-rt={}", cwd.join("compiler-rt").display()); + configure_libm(); - // Activate libm's unstable features to make full use of Nightly. - println!("cargo::rustc-check-cfg=cfg(feature, values(\"unstable\", \"force-soft-floats\"))"); - println!("cargo:rustc-cfg=feature=\"unstable\""); - println!("cargo:rustc-cfg=feature=\"force-soft-floats\""); + println!("cargo:compiler-rt={}", cwd.join("compiler-rt").display()); // Emscripten's runtime includes all the builtins if target.os == "emscripten" { @@ -104,6 +103,18 @@ fn main() { } } +/// Run configuration for `libm` since it is included directly. +fn configure_libm() { + let cfg = libm_configure::Config::from_env(); + libm_configure::emit_libm_config(&cfg); + + // Activate libm's unstable features to make full use of Nightly. + println!("cargo:rustc-cfg=feature=\"force-soft-floats\""); + println!("cargo:rustc-cfg=feature=\"unstable-float\""); + println!("cargo:rustc-cfg=feature=\"unstable-intrinsics\""); + println!("cargo:rustc-cfg=feature=\"unstable\""); +} + fn aarch64_symbol(ordering: Ordering) -> &'static str { match ordering { Ordering::Relaxed => "relax", diff --git a/libm b/libm index f4e5b38a..9d043c56 160000 --- a/libm +++ b/libm @@ -1 +1 @@ -Subproject commit f4e5b38aee0e0c592a82ed45b21cd068c9b6c89a +Subproject commit 9d043c563e213661e87ff87a746bd98f39e81b7a diff --git a/src/math.rs b/src/math.rs index 477dfe36..da208239 100644 --- a/src/math.rs +++ b/src/math.rs @@ -1,3 +1,4 @@ +#[rustfmt::skip] #[allow(dead_code)] #[allow(unused_imports)] #[allow(clippy::all)]