Skip to content

Commit acec659

Browse files
committed
Add {i586,i686,x86_64}-rust9x-windows-msvc targets
1 parent 0f13036 commit acec659

File tree

7 files changed

+72
-0
lines changed

7 files changed

+72
-0
lines changed

compiler/rustc_target/src/spec/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,10 +1795,13 @@ supported_targets! {
17951795
("x86_64-pc-windows-msvc", x86_64_pc_windows_msvc),
17961796
("x86_64-uwp-windows-msvc", x86_64_uwp_windows_msvc),
17971797
("x86_64-win7-windows-msvc", x86_64_win7_windows_msvc),
1798+
("x86_64-rust9x-windows-msvc", x86_64_rust9x_windows_msvc),
17981799
("i686-pc-windows-msvc", i686_pc_windows_msvc),
17991800
("i686-uwp-windows-msvc", i686_uwp_windows_msvc),
18001801
("i686-win7-windows-msvc", i686_win7_windows_msvc),
1802+
("i686-rust9x-windows-msvc", i686_rust9x_windows_msvc),
18011803
("i586-pc-windows-msvc", i586_pc_windows_msvc),
1804+
("i586-rust9x-windows-msvc", i586_rust9x_windows_msvc),
18021805
("thumbv7a-pc-windows-msvc", thumbv7a_pc_windows_msvc),
18031806
("thumbv7a-uwp-windows-msvc", thumbv7a_uwp_windows_msvc),
18041807

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(crate) 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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use crate::spec::{LinkerFlavor, Lld, Target};
2+
3+
pub(crate) fn target() -> Target {
4+
let mut base = super::i686_pc_windows_msvc::target();
5+
base.vendor = "rust9x".into();
6+
7+
base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &[
8+
// "/LARGEADDRESSAWARE",
9+
// "/SAFESEH",
10+
// ↑ these are already added in the base target
11+
12+
// Link to ___CxxFrameHandler (XP and earlier MSVCRT) instead of ___CxxFrameHandler3.
13+
// This cannot be done in the MSVC `eh_personality` handling because LLVM hardcodes SEH
14+
// support based on that name, sadly
15+
"/ALTERNATENAME:___CxxFrameHandler3=___CxxFrameHandler",
16+
]);
17+
18+
base.metadata = crate::spec::TargetMetadata {
19+
description: Some("32-bit MSVC rust9x (Windows 95/NT3.51+)".into()),
20+
tier: Some(4),
21+
host_tools: Some(false),
22+
std: Some(true),
23+
};
24+
25+
base
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use crate::spec::{LinkerFlavor, Lld, Target};
2+
3+
pub(crate) fn target() -> Target {
4+
let mut base = super::x86_64_pc_windows_msvc::target();
5+
// these aren't available on all x86_64 CPUs
6+
// base.features = "+cx16,+sse3,+sahf".into();
7+
base.plt_by_default = false;
8+
base.max_atomic_width = Some(64);
9+
base.vendor = "rust9x".into();
10+
11+
base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &[
12+
// Link to ___CxxFrameHandler (XP and earlier MSVCRT) instead of ___CxxFrameHandler3.
13+
// This cannot be done in the MSVC `eh_personality` handling because LLVM hardcodes SEH
14+
// support based on that name, sadly
15+
"/ALTERNATENAME:___CxxFrameHandler3=___CxxFrameHandler",
16+
]);
17+
18+
base.metadata = crate::spec::TargetMetadata {
19+
description: Some("64-bit MSVC rust9x (Windows XP 64bit+)".into()),
20+
tier: Some(4),
21+
host_tools: Some(false),
22+
std: Some(true),
23+
};
24+
25+
base
26+
}

library/std/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,5 @@ check-cfg = [
146146
'cfg(feature, values(any()))',
147147
# #[cfg(bootstrap)] rtems
148148
'cfg(target_os, values("rtems"))',
149+
'cfg(target_vendor, values("rust9x"))',
149150
]

library/windows_targets/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ edition = "2021"
88
# Enable using raw-dylib for Windows imports.
99
# This will eventually be the default.
1010
windows_raw_dylib = []
11+
12+
[lints.rust]
13+
unexpected_cfgs = { level = "allow", check-cfg = [
14+
'cfg(target_vendor, values("rust9x"))',
15+
] }

src/bootstrap/src/core/sanity.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ pub struct Finder {
3434
// Targets can be removed from this list once they are present in the stage0 compiler (usually by updating the beta compiler of the bootstrap).
3535
const STAGE0_MISSING_TARGETS: &[&str] = &[
3636
// just a dummy comment so the list doesn't get onelined
37+
"i586-rust9x-windows-msvc",
38+
"i686-rust9x-windows-msvc",
39+
"x86_64-rust9x-windows-msvc",
3740
];
3841

3942
/// Minimum version threshold for libstdc++ required when using prebuilt LLVM

0 commit comments

Comments
 (0)