Skip to content

Commit 6a807ab

Browse files
committed
Update the libm submodule
1 parent 520e2a0 commit 6a807ab

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,13 @@ panic = 'abort'
8383

8484
[profile.dev]
8585
panic = 'abort'
86+
87+
[lints.rust]
88+
# Values used during testing
89+
unexpected_cfgs = { level = "warn", check-cfg = [
90+
'cfg(feature, values("arch"))',
91+
'cfg(feature, values("force-soft-floats"))',
92+
'cfg(feature, values("unstable-float"))',
93+
'cfg(feature, values("unstable-intrinsics"))',
94+
'cfg(feature, values("unstable-test-support"))',
95+
] }

build.rs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use std::{collections::BTreeMap, env, path::PathBuf, sync::atomic::Ordering};
22

33
mod configure;
4+
#[path = "libm/configure.rs"]
5+
mod libm_configure;
46

57
use configure::{configure_f16_f128, Target};
68

@@ -14,12 +16,9 @@ fn main() {
1416
configure_check_cfg();
1517
configure_f16_f128(&target);
1618

17-
println!("cargo:compiler-rt={}", cwd.join("compiler-rt").display());
19+
configure_libm();
1820

19-
// Activate libm's unstable features to make full use of Nightly.
20-
println!("cargo::rustc-check-cfg=cfg(feature, values(\"unstable\", \"force-soft-floats\"))");
21-
println!("cargo:rustc-cfg=feature=\"unstable\"");
22-
println!("cargo:rustc-cfg=feature=\"force-soft-floats\"");
21+
println!("cargo:compiler-rt={}", cwd.join("compiler-rt").display());
2322

2423
// Emscripten's runtime includes all the builtins
2524
if target.os == "emscripten" {
@@ -104,6 +103,18 @@ fn main() {
104103
}
105104
}
106105

106+
/// Run configuration for `libm` since it is included directly.
107+
fn configure_libm() {
108+
let cfg = libm_configure::Config::from_env();
109+
libm_configure::emit_libm_config(&cfg);
110+
111+
// Activate libm's unstable features to make full use of Nightly.
112+
println!("cargo:rustc-cfg=feature=\"force-soft-floats\"");
113+
println!("cargo:rustc-cfg=feature=\"unstable-float\"");
114+
println!("cargo:rustc-cfg=feature=\"unstable-intrinsics\"");
115+
println!("cargo:rustc-cfg=feature=\"unstable\"");
116+
}
117+
107118
fn aarch64_symbol(ordering: Ordering) -> &'static str {
108119
match ordering {
109120
Ordering::Relaxed => "relax",

libm

Submodule libm updated 167 files

src/math.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[rustfmt::skip]
12
#[allow(dead_code)]
23
#[allow(unused_imports)]
34
#[allow(clippy::all)]

0 commit comments

Comments
 (0)