Skip to content

Commit 54a13f1

Browse files
committed
Add {i586,i686,x86_64}-rust9x-windows-msvc targets
1 parent 0e09125 commit 54a13f1

File tree

4 files changed

+67
-0
lines changed

4 files changed

+67
-0
lines changed

compiler/rustc_target/src/spec/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,10 +1605,13 @@ supported_targets! {
16051605
("x86_64-pc-windows-msvc", x86_64_pc_windows_msvc),
16061606
("x86_64-uwp-windows-msvc", x86_64_uwp_windows_msvc),
16071607
("x86_64-win7-windows-msvc", x86_64_win7_windows_msvc),
1608+
("x86_64-rust9x-windows-msvc", x86_64_rust9x_windows_msvc),
16081609
("i686-pc-windows-msvc", i686_pc_windows_msvc),
16091610
("i686-uwp-windows-msvc", i686_uwp_windows_msvc),
16101611
("i686-win7-windows-msvc", i686_win7_windows_msvc),
1612+
("i686-rust9x-windows-msvc", i686_rust9x_windows_msvc),
16111613
("i586-pc-windows-msvc", i586_pc_windows_msvc),
1614+
("i586-rust9x-windows-msvc", i586_rust9x_windows_msvc),
16121615
("thumbv7a-pc-windows-msvc", thumbv7a_pc_windows_msvc),
16131616
("thumbv7a-uwp-windows-msvc", thumbv7a_uwp_windows_msvc),
16141617

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use crate::spec::Target;
2+
3+
pub fn target() -> Target {
4+
let mut base = super::i686_rust9x_windows_msvc::target();
5+
base.cpu = "pentium".into();
6+
base.llvm_target = "i586-pc-windows-msvc".into();
7+
base
8+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
use crate::spec::{base, LinkerFlavor, Lld, Target};
2+
3+
pub fn target() -> Target {
4+
let mut base = base::windows_msvc::opts();
5+
base.cpu = "pentium4".into();
6+
base.max_atomic_width = Some(64);
7+
base.vendor = "rust9x".into();
8+
9+
base.add_pre_link_args(
10+
LinkerFlavor::Msvc(Lld::No),
11+
&[
12+
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
13+
// space available to x86 Windows binaries on x86_64.
14+
"/LARGEADDRESSAWARE",
15+
// Ensure the linker will only produce an image if it can also produce a table of
16+
// the image's safe exception handlers.
17+
// https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
18+
"/SAFESEH",
19+
// Link to ___CxxFrameHandler (XP and earlier MSVCRT) instead of ___CxxFrameHandler3.
20+
// This cannot be done in the MSVC `eh_personality` handling because LLVM hardcodes SEH
21+
// support based on that name, sadly
22+
"/ALTERNATENAME:___CxxFrameHandler3=___CxxFrameHandler",
23+
],
24+
);
25+
26+
// Workaround for #95429
27+
base.has_thread_local = false;
28+
29+
Target {
30+
llvm_target: "i686-pc-windows-msvc".into(),
31+
pointer_width: 32,
32+
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
33+
i64:64-f80:128-n8:16:32-a:0:32-S32"
34+
.into(),
35+
arch: "x86".into(),
36+
options: base,
37+
}
38+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use crate::spec::{base, Target};
2+
3+
pub fn target() -> Target {
4+
let mut base = base::windows_msvc::opts();
5+
base.cpu = "x86-64".into();
6+
base.plt_by_default = false;
7+
base.max_atomic_width = Some(64);
8+
base.vendor = "rust9x".into();
9+
10+
Target {
11+
llvm_target: "x86_64-pc-windows-msvc".into(),
12+
pointer_width: 64,
13+
data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
14+
.into(),
15+
arch: "x86_64".into(),
16+
options: base,
17+
}
18+
}

0 commit comments

Comments
 (0)