1 use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions, RelroLevel};
2 use std::default::Default;
4 pub fn opts() -> TargetOptions {
5 let mut args = LinkArgs::new();
6 args.insert(LinkerFlavor::Gcc, vec![
7 // GNU-style linkers will use this to omit linking to libraries
8 // which don't actually fulfill any relocations, but only for
9 // libraries which follow this flag. Thus, use it before
10 // specifying libraries to link to.
11 "-Wl,--as-needed".to_string(),
13 // Always enable NX protection when it is available
14 "-Wl,-z,noexecstack".to_string(),
18 dynamic_linking: true,
20 target_family: Some("unix".to_string()),
24 position_independent_executables: true,
25 eliminate_frame_pointer: false, // FIXME 43575
26 relro_level: RelroLevel::Full,
27 abi_return_struct_as_int: true,