From 8783d1a47eeaf04635e29b2418795bd36ac49605 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Wed, 20 Jan 2021 17:13:49 +0000 Subject: [PATCH] Add big-endian and ILP32 AArch64 targets --- .../src/spec/aarch64_be_unknown_linux_gnu.rs | 20 +++++++++++++++++++ .../aarch64_be_unknown_linux_gnu_ilp32.rs | 20 +++++++++++++++++++ .../spec/aarch64_unknown_linux_gnu_ilp32.rs | 18 +++++++++++++++++ compiler/rustc_target/src/spec/mod.rs | 4 ++++ 4 files changed, 62 insertions(+) create mode 100644 compiler/rustc_target/src/spec/aarch64_be_unknown_linux_gnu.rs create mode 100644 compiler/rustc_target/src/spec/aarch64_be_unknown_linux_gnu_ilp32.rs create mode 100644 compiler/rustc_target/src/spec/aarch64_unknown_linux_gnu_ilp32.rs diff --git a/compiler/rustc_target/src/spec/aarch64_be_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/aarch64_be_unknown_linux_gnu.rs new file mode 100644 index 00000000000..192c4661c7c --- /dev/null +++ b/compiler/rustc_target/src/spec/aarch64_be_unknown_linux_gnu.rs @@ -0,0 +1,20 @@ +use crate::abi::Endian; +use crate::spec::{Target, TargetOptions}; + +pub fn target() -> Target { + let mut base = super::linux_gnu_base::opts(); + base.max_atomic_width = Some(128); + + Target { + llvm_target: "aarch64_be-unknown-linux-gnu".to_string(), + pointer_width: 64, + data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(), + arch: "aarch64".to_string(), + options: TargetOptions { + unsupported_abis: super::arm_base::unsupported_abis(), + mcount: "\u{1}_mcount".to_string(), + endian: Endian::Big, + ..base + }, + } +} diff --git a/compiler/rustc_target/src/spec/aarch64_be_unknown_linux_gnu_ilp32.rs b/compiler/rustc_target/src/spec/aarch64_be_unknown_linux_gnu_ilp32.rs new file mode 100644 index 00000000000..5b9e9c9519c --- /dev/null +++ b/compiler/rustc_target/src/spec/aarch64_be_unknown_linux_gnu_ilp32.rs @@ -0,0 +1,20 @@ +use crate::abi::Endian; +use crate::spec::{Target, TargetOptions}; + +pub fn target() -> Target { + let mut base = super::linux_gnu_base::opts(); + base.max_atomic_width = Some(128); + + Target { + llvm_target: "aarch64_be-unknown-linux-gnu_ilp32".to_string(), + pointer_width: 32, + data_layout: "E-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(), + arch: "aarch64".to_string(), + options: TargetOptions { + unsupported_abis: super::arm_base::unsupported_abis(), + mcount: "\u{1}_mcount".to_string(), + endian: Endian::Big, + ..base + }, + } +} diff --git a/compiler/rustc_target/src/spec/aarch64_unknown_linux_gnu_ilp32.rs b/compiler/rustc_target/src/spec/aarch64_unknown_linux_gnu_ilp32.rs new file mode 100644 index 00000000000..f2d7576280f --- /dev/null +++ b/compiler/rustc_target/src/spec/aarch64_unknown_linux_gnu_ilp32.rs @@ -0,0 +1,18 @@ +use crate::spec::{Target, TargetOptions}; + +pub fn target() -> Target { + let mut base = super::linux_gnu_base::opts(); + base.max_atomic_width = Some(128); + + Target { + llvm_target: "aarch64-unknown-linux-gnu_ilp32".to_string(), + pointer_width: 32, + data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(), + arch: "aarch64".to_string(), + options: TargetOptions { + unsupported_abis: super::arm_base::unsupported_abis(), + mcount: "\u{1}_mcount".to_string(), + ..base + }, + } +} diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 90d35efaa25..8d6b2e3307b 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -745,6 +745,10 @@ supported_targets! { ("mipsel-sony-psp", mipsel_sony_psp), ("mipsel-unknown-none", mipsel_unknown_none), ("thumbv4t-none-eabi", thumbv4t_none_eabi), + + ("aarch64_be-unknown-linux-gnu", aarch64_be_unknown_linux_gnu), + ("aarch64-unknown-linux-gnu_ilp32", aarch64_unknown_linux_gnu_ilp32), + ("aarch64_be-unknown-linux-gnu_ilp32", aarch64_be_unknown_linux_gnu_ilp32), } /// Everything `rustc` knows about how to compile for a specific target.