]> git.proxmox.com Git - rustc.git/blame - src/librustc_target/spec/dragonfly_base.rs
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_target / spec / dragonfly_base.rs
CommitLineData
dfeec247 1use crate::spec::{LinkArgs, LinkerFlavor, RelroLevel, TargetOptions};
1a4d82fc
JJ
2
3pub fn opts() -> TargetOptions {
cc61c64b 4 let mut args = LinkArgs::new();
dfeec247
XL
5 args.insert(
6 LinkerFlavor::Gcc,
7 vec![
8 // GNU-style linkers will use this to omit linking to libraries
9 // which don't actually fulfill any relocations, but only for
10 // libraries which follow this flag. Thus, use it before
11 // specifying libraries to link to.
12 "-Wl,--as-needed".to_string(),
13 // Always enable NX protection when it is available
14 "-Wl,-z,noexecstack".to_string(),
15 ],
16 );
cc61c64b 17
1a4d82fc 18 TargetOptions {
1a4d82fc
JJ
19 dynamic_linking: true,
20 executables: true,
32a655c1 21 target_family: Some("unix".to_string()),
1a4d82fc
JJ
22 linker_is_gnu: true,
23 has_rpath: true,
cc61c64b 24 pre_link_args: args,
1a4d82fc 25 position_independent_executables: true,
3b2f2976 26 relro_level: RelroLevel::Full,
dfeec247 27 ..Default::default()
1a4d82fc
JJ
28 }
29}