use crate::spec::{LinkArgs, LinkerFlavor, RelroLevel, TargetOptions};
use std::default::Default;
pub fn opts() -> TargetOptions {
let mut args = LinkArgs::new();
args.insert(
LinkerFlavor::Gcc,
vec![
"-Wl,--as-needed".to_string(),
"-Wl,-z,noexecstack".to_string(),
],
);
TargetOptions {
dynamic_linking: true,
executables: true,
target_family: Some("unix".to_string()),
linker_is_gnu: true,
has_rpath: true,
pre_link_args: args,
position_independent_executables: true,
relro_level: RelroLevel::Full,
..Default::default()
}
}