]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/windows_gnullvm_base.rs
Merge commit '7b73b60faca71d01d900e49831fcb84553e93019' into sync-rustfmt
[rust.git] / compiler / rustc_target / src / spec / windows_gnullvm_base.rs
1 use crate::spec::{cvs, LinkArgs, LinkerFlavor, TargetOptions};
2
3 pub fn opts() -> TargetOptions {
4     let pre_link_args = LinkArgs::from([(
5         LinkerFlavor::Gcc,
6         vec![
7             // We cannot use `-nodefaultlibs` because compiler-rt has to be passed
8             // as a path since it's not added to linker search path by the default.
9             // There were attemts to make it behave like libgcc (so one can just use -l<name>)
10             // but LLVM maintainers rejected it: https://reviews.llvm.org/D51440
11             "-nolibc".into(),
12             "--unwindlib=none".into(),
13         ],
14     )]);
15     let late_link_args = LinkArgs::from([(
16         LinkerFlavor::Gcc,
17         // Order of `late_link_args*` does not matter with LLD.
18         vec![
19             "-lmingw32".into(),
20             "-lmingwex".into(),
21             "-lmsvcrt".into(),
22             "-lkernel32".into(),
23             "-luser32".into(),
24         ],
25     )]);
26
27     TargetOptions {
28         os: "windows".into(),
29         env: "gnu".into(),
30         vendor: "pc".into(),
31         abi: "llvm".into(),
32         linker: Some("clang".into()),
33         dynamic_linking: true,
34         executables: true,
35         dll_prefix: "".into(),
36         dll_suffix: ".dll".into(),
37         exe_suffix: ".exe".into(),
38         families: cvs!["windows"],
39         is_like_windows: true,
40         allows_weak_linkage: false,
41         pre_link_args,
42         late_link_args,
43         abi_return_struct_as_int: true,
44         emit_debug_gdb_scripts: false,
45         requires_uwtable: true,
46         eh_frame_header: false,
47         no_default_libraries: false,
48         has_thread_local: true,
49
50         ..Default::default()
51     }
52 }