]> git.proxmox.com Git - rustc.git/blame - src/librustc_back/target/l4re_base.rs
New upstream version 1.26.2+dfsg1
[rustc.git] / src / librustc_back / target / l4re_base.rs
CommitLineData
3b2f2976
XL
1// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
3b2f2976 11use LinkerFlavor;
0531ce1d 12use PanicStrategy;
3b2f2976
XL
13use target::{LinkArgs, TargetOptions};
14use std::default::Default;
0531ce1d 15//use std::process::Command;
3b2f2976
XL
16
17// Use GCC to locate code for crt* libraries from the host, not from L4Re. Note
18// that a few files also come from L4Re, for these, the function shouldn't be
19// used. This uses GCC for the location of the file, but GCC is required for L4Re anyway.
0531ce1d
XL
20//fn get_path_or(filename: &str) -> String {
21// let child = Command::new("gcc")
22// .arg(format!("-print-file-name={}", filename)).output()
23// .expect("Failed to execute GCC");
24// String::from_utf8(child.stdout)
25// .expect("Couldn't read path from GCC").trim().into()
26//}
3b2f2976 27
0531ce1d
XL
28pub fn opts() -> TargetOptions {
29 let mut args = LinkArgs::new();
30 args.insert(LinkerFlavor::Gcc, vec![]);
3b2f2976 31
0531ce1d 32 TargetOptions {
3b2f2976
XL
33 executables: true,
34 has_elf_tls: false,
35 exe_allocation_crate: None,
36 panic_strategy: PanicStrategy::Abort,
0531ce1d
XL
37 linker: Some("ld".to_string()),
38 pre_link_args: args,
3b2f2976
XL
39 target_family: Some("unix".to_string()),
40 .. Default::default()
0531ce1d 41 }
3b2f2976 42}