Skip to content

Disable has_reliable_f128_math on musl targets #144431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,9 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
// This rules out anything that doesn't have `long double` = `binary128`; <= 32 bits
// (ld is `f64`), anything other than Linux (Windows and MacOS use `f64`), and `x86`
// (ld is 80-bit extended precision).
//
// musl does not implement the symbols required for f128 math at all.
_ if target_env == "musl" => false,
("x86_64", _) => false,
(_, "linux") if target_pointer_width == 64 => true,
_ => false,
Expand Down
6 changes: 4 additions & 2 deletions tests/ui/float/target-has-reliable-nightly-float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ pub fn has_f128() {}
pub fn has_f128_math() {}

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

assert!(cfg!(target_has_reliable_f16));
Expand Down
Loading