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