Fix pool (mis)compile on AArch64

The LLSC probe in `build.rs` checks for the presence of the
`clrex` instruction and assumes the target also has both `ldrex`
and `strex`.

In AArch64 `clrex` is a known mnemonic but `ldrex` and `strex`
are not. This caused the `arm_llsc` feature (and subsequently the
oiik module) to be included in the crate for AArc64 which is invalid.
This commit is contained in:
Richard Berry 2023-02-27 21:35:46 +00:00 committed by Alex Martens
parent 357f82cb62
commit 8cdd497fa5

View File

@ -88,9 +88,13 @@ fn main() -> Result<(), Box<dyn Error>> {
}
}
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(())