From 6ef377cc41dbc7ba9455d0b44f13c3c1a024b0cf Mon Sep 17 00:00:00 2001 From: Havard Eidnes Date: Sun, 7 May 2023 18:35:35 +0000 Subject: [PATCH] Add support for NetBSD/aarch64-be (big-endian arm64). --- .../src/spec/aarch64_be_unknown_netbsd.rs | 17 +++++++++++++++++ compiler/rustc_target/src/spec/mod.rs | 1 + src/bootstrap/bootstrap.py | 1 + 3 files changed, 19 insertions(+) create mode 100644 compiler/rustc_target/src/spec/aarch64_be_unknown_netbsd.rs diff --git a/compiler/rustc_target/src/spec/aarch64_be_unknown_netbsd.rs b/compiler/rustc_target/src/spec/aarch64_be_unknown_netbsd.rs new file mode 100644 index 00000000000..98ae05974aa --- /dev/null +++ b/compiler/rustc_target/src/spec/aarch64_be_unknown_netbsd.rs @@ -0,0 +1,17 @@ +use crate::abi::Endian; +use crate::spec::{Target, TargetOptions}; + +pub fn target() -> Target { + Target { + llvm_target: "aarch64_be-unknown-netbsd".into(), + pointer_width: 64, + data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(), + arch: "aarch64".into(), + options: TargetOptions { + mcount: "__mcount".into(), + max_atomic_width: Some(128), + endian: Endian::Big, + ..super::netbsd_base::opts() + }, + } +} diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 10d38c34919..e09f8c9ea91 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -1100,6 +1100,7 @@ fn $module() { ("x86_64-unknown-openbsd", x86_64_unknown_openbsd), ("aarch64-unknown-netbsd", aarch64_unknown_netbsd), + ("aarch64_be-unknown-netbsd", aarch64_be_unknown_netbsd), ("armv6-unknown-netbsd-eabihf", armv6_unknown_netbsd_eabihf), ("armv7-unknown-netbsd-eabihf", armv7_unknown_netbsd_eabihf), ("i686-unknown-netbsd", i686_unknown_netbsd), diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index f22cdad7df4..c79fe043146 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -327,6 +327,7 @@ def default_build_triple(verbose): cputype_mapper = { 'BePC': 'i686', 'aarch64': 'aarch64', + 'aarch64eb': 'aarch64', 'amd64': 'x86_64', 'arm64': 'aarch64', 'i386': 'i686',