Remove the rsix dependency in cranelift-native. (#3395)

Revert the part of 47490b4383 which
changed cranelift-native to use rsix. It's just one call, and this lets
Cranelift users that don't otherwise depend on rsix to avoid it.
This commit is contained in:
Dan Gohman
2021-09-30 06:11:29 -07:00
committed by GitHub
parent e989caf337
commit fa108d9a86
3 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View File

@@ -696,7 +696,7 @@ name = "cranelift-native"
version = "0.77.0" version = "0.77.0"
dependencies = [ dependencies = [
"cranelift-codegen", "cranelift-codegen",
"rsix", "libc",
"target-lexicon", "target-lexicon",
] ]

View File

@@ -15,7 +15,7 @@ cranelift-codegen = { path = "../codegen", version = "0.77.0", default-features
target-lexicon = "0.12" target-lexicon = "0.12"
[target.'cfg(target_arch = "s390x")'.dependencies] [target.'cfg(target_arch = "s390x")'.dependencies]
rsix = "0.23.0" libc = "0.2.95"
[features] [features]
default = ["std"] default = ["std"]

View File

@@ -126,7 +126,7 @@ pub fn builder_with_options(
} }
// There is no is_s390x_feature_detected macro yet, so for now // 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"))] #[cfg(all(target_arch = "s390x", target_os = "linux"))]
{ {
use cranelift_codegen::settings::Configurable; use cranelift_codegen::settings::Configurable;
@@ -135,8 +135,8 @@ pub fn builder_with_options(
return Ok(isa_builder); return Ok(isa_builder);
} }
let v = rsix::process::linux_hwcap().0; let v = unsafe { libc::getauxval(libc::AT_HWCAP) };
const HWCAP_S390X_VXRS_EXT2: usize = 32768; const HWCAP_S390X_VXRS_EXT2: libc::c_ulong = 32768;
if (v & HWCAP_S390X_VXRS_EXT2) != 0 { if (v & HWCAP_S390X_VXRS_EXT2) != 0 {
isa_builder.enable("has_vxrs_ext2").unwrap(); isa_builder.enable("has_vxrs_ext2").unwrap();
// There is no separate HWCAP bit for mie2, so assume // There is no separate HWCAP bit for mie2, so assume