|
| 1 | +diff --git build.rs build.rs |
| 2 | +index 320b3052..611bd280 100644 |
| 3 | +--- build.rs |
| 4 | ++++ build.rs |
| 5 | +@@ -86,7 +86,10 @@ fn main() { |
| 6 | + // x86 our asm support requires naked functions. On PowerPC and MIPS, |
| 7 | + // Rust's inline asm is considered experimental, so only use it if |
| 8 | + // `--cfg=rustix_use_experimental_asm` is given. |
| 9 | +- if (feature_rustc_dep_of_std || vendor == "mustang" || can_compile("use std::arch::asm;")) |
| 10 | ++ // Note: On x86_64 linux, assume asm is available (any rustc >= 1.59 supports it) |
| 11 | ++ // to avoid non-deterministic probe compilation. |
| 12 | ++ let has_asm = arch == "x86_64" || feature_rustc_dep_of_std || vendor == "mustang" || can_compile("use std::arch::asm;"); |
| 13 | ++ if has_asm |
| 14 | + && (arch != "x86" || has_feature("naked_functions")) |
| 15 | + && ((arch != "powerpc64" && arch != "mips" && arch != "mips64") |
| 16 | + || rustix_use_experimental_asm) |
| 17 | +@@ -242,7 +245,6 @@ fn has_feature(feature: &str) -> bool { |
| 18 | + fn can_compile<T: AsRef<str>>(test: T) -> bool { |
| 19 | + use std::process::Stdio; |
| 20 | + |
| 21 | +- let out_dir = var("OUT_DIR").unwrap(); |
| 22 | + let rustc = var("RUSTC").unwrap(); |
| 23 | + let target = var("TARGET").unwrap(); |
| 24 | + |
| 25 | +@@ -267,7 +269,7 @@ fn can_compile<T: AsRef<str>>(test: T) -> bool { |
| 26 | + .arg("--target") |
| 27 | + .arg(target) |
| 28 | + .arg("--out-dir") |
| 29 | +- .arg(out_dir); // Put the output somewhere inconsequential. |
| 30 | ++ .arg("/dev/null"); // Put the output somewhere inconsequential. |
| 31 | + |
| 32 | + // If Cargo wants to set RUSTFLAGS, use that. |
| 33 | + if let Ok(rustflags) = var("CARGO_ENCODED_RUSTFLAGS") { |
0 commit comments