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