1 use crate::spec::{cvs, Cc, DebuginfoKind, LinkerFlavor, Lld, SplitDebuginfo, TargetOptions};
4 pub fn opts() -> TargetOptions {
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.
7 // There were attempts to make it behave like libgcc (so one can just use -l<name>)
8 // but LLVM maintainers rejected it: https://reviews.llvm.org/D51440
9 let pre_link_args = TargetOptions::link_args(
10 LinkerFlavor::Gnu(Cc::Yes, Lld::No),
11 &["-nolibc", "--unwindlib=none"],
13 // Order of `late_link_args*` does not matter with LLD.
14 let late_link_args = TargetOptions::link_args(
15 LinkerFlavor::Gnu(Cc::Yes, Lld::No),
16 &["-lmingw32", "-lmingwex", "-lmsvcrt", "-lkernel32", "-luser32"],
24 linker: Some("clang".into()),
25 dynamic_linking: true,
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,
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,
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]),