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

// Have specific requirements about how segments are aligned
const LINKER_SCRIPT: &str = include_str!("./x86_64_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.link_script = Some(LINKER_SCRIPT.into());

    Target {
        llvm_target: "x86_64-unknown-linux-gnu".into(),
        pointer_width: 64,
        arch: "x86_64".into(),
        data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
            .into(),
        options: base,
    }
}
