1 use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions};
3 pub fn opts() -> TargetOptions {
4 let base = super::windows_gnu_base::opts();
6 // FIXME: Consider adding `-nostdlib` and inheriting from `windows_gnu_base`.
7 let mut pre_link_args = LinkArgs::new();
11 // Tell GCC to avoid linker plugins, because we are not bundling
12 // them with Windows installer, and Rust does its own LTO anyways.
13 "-fno-use-linker-plugin".to_string(),
14 // Always enable DEP (NX bit) when it is available
15 "-Wl,--nxcompat".to_string(),
19 // FIXME: Should UWP target be updated for the exception machinery changes from #67502?
20 let mut late_link_args = LinkArgs::new();
21 let late_link_args_dynamic = LinkArgs::new();
22 let late_link_args_static = LinkArgs::new();
23 late_link_args.insert(
26 //"-lwinstorecompat".to_string(),
27 //"-lmingwex".to_string(),
28 //"-lwinstorecompat".to_string(),
29 "-lwinstorecompat".to_string(),
30 "-lruntimeobject".to_string(),
31 "-lsynchronization".to_string(),
32 "-lvcruntime140_app".to_string(),
34 "-lwindowsapp".to_string(),
35 "-lmingwex".to_string(),
36 "-lmingw32".to_string(),
42 limit_rdylib_exports: false,
44 // FIXME: Consider adding `-nostdlib` and inheriting from `windows_gnu_base`.
45 pre_link_objects_exe: vec!["rsbegin.o".to_string()],
46 // FIXME: Consider adding `-nostdlib` and inheriting from `windows_gnu_base`.
47 pre_link_objects_dll: vec!["rsbegin.o".to_string()],
49 late_link_args_dynamic,
50 late_link_args_static,