diff --git a/build.rs b/build.rs index 6ea5ec527b..6ce98b2893 100644 --- a/build.rs +++ b/build.rs @@ -88,9 +88,13 @@ fn main() -> Result<(), Box> { } } - match compile_probe(ARM_LLSC_PROBE) { - Some(status) if status.success() => println!("cargo:rustc-cfg=arm_llsc"), - _ => {} + // AArch64 instruction set contains `clrex` but not `ldrex` or `strex`; the + // probe will succeed when we already know to deny this target from LLSC. + if !target.starts_with("aarch64") { + match compile_probe(ARM_LLSC_PROBE) { + Some(status) if status.success() => println!("cargo:rustc-cfg=arm_llsc"), + _ => {} + } } Ok(())