]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_target/src/spec/windows_gnullvm_base.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / compiler / rustc_target / src / spec / windows_gnullvm_base.rs
CommitLineData
487cf647
FG
1use crate::spec::{cvs, Cc, DebuginfoKind, LinkerFlavor, Lld, SplitDebuginfo, TargetOptions};
2use std::borrow::Cow;
04454e1e
FG
3
4pub fn opts() -> TargetOptions {
064997fb
FG
5 // We cannot use `-nodefaultlibs` because compiler-rt has to be passed
6 // as a path since it's not added to linker search path by the default.
f2b60f7d 7 // There were attempts to make it behave like libgcc (so one can just use -l<name>)
064997fb 8 // but LLVM maintainers rejected it: https://reviews.llvm.org/D51440
2b03887a
FG
9 let pre_link_args = TargetOptions::link_args(
10 LinkerFlavor::Gnu(Cc::Yes, Lld::No),
11 &["-nolibc", "--unwindlib=none"],
12 );
064997fb
FG
13 // Order of `late_link_args*` does not matter with LLD.
14 let late_link_args = TargetOptions::link_args(
2b03887a 15 LinkerFlavor::Gnu(Cc::Yes, Lld::No),
064997fb
FG
16 &["-lmingw32", "-lmingwex", "-lmsvcrt", "-lkernel32", "-luser32"],
17 );
04454e1e
FG
18
19 TargetOptions {
20 os: "windows".into(),
21 env: "gnu".into(),
22 vendor: "pc".into(),
23 abi: "llvm".into(),
24 linker: Some("clang".into()),
25 dynamic_linking: true,
04454e1e
FG
26 dll_prefix: "".into(),
27 dll_suffix: ".dll".into(),
28 exe_suffix: ".exe".into(),
29 families: cvs!["windows"],
30 is_like_windows: true,
31 allows_weak_linkage: false,
32 pre_link_args,
33 late_link_args,
34 abi_return_struct_as_int: true,
35 emit_debug_gdb_scripts: false,
36 requires_uwtable: true,
37 eh_frame_header: false,
38 no_default_libraries: false,
39 has_thread_local: true,
487cf647
FG
40 // FIXME(davidtwco): Support Split DWARF on Windows GNU - may require LLVM changes to
41 // output DWO, despite using DWARF, doesn't use ELF..
42 debuginfo_kind: DebuginfoKind::Pdb,
43 supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
04454e1e
FG
44 ..Default::default()
45 }
46}