Skip to content

Commit 39141d0

Browse files
authored
Rollup merge of #144431 - Gelbpunkt:f128-math-musl, r=petrochenkov,tgross35
Disable has_reliable_f128_math on musl targets musl does not implement the symbols required by rustc for f128 maths. Disable the associated cfg for all musl targets and adjust the tests accordingly. Closes #144423
2 parents bfacbf2 + 53018dc commit 39141d0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,9 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
433433
// This rules out anything that doesn't have `long double` = `binary128`; <= 32 bits
434434
// (ld is `f64`), anything other than Linux (Windows and MacOS use `f64`), and `x86`
435435
// (ld is 80-bit extended precision).
436+
//
437+
// musl does not implement the symbols required for f128 math at all.
438+
_ if target_env == "musl" => false,
436439
("x86_64", _) => false,
437440
(_, "linux") if target_pointer_width == 64 => true,
438441
_ => false,

tests/ui/float/target-has-reliable-nightly-float.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ pub fn has_f128() {}
1919
pub fn has_f128_math() {}
2020

2121
fn main() {
22-
if cfg!(target_arch = "aarch64") && cfg!(target_os = "linux") {
23-
// Aarch64+Linux is one target that has support for all features, so use it to spot
22+
if cfg!(target_arch = "aarch64") &&
23+
cfg!(target_os = "linux") &&
24+
cfg!(not(target_env = "musl")) {
25+
// Aarch64+GNU+Linux is one target that has support for all features, so use it to spot
2426
// check that the compiler does indeed enable these gates.
2527

2628
assert!(cfg!(target_has_reliable_f16));

0 commit comments

Comments
 (0)