You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/doc/rustc/src/platform-support/arm64ec-pc-windows-msvc.md
+38-17
Original file line number
Diff line number
Diff line change
@@ -11,48 +11,69 @@ applications on AArch64 Windows 11. See <https://learn.microsoft.com/en-us/windo
11
11
12
12
## Requirements
13
13
14
-
Target only supports cross-compilation, `core` and `alloc` are supported but
15
-
`std` is not.
16
-
17
14
Builds Arm64EC static and dynamic libraries and executables which can be run on
18
15
AArch64 Windows 11 devices. Arm64EC static libraries can also be linked into
19
16
Arm64X dynamic libraries and executables.
20
17
21
-
Uses `arm64ec` as its `target_arch` - code built for Arm64EC must be compatible
22
-
with x86_64 code (e.g., same structure layouts, function signatures, etc.) but
23
-
use AArch64 intrinsics.
24
-
25
-
Only supported backend is LLVM 18 (or above).
18
+
Only supported backend is LLVM 18 or above:
19
+
* 18.1.0 added initial support for Arm64EC.
20
+
* 18.1.2 fixed import library generation (required for `raw-dylib` support).
21
+
* 18.1.4 fixed linking issue for some intrinsics implemented in
22
+
`compiler_builtins`.
23
+
24
+
### Reusing code from other architectures - x86_64 or AArch64?
25
+
26
+
Arm64EC uses `arm64ec` as its `target_arch`, but it is possible to reuse
27
+
existing architecture-specific code in most cases. The best mental model for
28
+
deciding which architecture to reuse is to is to think of Arm64EC as an x86_64
29
+
process that happens to use the AArch64 instruction set (with some caveats) and
30
+
has a completely custom ABI.
31
+
32
+
To put this in practice:
33
+
* Arm64EC interacts with the operating system, other processes and other DLLs as
34
+
x86_64.
35
+
- For example, [in `backtrace`](https://github.com/rust-lang/backtrace-rs/commit/ef39a7d7da58b4cae8c8f3fc67a8300fd8d2d0d9)
36
+
we use the x86_64 versions of `CONTEXT` and `RtlVirtualUnwind`.
37
+
- If you are configuring a search path to find DLLs (e.g., to load plugins or
38
+
addons into your application), you should use the same path as the x86_64
39
+
version of your application, not the AArch64 path (since Arm64EC (i.e.,
- For example, <https://github.com/rust-lang/portable-simd/commit/ca4033f49b1f6019561b8b161b4097b4a07f2e1b>
43
+
and <https://github.com/rust-lang/stdarch/commit/166ef7ba22b6a1d908d4b29a36e68ceca324808a>.
44
+
* Assembly for AArch64 might be reusable for Arm64EC, but there are many
45
+
caveats. For full details see [Microsoft's documentation on the Arm64EC ABI](https://learn.microsoft.com/en-us/windows/arm/arm64ec-abi)
46
+
but in brief:
47
+
- Arm64EC uses a subset of AArch64 registers.
48
+
- Arm64EC uses a different name mangling scheme than AArch64.
49
+
- Arm64EC requires entry and exit thunks be generated for some functions.
50
+
- Indirect calls must be done via a call checker.
51
+
- Control Flow Guard and stack checks use different functions than AArch64.
26
52
27
53
## Building the target
28
54
29
55
You can build Rust with support for the targets by adding it to the `target`
30
-
list in `config.toml` and disabling `std`:
56
+
list in `config.toml`:
31
57
32
58
```toml
33
59
[build]
34
60
target = [ "arm64ec-pc-windows-msvc" ]
35
-
36
-
[target.arm64ec-pc-windows-msvc]
37
-
no-std = true
38
61
```
39
62
40
63
## Building Rust programs
41
64
42
65
Rust does not yet ship pre-compiled artifacts for this target. To compile for
43
66
this target, you will either need to build Rust with the target enabled (see
44
-
"Building the target" above), or build your own copy of `core` by using
45
-
`build-std` or similar.
67
+
"Building the target" above), or build your own copy using `build-std` or
68
+
similar.
46
69
47
70
## Testing
48
71
49
72
Tests can be run on AArch64 Windows 11 devices.
50
73
51
-
Since this is a `no_std` target, the Rust test suite is not supported.
52
-
53
74
## Cross-compilation toolchains and C code
54
75
55
-
C code can be built using the Arm64-targetting MSVC toolchain.
76
+
C code can be built using the Arm64-targetting MSVC or Clang toolchain.
0 commit comments