Skip to main content

rustc_target/spec/targets/
aarch64_unknown_ferrocene_facade.rs

1//! This custom target (only available in Ferrocene) is meant to be used internally to test whether
2//! the core library works, as we need a standard library to run tests.
3//!
4//! The target has the exact same configuration as the target we want to test, with just the bits
5//! specific to the standard library enabled.
6//!
7//! THIS IS TEMPORARY. We implemented this solution as we needed to run bare-metal tests for
8//! qualification, but we're planning a cleaner implementation to upstream.
9
10use crate::spec::{Env, LinkSelfContainedDefault, Os, Target, TargetMetadata, crt_objects, cvs};
11
12pub(crate) fn target() -> Target {
13    let mut target = super::aarch64_unknown_none::target();
14
15    target.metadata = TargetMetadata::default();
16    target.metadata.tier = Some(1);
17
18    // libstd port
19    target.families = cvs!["unix"];
20    target.os = Os::Linux;
21    target.env = Env::Musl;
22    target.has_thread_local = true;
23
24    // crt and libc are self-contained
25    target.pre_link_objects_self_contained = crt_objects::all("crt1.o");
26    target.link_self_contained = LinkSelfContainedDefault::True;
27
28    target
29}