]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/windows_gnullvm_base.rs
Auto merge of #97800 - pnkfelix:issue-97463-fix-aarch64-call-abi-does-not-zeroext...
[rust.git] / compiler / rustc_target / src / spec / windows_gnullvm_base.rs
1 use crate::spec::{cvs, LinkerFlavor, 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 =
9         TargetOptions::link_args(LinkerFlavor::Gcc, &["-nolibc", "--unwindlib=none"]);
10     // Order of `late_link_args*` does not matter with LLD.
11     let late_link_args = TargetOptions::link_args(
12         LinkerFlavor::Gcc,
13         &["-lmingw32", "-lmingwex", "-lmsvcrt", "-lkernel32", "-luser32"],
14     );
15
16     TargetOptions {
17         os: "windows".into(),
18         env: "gnu".into(),
19         vendor: "pc".into(),
20         abi: "llvm".into(),
21         linker: Some("clang".into()),
22         dynamic_linking: true,
23         dll_prefix: "".into(),
24         dll_suffix: ".dll".into(),
25         exe_suffix: ".exe".into(),
26         families: cvs!["windows"],
27         is_like_windows: true,
28         allows_weak_linkage: false,
29         pre_link_args,
30         late_link_args,
31         abi_return_struct_as_int: true,
32         emit_debug_gdb_scripts: false,
33         requires_uwtable: true,
34         eh_frame_header: false,
35         no_default_libraries: false,
36         has_thread_local: true,
37
38         ..Default::default()
39     }
40 }