|
| 1 | +diff --git a/library/std/build.rs b/library/std/build.rs |
| 2 | +index 18ca7b512a9..35a5977b6eb 100644 |
| 3 | +--- a/library/std/build.rs |
| 4 | ++++ b/library/std/build.rs |
| 5 | +@@ -11,6 +11,7 @@ fn main() { |
| 6 | + .expect("CARGO_CFG_TARGET_POINTER_WIDTH was not set") |
| 7 | + .parse() |
| 8 | + .unwrap(); |
| 9 | ++ let is_miri = env::var_os("CARGO_CFG_MIRI").is_some(); |
| 10 | + |
| 11 | + println!("cargo:rustc-check-cfg=cfg(netbsd10)"); |
| 12 | + if target_os == "netbsd" && env::var("RUSTC_STD_NETBSD10").is_ok() { |
| 13 | +@@ -91,6 +92,8 @@ fn main() { |
| 14 | + println!("cargo:rustc-check-cfg=cfg(reliable_f128_math)"); |
| 15 | + |
| 16 | + let has_reliable_f16 = match (target_arch.as_str(), target_os.as_str()) { |
| 17 | ++ // We can always enable these in Miri as that is not affected by codegen bugs. |
| 18 | ++ _ if is_miri => true, |
| 19 | + // Selection failure until recent LLVM <https://github.com/llvm/llvm-project/issues/93894> |
| 20 | + // FIXME(llvm19): can probably be removed at the version bump |
| 21 | + ("loongarch64", _) => false, |
| 22 | +@@ -118,6 +121,8 @@ fn main() { |
| 23 | + }; |
| 24 | + |
| 25 | + let has_reliable_f128 = match (target_arch.as_str(), target_os.as_str()) { |
| 26 | ++ // We can always enable these in Miri as that is not affected by codegen bugs. |
| 27 | ++ _ if is_miri => true, |
| 28 | + // Unsupported <https://github.com/llvm/llvm-project/issues/94434> |
| 29 | + ("arm64ec", _) => false, |
| 30 | + // ABI and precision bugs <https://github.com/rust-lang/rust/issues/125109> |
| 31 | +@@ -141,6 +146,8 @@ fn main() { |
| 32 | + // LLVM is currenlty adding missing routines, <https://github.com/llvm/llvm-project/issues/93566> |
| 33 | + let has_reliable_f16_math = has_reliable_f16 |
| 34 | + && match (target_arch.as_str(), target_os.as_str()) { |
| 35 | ++ // FIXME: Disabled on Miri as the intrinsics are not implemented yet. |
| 36 | ++ _ if is_miri => false, |
| 37 | + // Currently nothing special. Hooray! |
| 38 | + // This will change as platforms gain better better support for standard ops but math |
| 39 | + // lags behind. |
| 40 | +@@ -149,6 +156,8 @@ fn main() { |
| 41 | + |
| 42 | + let has_reliable_f128_math = has_reliable_f128 |
| 43 | + && match (target_arch.as_str(), target_os.as_str()) { |
| 44 | ++ // FIXME: Disabled on Miri as the intrinsics are not implemented yet. |
| 45 | ++ _ if is_miri => false, |
| 46 | + // LLVM lowers `fp128` math to `long double` symbols even on platforms where |
| 47 | + // `long double` is not IEEE binary128. See |
| 48 | + // <https://github.com/llvm/llvm-project/issues/44744>. |
0 commit comments