Tier: 2 (without host tools)
Windows targets similar to *-pc-windows-gnu
but using UCRT as the runtime and various LLVM tools/libraries instead of GCC/Binutils.
Target triples available so far:
aarch64-pc-windows-gnullvm
i686-pc-windows-gnullvm
x86_64-pc-windows-gnullvm
The easiest way to obtain these targets is cross-compilation, but native build from x86_64-pc-windows-gnu
is possible with few hacks which I don't recommend. Std support is expected to be on pair with *-pc-windows-gnu
.
Binaries for this target should be at least on pair with *-pc-windows-gnu
in terms of requirements and functionality.
Those targets follow Windows calling convention for extern "C"
.
Like with any other Windows target, created binaries are in PE format.
These targets can be easily cross-compiled using llvm-mingw toolchain or MSYS2 CLANG* environments. Just fill [target.*]
sections for both build and resulting compiler and set installation prefix in config.toml
. Then run ./x.py install
. In my case I had ran ./x.py install --host x86_64-pc-windows-gnullvm --target x86_64-pc-windows-gnullvm
inside MSYS2 MINGW64 shell so x86_64-pc-windows-gnu
was my build toolchain.
Native bootstrapping is doable in two ways:
The second option might stop working anytime, so it's not recommended.
Rust does ship a pre-compiled std library for those targets. That means one can easily cross-compile for those targets from other hosts if C proper toolchain is installed.
Alternatively full toolchain can be built as described in the previous section.
Created binaries work fine on Windows or Wine using native hardware. Testing AArch64 on x86_64 is problematic though and requires spending some time with QEMU. Most of x86_64 testsuite does pass when cross-compiling, with exception for rustdoc
and ui-fulldeps
that fail with and error regarding a missing library, they do pass in native builds though. The only failing test is std's process::tests::test_proc_thread_attributes
for unknown reason.
Compatible C code can be built with Clang's aarch64-pc-windows-gnu
, i686-pc-windows-gnullvm
and x86_64-pc-windows-gnu
targets as long as LLVM-based C toolchains are used. Those include: