]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/netbsd_base.rs
Auto merge of #77618 - fusion-engineering-forks:windows-parker, r=Amanieu
[rust.git] / compiler / rustc_target / src / spec / netbsd_base.rs
1 use crate::spec::{LinkArgs, LinkerFlavor, RelroLevel, TargetOptions};
2
3 pub fn opts() -> TargetOptions {
4     let mut args = LinkArgs::new();
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         ],
14     );
15
16     TargetOptions {
17         os: "netbsd".to_string(),
18         dynamic_linking: true,
19         executables: true,
20         os_family: Some("unix".to_string()),
21         linker_is_gnu: true,
22         no_default_libraries: false,
23         has_rpath: true,
24         pre_link_args: args,
25         position_independent_executables: true,
26         relro_level: RelroLevel::Full,
27         use_ctors_section: true,
28         dwarf_version: Some(2),
29         ..Default::default()
30     }
31 }