Skip to content

Commit 8cdd497

Browse files
rjsberrynewAM
authored andcommitted
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.
1 parent 357f82c commit 8cdd497

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

build.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,13 @@ fn main() -> Result<(), Box<dyn Error>> {
8888
}
8989
}
9090

91-
match compile_probe(ARM_LLSC_PROBE) {
92-
Some(status) if status.success() => println!("cargo:rustc-cfg=arm_llsc"),
93-
_ => {}
91+
// AArch64 instruction set contains `clrex` but not `ldrex` or `strex`; the
92+
// probe will succeed when we already know to deny this target from LLSC.
93+
if !target.starts_with("aarch64") {
94+
match compile_probe(ARM_LLSC_PROBE) {
95+
Some(status) if status.success() => println!("cargo:rustc-cfg=arm_llsc"),
96+
_ => {}
97+
}
9498
}
9599

96100
Ok(())

0 commit comments

Comments
 (0)