Skip to content

Commit a01cf33

Browse files
committed
Add new x86_64-win7-windows-msvc target
1 parent 2f8d81f commit a01cf33

File tree

4 files changed

+65
-0
lines changed

4 files changed

+65
-0
lines changed

compiler/rustc_target/src/spec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1604,6 +1604,7 @@ supported_targets! {
16041604
("aarch64-uwp-windows-msvc", aarch64_uwp_windows_msvc),
16051605
("x86_64-pc-windows-msvc", x86_64_pc_windows_msvc),
16061606
("x86_64-uwp-windows-msvc", x86_64_uwp_windows_msvc),
1607+
("x86_64-win7-windows-msvc", x86_64_win7_windows_msvc),
16071608
("i686-pc-windows-msvc", i686_pc_windows_msvc),
16081609
("i686-uwp-windows-msvc", i686_uwp_windows_msvc),
16091610
("i586-pc-windows-msvc", i586_pc_windows_msvc),
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 = "win7".into();
9+
10+
Target {
11+
llvm_target: "x86_64-win7-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+
}

src/doc/rustc/src/platform-support.md

+2
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ target | std | host | notes
342342
[`x86_64-pc-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 7.1 RTOS |
343343
[`x86_64-pc-windows-gnullvm`](platform-support/pc-windows-gnullvm.md) | ✓ | ✓ |
344344
`x86_64-pc-windows-msvc` | * | | 64-bit Windows XP support
345+
`x86_64-sun-solaris` | ? | | Deprecated target for 64-bit Solaris 10/11, illumos
345346
[`x86_64-unikraft-linux-musl`](platform-support/unikraft-linux-musl.md) | ✓ | | 64-bit Unikraft with musl
346347
`x86_64-unknown-dragonfly` | ✓ | ✓ | 64-bit DragonFlyBSD
347348
`x86_64-unknown-haiku` | ✓ | ✓ | 64-bit Haiku
@@ -351,6 +352,7 @@ target | std | host | notes
351352
[`x86_64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 64-bit OpenBSD
352353
`x86_64-uwp-windows-gnu` | ✓ | |
353354
`x86_64-uwp-windows-msvc` | ✓ | |
355+
[`x86_64-win7-windows-msvc`](platform-support/win7-windows-msvc.md) | ✓ | | 64-bit Windows 7 support
354356
`x86_64-wrs-vxworks` | ? | |
355357
[`x86_64h-apple-darwin`](platform-support/x86_64h-apple-darwin.md) | ✓ | ✓ | macOS with late-gen Intel (at least Haswell)
356358

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# *-win7-windows-msvc
2+
3+
**Tier: 3**
4+
5+
Windows targets continuing support of windows7.
6+
7+
## Target maintainers
8+
9+
- @roblabla
10+
11+
## Requirements
12+
13+
This target supports full the entirety of std. This is automatically tested
14+
every night on private infrastructure. Host tools may also work, though those
15+
are not currently tested.
16+
17+
Those targets follow Windows calling convention for extern "C".
18+
19+
Like with any other Windows target created binaries are in PE format.
20+
21+
## Building the target
22+
23+
You can build Rust with support for the targets by adding it to the target list in config.toml:
24+
25+
```
26+
[build]
27+
build-stage = 1
28+
target = [ "x86_64-win7-windows-msvc" ]
29+
```
30+
31+
## Building Rust programs
32+
33+
Rust does not yet ship pre-compiled artifacts for this target. To compile for
34+
this target, you will either need to build Rust with the target enabled (see
35+
"Building the target" above), or build your own copy of `core` by using
36+
`build-std` or similar.
37+
38+
## Testing
39+
40+
Created binaries work fine on Windows or Wine using native hardware.
41+
42+
## Cross-compilation toolchains and C code
43+
44+
Compatible C code can be built with either MSVC's `cl.exe` or LLVM's clang-cl.

0 commit comments

Comments
 (0)