Add new x86_64-win7-windows-msvc target

This commit is contained in:
roblabla 2023-11-14 17:45:04 +01:00
parent 2f8d81f9db
commit ad6dd6c624
5 changed files with 65 additions and 0 deletions

View File

@ -1604,6 +1604,7 @@ supported_targets! {
("aarch64-uwp-windows-msvc", aarch64_uwp_windows_msvc), ("aarch64-uwp-windows-msvc", aarch64_uwp_windows_msvc),
("x86_64-pc-windows-msvc", x86_64_pc_windows_msvc), ("x86_64-pc-windows-msvc", x86_64_pc_windows_msvc),
("x86_64-uwp-windows-msvc", x86_64_uwp_windows_msvc), ("x86_64-uwp-windows-msvc", x86_64_uwp_windows_msvc),
("x86_64-win7-windows-msvc", x86_64_win7_windows_msvc),
("i686-pc-windows-msvc", i686_pc_windows_msvc), ("i686-pc-windows-msvc", i686_pc_windows_msvc),
("i686-uwp-windows-msvc", i686_uwp_windows_msvc), ("i686-uwp-windows-msvc", i686_uwp_windows_msvc),
("i586-pc-windows-msvc", i586_pc_windows_msvc), ("i586-pc-windows-msvc", i586_pc_windows_msvc),

View File

@ -0,0 +1,18 @@
use crate::spec::{base, Target};
pub fn target() -> Target {
let mut base = base::windows_msvc::opts();
base.cpu = "x86-64".into();
base.plt_by_default = false;
base.max_atomic_width = Some(64);
base.vendor = "win7".into();
Target {
llvm_target: "x86_64-win7-windows-msvc".into(),
pointer_width: 64,
data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
.into(),
arch: "x86_64".into(),
options: base,
}
}

View File

@ -55,6 +55,7 @@
- [\*-unknown-uefi](platform-support/unknown-uefi.md) - [\*-unknown-uefi](platform-support/unknown-uefi.md)
- [wasm32-wasi-preview1-threads](platform-support/wasm32-wasi-preview1-threads.md) - [wasm32-wasi-preview1-threads](platform-support/wasm32-wasi-preview1-threads.md)
- [wasm64-unknown-unknown](platform-support/wasm64-unknown-unknown.md) - [wasm64-unknown-unknown](platform-support/wasm64-unknown-unknown.md)
- [\*-win7-windows-msvc](platform-support/win7-windows-msvc.md)
- [x86_64-fortanix-unknown-sgx](platform-support/x86_64-fortanix-unknown-sgx.md) - [x86_64-fortanix-unknown-sgx](platform-support/x86_64-fortanix-unknown-sgx.md)
- [x86_64-unknown-none](platform-support/x86_64-unknown-none.md) - [x86_64-unknown-none](platform-support/x86_64-unknown-none.md)
- [x86_64h-apple-darwin](platform-support/x86_64h-apple-darwin.md) - [x86_64h-apple-darwin](platform-support/x86_64h-apple-darwin.md)

View File

@ -351,6 +351,7 @@ target | std | host | notes
[`x86_64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 64-bit OpenBSD [`x86_64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 64-bit OpenBSD
`x86_64-uwp-windows-gnu` | ✓ | | `x86_64-uwp-windows-gnu` | ✓ | |
`x86_64-uwp-windows-msvc` | ✓ | | `x86_64-uwp-windows-msvc` | ✓ | |
[`x86_64-win7-windows-msvc`](platform-support/win7-windows-msvc.md) | ✓ | | 64-bit Windows 7 support
`x86_64-wrs-vxworks` | ? | | `x86_64-wrs-vxworks` | ? | |
[`x86_64h-apple-darwin`](platform-support/x86_64h-apple-darwin.md) | ✓ | ✓ | macOS with late-gen Intel (at least Haswell) [`x86_64h-apple-darwin`](platform-support/x86_64h-apple-darwin.md) | ✓ | ✓ | macOS with late-gen Intel (at least Haswell)

View File

@ -0,0 +1,44 @@
# *-win7-windows-msvc
**Tier: 3**
Windows targets continuing support of windows7.
## Target maintainers
- @roblabla
## Requirements
This target supports full the entirety of std. This is automatically tested
every night on private infrastructure. Host tools may also work, though those
are not currently tested.
Those targets follow Windows calling convention for extern "C".
Like with any other Windows target created binaries are in PE format.
## Building the target
You can build Rust with support for the targets by adding it to the target list in config.toml:
```toml
[build]
build-stage = 1
target = [ "x86_64-win7-windows-msvc" ]
```
## Building Rust programs
Rust does not yet ship pre-compiled artifacts for this target. To compile for
this target, you will either need to build Rust with the target enabled (see
"Building the target" above), or build your own copy of `core` by using
`build-std` or similar.
## Testing
Created binaries work fine on Windows or Wine using native hardware.
## Cross-compilation toolchains and C code
Compatible C code can be built with either MSVC's `cl.exe` or LLVM's clang-cl.