Skip to content

Commit 6d55998

Browse files
committed
Disable has_reliable_f128_math on musl targets
musl does not implement the symbols required by std for f128 maths. Disable the associated cfg for all musl targets and adjust the tests accordingly. Signed-off-by: Jens Reidel <[email protected]>
1 parent 5d22242 commit 6d55998

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,8 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
436436
("x86_64", _) => false,
437437
(_, "linux") if target_pointer_width == 64 => true,
438438
_ => false,
439-
} && cfg.has_reliable_f128;
439+
} && cfg.has_reliable_f128
440+
&& target_env != "musl";
440441
}
441442

442443
pub(crate) fn print_version() {

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)