From d782c8d0dadfb15ca70cca0502a777993d70c46a Mon Sep 17 00:00:00 2001 From: Till Wegmueller Date: Thu, 22 Jun 2023 21:11:10 +0200 Subject: [PATCH] Add illumos aarch64 target for rust. Signed-off-by: Till Wegmueller --- .../src/spec/aarch64_unknown_illumos.rs | 19 +++++++++++++++++++ compiler/rustc_target/src/spec/mod.rs | 1 + 2 files changed, 20 insertions(+) create mode 100644 compiler/rustc_target/src/spec/aarch64_unknown_illumos.rs diff --git a/compiler/rustc_target/src/spec/aarch64_unknown_illumos.rs b/compiler/rustc_target/src/spec/aarch64_unknown_illumos.rs new file mode 100644 index 0000000000000..25ce3c77c6f1e --- /dev/null +++ b/compiler/rustc_target/src/spec/aarch64_unknown_illumos.rs @@ -0,0 +1,19 @@ +use crate::spec::{Cc, LinkerFlavor, SanitizerSet, Target}; + +pub fn target() -> Target { + let mut base = super::illumos_base::opts(); + base.add_pre_link_args(LinkerFlavor::Unix(Cc::Yes), &["-std=c99"]); + base.cpu = "aarch64".into(); + base.max_atomic_width = Some(128); + base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::CFI; + + Target { + // LLVM does not currently have a separate illumos target, + // so we still pass Solaris to it + llvm_target: "aarch64-unknown-solaris2.11".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: base, + } +} diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index d4774386e2ed2..b257e599eea5f 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -1407,6 +1407,7 @@ supported_targets! { ("sparcv9-sun-solaris", sparcv9_sun_solaris), ("x86_64-unknown-illumos", x86_64_unknown_illumos), + ("aarch64-unknown-illumos", aarch64_unknown_illumos), ("x86_64-pc-windows-gnu", x86_64_pc_windows_gnu), ("i686-pc-windows-gnu", i686_pc_windows_gnu),