diff --git a/Cargo.lock b/Cargo.lock index a2e80da3ea..6823f1b335 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -696,7 +696,7 @@ name = "cranelift-native" version = "0.77.0" dependencies = [ "cranelift-codegen", - "rsix", + "libc", "target-lexicon", ] diff --git a/cranelift/native/Cargo.toml b/cranelift/native/Cargo.toml index 96fe91f665..493778a463 100644 --- a/cranelift/native/Cargo.toml +++ b/cranelift/native/Cargo.toml @@ -15,7 +15,7 @@ cranelift-codegen = { path = "../codegen", version = "0.77.0", default-features target-lexicon = "0.12" [target.'cfg(target_arch = "s390x")'.dependencies] -rsix = "0.23.0" +libc = "0.2.95" [features] default = ["std"] diff --git a/cranelift/native/src/lib.rs b/cranelift/native/src/lib.rs index b2364c6ad9..cac50dee4e 100644 --- a/cranelift/native/src/lib.rs +++ b/cranelift/native/src/lib.rs @@ -126,7 +126,7 @@ pub fn builder_with_options( } // There is no is_s390x_feature_detected macro yet, so for now - // we use linux_hwcap from the rsix crate directly. + // we use getauxval from the libc crate directly. #[cfg(all(target_arch = "s390x", target_os = "linux"))] { use cranelift_codegen::settings::Configurable; @@ -135,8 +135,8 @@ pub fn builder_with_options( return Ok(isa_builder); } - let v = rsix::process::linux_hwcap().0; - const HWCAP_S390X_VXRS_EXT2: usize = 32768; + let v = unsafe { libc::getauxval(libc::AT_HWCAP) }; + const HWCAP_S390X_VXRS_EXT2: libc::c_ulong = 32768; if (v & HWCAP_S390X_VXRS_EXT2) != 0 { isa_builder.enable("has_vxrs_ext2").unwrap(); // There is no separate HWCAP bit for mie2, so assume