Skip to content

Commit 88c4802

Browse files
committed
rustc_target: Inherit windows_uwp_gnu_base from windows_gnu_base
1 parent fd0e298 commit 88c4802

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed
Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions};
22

33
pub fn opts() -> TargetOptions {
4+
let base = super::windows_gnu_base::opts();
5+
6+
// FIXME: Consider adding `-nostdlib` and inheriting from `windows_gnu_base`.
47
let mut pre_link_args = LinkArgs::new();
58
pre_link_args.insert(
69
LinkerFlavor::Gcc,
@@ -13,7 +16,10 @@ pub fn opts() -> TargetOptions {
1316
],
1417
);
1518

19+
// FIXME: Should UWP target be updated for the exception machinery changes from #67502?
1620
let mut late_link_args = LinkArgs::new();
21+
let late_link_args_dynamic = LinkArgs::new();
22+
let late_link_args_static = LinkArgs::new();
1723
late_link_args.insert(
1824
LinkerFlavor::Gcc,
1925
vec![
@@ -32,31 +38,17 @@ pub fn opts() -> TargetOptions {
3238
);
3339

3440
TargetOptions {
35-
// FIXME(#13846) this should be enabled for windows
36-
function_sections: false,
37-
linker: Some("gcc".to_string()),
38-
dynamic_linking: true,
3941
executables: false,
40-
dll_prefix: String::new(),
41-
dll_suffix: ".dll".to_string(),
42-
exe_suffix: ".exe".to_string(),
43-
staticlib_prefix: "lib".to_string(),
44-
staticlib_suffix: ".a".to_string(),
45-
target_family: Some("windows".to_string()),
46-
is_like_windows: true,
47-
allows_weak_linkage: false,
42+
limit_rdylib_exports: false,
4843
pre_link_args,
49-
pre_link_objects_exe: vec![
50-
"rsbegin.o".to_string(), // Rust compiler runtime initialization, see rsbegin.rs
51-
],
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`.
5247
pre_link_objects_dll: vec!["rsbegin.o".to_string()],
5348
late_link_args,
54-
post_link_objects: vec!["rsend.o".to_string()],
55-
abi_return_struct_as_int: true,
56-
emit_debug_gdb_scripts: false,
57-
requires_uwtable: true,
58-
limit_rdylib_exports: false,
49+
late_link_args_dynamic,
50+
late_link_args_static,
5951

60-
..Default::default()
52+
..base
6153
}
6254
}

0 commit comments

Comments
 (0)