Skip to content

Commit 33b0606

Browse files
committed
Add UWP support page
1 parent 2389daa commit 33b0606

File tree

3 files changed

+58
-5
lines changed

3 files changed

+58
-5
lines changed

src/doc/rustc/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
- [*-unknown-openbsd](platform-support/openbsd.md)
8888
- [*-unknown-redox](platform-support/redox.md)
8989
- [\*-unknown-uefi](platform-support/unknown-uefi.md)
90+
- [\*-uwp-windows-msvc](platform-support/uwp-windows-msvc.md)
9091
- [\*-wrs-vxworks](platform-support/vxworks.md)
9192
- [wasm32-wasip1](platform-support/wasm32-wasip1.md)
9293
- [wasm32-wasip1-threads](platform-support/wasm32-wasip1-threads.md)

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ target | std | host | notes
264264
[`aarch64-unknown-redox`](platform-support/redox.md) | ✓ | | ARM64 Redox OS
265265
[`aarch64-unknown-teeos`](platform-support/aarch64-unknown-teeos.md) | ? | | ARM64 TEEOS |
266266
[`aarch64-unknown-trusty`](platform-support/trusty.md) | ? | |
267-
`aarch64-uwp-windows-msvc` | ✓ | |
267+
[`aarch64-uwp-windows-msvc`](platform-support/uwp-windows-msvc.md) | ✓ | |
268268
[`aarch64-wrs-vxworks`](platform-support/vxworks.md) | ✓ | | ARM64 VxWorks OS
269269
`aarch64_be-unknown-linux-gnu` | ✓ | ✓ | ARM64 Linux (big-endian)
270270
`aarch64_be-unknown-linux-gnu_ilp32` | ✓ | ✓ | ARM64 Linux (big-endian, ILP32 ABI)
@@ -312,7 +312,7 @@ target | std | host | notes
312312
[`i686-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 32-bit OpenBSD [^x86_32-floats-return-ABI]
313313
[`i686-unknown-redox`](platform-support/redox.md) | ✓ | | i686 Redox OS
314314
`i686-uwp-windows-gnu` | ✓ | | [^x86_32-floats-return-ABI]
315-
`i686-uwp-windows-msvc` | ✓ | | [^x86_32-floats-return-ABI]
315+
[`i686-uwp-windows-msvc`](platform-support/uwp-windows-msvc.md) | ✓ | | [^x86_32-floats-return-ABI]
316316
[`i686-win7-windows-msvc`](platform-support/win7-windows-msvc.md) | ✓ | | 32-bit Windows 7 support [^x86_32-floats-return-ABI]
317317
[`i686-wrs-vxworks`](platform-support/vxworks.md) | ✓ | | [^x86_32-floats-return-ABI]
318318
[`loongarch64-unknown-linux-ohos`](platform-support/openharmony.md) | ✓ | | LoongArch64 OpenHarmony
@@ -383,8 +383,8 @@ target | std | host | notes
383383
[`thumbv4t-none-eabi`](platform-support/armv4t-none-eabi.md) | * | | Thumb-mode Bare Armv4T
384384
[`thumbv5te-none-eabi`](platform-support/armv5te-none-eabi.md) | * | | Thumb-mode Bare Armv5TE
385385
[`thumbv6m-nuttx-eabi`](platform-support/nuttx.md) | * | | ARMv6M with NuttX
386-
`thumbv7a-pc-windows-msvc` | | |
387-
`thumbv7a-uwp-windows-msvc` | | |
386+
`thumbv7a-pc-windows-msvc` | | |
387+
[`thumbv7a-uwp-windows-msvc`](platform-support/uwp-windows-msvc.md) | | |
388388
[`thumbv7em-nuttx-eabi`](platform-support/nuttx.md) | * | | ARMv7EM with NuttX
389389
[`thumbv7em-nuttx-eabihf`](platform-support/nuttx.md) | * | | ARMv7EM with NuttX, hardfloat
390390
[`thumbv7m-nuttx-eabi`](platform-support/nuttx.md) | * | | ARMv7M with NuttX
@@ -406,7 +406,7 @@ target | std | host | notes
406406
[`x86_64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 64-bit OpenBSD
407407
[`x86_64-unknown-trusty`](platform-support/trusty.md) | ? | |
408408
`x86_64-uwp-windows-gnu` | ✓ | |
409-
`x86_64-uwp-windows-msvc` | ✓ | |
409+
[`x86_64-uwp-windows-msvc`](platform-support/uwp-windows-msvc.md) | ✓ | |
410410
[`x86_64-win7-windows-msvc`](platform-support/win7-windows-msvc.md) | ✓ | | 64-bit Windows 7 support
411411
[`x86_64-wrs-vxworks`](platform-support/vxworks.md) | ✓ | |
412412
[`x86_64h-apple-darwin`](platform-support/x86_64h-apple-darwin.md) | ✓ | ✓ | macOS with late-gen Intel (at least Haswell)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# `x86_64-uwp-windows-msvc`, `i686-uwp-windows-msvc`, `thumbv7a-uwp-windows-msvc` and `aarch64-uwp-windows-msvc`
2+
3+
**Tier: 3**
4+
5+
Windows targets for Universal Windows Platform (UWP) applications, using MSVC toolchain.
6+
7+
## Target maintainers
8+
9+
- [@bdbai](https://github.com/bdbai)
10+
11+
## Requirements
12+
13+
These targets are cross-compiled with std support. The host requirement and
14+
binary format are the same as the corresponding non-UWP targets (i.e.
15+
`x86_64-pc-windows-msvc`, `i686-pc-windows-msvc`, `thumbv7a-pc-windows-msvc`
16+
and `aarch64-pc-windows-msvc`).
17+
18+
## Building the targets
19+
20+
The targets can be built by enabling them for a `rustc` build, for example:
21+
22+
```toml
23+
[build]
24+
build-stage = 1
25+
target = ["x86_64-uwp-windows-msvc", "aarch64-uwp-windows-msvc"]
26+
```
27+
28+
## Building Rust programs
29+
30+
Rust does not yet ship pre-compiled artifacts for these targets. To compile for
31+
these targets, you will either need to build Rust with the targets enabled (see
32+
"Building the targets" above), or build your own copy of `std` by using
33+
`build-std` or similar.
34+
35+
Example of building a Rust project for x64 UWP using `build-std`:
36+
37+
```pwsh
38+
cargo build -Z build-std=std,panic_abort --target x86_64-uwp-windows-msvc
39+
```
40+
41+
## Testing
42+
43+
Currently there is no support to run the rustc test suite for this target.
44+
45+
## Cross-compilation toolchains and C code
46+
47+
In general, the toolchain target should match the corresponding non-UWP
48+
targets. Beware that not all Win32 APIs behave the same way in UWP, and some
49+
are restricted in [AppContainer](https://learn.microsoft.com/en-us/windows/win32/secauthz/appcontainer-for-legacy-applications-)
50+
or even not available at all. If the C code being compiled happens to use any
51+
of restricted or unavailable APIs, consider using allowed alternatives or
52+
disable certain feature sets to avoid using them.

0 commit comments

Comments
 (0)