|
| 1 | +# `*-pc-windows-msvc` |
| 2 | + |
| 3 | +Windows MSVC targets. |
| 4 | + |
| 5 | +**Tier 1 with host tools:** |
| 6 | + |
| 7 | +- `i686-pc-windows-msvc`: Windows on 32-bit x86. |
| 8 | +- `x86_64-pc-windows-msvc`: Windows on 64-bit x86. |
| 9 | + |
| 10 | +**Tier 2 with host tools:** |
| 11 | + |
| 12 | +- `aarch64-pc-windows-msvc`: Windows on ARM64. |
| 13 | + |
| 14 | +## Target maintainers |
| 15 | + |
| 16 | +[@ChrisDenton](https://github.com/ChrisDenton) |
| 17 | +[@dpaoliello](https://github.com/dpaoliello) |
| 18 | +[@lambdageek](https://github.com/lambdageek) |
| 19 | +[@sivadeilra](https://github.com/sivadeilra) |
| 20 | +[@wesleywiser](https://github.com/wesleywiser) |
| 21 | + |
| 22 | +## Requirements |
| 23 | + |
| 24 | +### OS version |
| 25 | + |
| 26 | +Windows 10 or higher is required for client installs, Windows Server 2016 or higher is required for server installs. |
| 27 | + |
| 28 | +### Host tooling |
| 29 | + |
| 30 | +The minimum supported Visual Studio version is 2017 but this support is not actively tested in CI. |
| 31 | +It is **highly** recommended to use the latest version of VS (currently VS 2022). |
| 32 | + |
| 33 | +### Platform details |
| 34 | + |
| 35 | +These targets fully implement the Rust standard library. |
| 36 | + |
| 37 | +The `extern "C"` calling convention conforms to Microsoft's default calling convention for the given architecture: [`__cdecl`] on `i686`, [`x64`] on `x86_64` and [`ARM64`] on `aarch64`. |
| 38 | + |
| 39 | +The `*-windows-msvc` targets produce PE/COFF binaries with CodeView debuginfo, the native formats used on Windows. |
| 40 | + |
| 41 | +[`__cdecl`]: https://learn.microsoft.com/en-us/cpp/cpp/cdecl?view=msvc-170 |
| 42 | +[`x64`]: https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-170 |
| 43 | +[`ARM64`]: https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170 |
| 44 | + |
| 45 | +## Building Rust programs |
| 46 | + |
| 47 | +These targets are distributed via `rustup` and can be installed via `rustup component add [--toolchain {name}] {target}`. |
| 48 | + |
| 49 | +For example, adding the 32-bit x86 target to the `nightly` toolchain: |
| 50 | + |
| 51 | +``` |
| 52 | +rustup component add --toolchain nightly i686-pc-windows-msvc |
| 53 | +``` |
| 54 | + |
| 55 | +or adding the ARM64 target to the active toolchain: |
| 56 | + |
| 57 | +``` |
| 58 | +rustup component add aarch64-pc-windows-msvc |
| 59 | +``` |
| 60 | + |
| 61 | +## Testing |
| 62 | + |
| 63 | +There are no special requirements for testing and running this target. |
| 64 | + |
| 65 | +## Cross-compilation toolchains and C code |
| 66 | + |
| 67 | +Architectural cross-compilation from one Windows host to a different Windows platform is natively supported by the MSVC toolchain provided the appropriate components are selected when using the VS Installer. |
| 68 | + |
| 69 | +Cross-compilation from a non-Windows host to a `*-windows-msvc` target _may_ be possible but is not supported. |
0 commit comments