|
| 1 | +// Copyright 2014 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 | + |
| 11 | +use spec::{LinkArgs, LinkerFlavor, PanicStrategy, TargetOptions}; |
| 12 | +use std::default::Default; |
| 13 | + |
| 14 | +pub fn opts() -> TargetOptions { |
| 15 | + let mut args = LinkArgs::new(); |
| 16 | + args.insert(LinkerFlavor::Gcc, vec![ |
| 17 | + "-Wl,-Bstatic".to_string(), |
| 18 | + "-Wl,--no-dynamic-linker".to_string(), |
| 19 | + "-Wl,--gc-sections".to_string(), |
| 20 | + "-Wl,--as-needed".to_string(), |
| 21 | + ]); |
| 22 | + |
| 23 | + TargetOptions { |
| 24 | + exe_allocation_crate: None, |
| 25 | + executables: true, |
| 26 | + has_elf_tls: true, |
| 27 | + linker_is_gnu: true, |
| 28 | + no_default_libraries: false, |
| 29 | + panic_strategy: PanicStrategy::Abort, |
| 30 | + position_independent_executables: false, |
| 31 | + pre_link_args: args, |
| 32 | + relocation_model: "static".to_string(), |
| 33 | + target_family: Some("unix".to_string()), |
| 34 | + tls_model: "local-exec".to_string(), |
| 35 | + .. Default::default() |
| 36 | + } |
| 37 | +} |
0 commit comments