]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/l4re_base.rs
Merge commit '5988bbd24aa87732bfa1d111ba00bcdaa22c481a' into sync_cg_clif-2020-11-27
[rust.git] / compiler / rustc_target / src / spec / l4re_base.rs
1 use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, TargetOptions};
2 //use std::process::Command;
3
4 // Use GCC to locate code for crt* libraries from the host, not from L4Re. Note
5 // that a few files also come from L4Re, for these, the function shouldn't be
6 // used. This uses GCC for the location of the file, but GCC is required for L4Re anyway.
7 //fn get_path_or(filename: &str) -> String {
8 //    let child = Command::new("gcc")
9 //        .arg(format!("-print-file-name={}", filename)).output()
10 //        .expect("Failed to execute GCC");
11 //    String::from_utf8(child.stdout)
12 //        .expect("Couldn't read path from GCC").trim().into()
13 //}
14
15 pub fn opts() -> TargetOptions {
16     let mut args = LinkArgs::new();
17     args.insert(LinkerFlavor::Gcc, vec![]);
18
19     TargetOptions {
20         os: "l4re".to_string(),
21         env: "uclibc".to_string(),
22         linker_flavor: LinkerFlavor::Ld,
23         executables: true,
24         has_elf_tls: false,
25         panic_strategy: PanicStrategy::Abort,
26         linker: Some("ld".to_string()),
27         pre_link_args: args,
28         os_family: Some("unix".to_string()),
29         ..Default::default()
30     }
31 }