diff --git a/library/std_detect/src/detect/os/linux/aarch64.rs b/library/std_detect/src/detect/os/linux/aarch64.rs index ba5e8f002568..2c36a073b74e 100644 --- a/library/std_detect/src/detect/os/linux/aarch64.rs +++ b/library/std_detect/src/detect/os/linux/aarch64.rs @@ -209,6 +209,12 @@ impl From for AtHwcap { wfxt: bit::test(auxv.hwcap2, 31), ..Default::default() }; + + // Hardware capabilites from bits 32 to 63 should only + // be tested on LP64 targets with 64 bits `usize`. + // On ILP32 targets like `aarch64-unknown-linux-gun_ilp32`, + // these hardware capabilites will default to `false`. + // https://github.com/rust-lang/rust/issues/146230 #[cfg(target_pointer_width = "64")] { // cap.ebf16: bit::test(auxv.hwcap2, 32);