Skip to content

Commit

Permalink
Update the libm submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Jan 6, 2025
1 parent 520e2a0 commit f9f18e7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"))',
] }
21 changes: 16 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand All @@ -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" {
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion libm
Submodule libm updated 177 files
1 change: 1 addition & 0 deletions src/math.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[rustfmt::skip]
#[allow(dead_code)]
#[allow(unused_imports)]
#[allow(clippy::all)]
Expand Down

0 comments on commit f9f18e7

Please sign in to comment.