Detect arm64-ilp32 just enough to say that it's not supported.

arm64-ilp32 is a 32-bit ABI on a 64-bit platform, just like x32 is a
32-bit abi on x86-64.
This commit is contained in:
Dan Gohman
2022-01-31 09:13:41 -08:00
parent 0c2b700911
commit 4b00df56d9
4 changed files with 9 additions and 1 deletions
+4 -1
View File
@@ -26,7 +26,9 @@ fn main() {
let arch = var("CARGO_CFG_TARGET_ARCH").unwrap();
let asm_name = format!("{}/{}.s", OUTLINE_PATH, arch);
let os_name = var("CARGO_CFG_TARGET_OS").unwrap();
let is_x32 = arch == "x86_64" && var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap() == "32";
let pointer_width = var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap();
let is_x32 = arch == "x86_64" && pointer_width == "32";
let is_arm64_ilp32 = arch == "aarch64" && pointer_width == "32";
println!("cargo:rerun-if-env-changed=CARGO_CFG_TARGET_ARCH");
// If rustix_use_libc is set, or if we're on an architecture/OS that doesn't
@@ -35,6 +37,7 @@ fn main() {
|| os_name != "linux"
|| std::fs::metadata(&asm_name).is_err()
|| is_x32
|| is_arm64_ilp32
{
use_feature("libc");
} else {
+3
View File
@@ -3,6 +3,9 @@
use crate::imp::reg::{ArgReg, FromAsm, RetReg, SyscallNumber, ToAsm, A0, A1, A2, A3, A4, A5, R0};
use core::arch::asm;
#[cfg(target_pointer_width = "32")]
compile_error!("arm64-ilp32 is not supported yet");
#[inline]
#[must_use]
pub(in crate::imp) unsafe fn syscall0_readonly(nr: SyscallNumber<'_>) -> RetReg<R0> {
+2
View File
@@ -6,6 +6,8 @@
//
// outline.rs takes care of reordering the nr argument to the end for us,
// so we only need to move nr into w8.
//
// arm64-ilp32 is not yet supported.
.file "aarch64.s"
.arch armv8-a