use crate::spec::{PanicStrategy, Target};

// Have specific requirements about how segments are aligned
const LINKER_SCRIPT: &str = include_str!("./aarch64_unknown_yggdrasil_linker_script.ld");

pub fn target() -> Target {
    let mut base = super::yggdrasil_base::opts();

    base.disable_redzone = true;
    base.panic_strategy = PanicStrategy::Abort;
    base.features = "-fp-armv8,-neon,+strict-align,+v8a".into();
    base.link_script = Some(LINKER_SCRIPT.into());

    Target {
        llvm_target: "aarch64-unknown-none".into(),
        pointer_width: 64,
        arch: "aarch64".into(),
        data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
        options: base,
    }
}
