Skip to content

Commit 5396bcd

Browse files
committed
Provide prebuilt std for gnullvm targets
1 parent b3df56a commit 5396bcd

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

Diff for: src/ci/docker/host-x86_64/dist-various-1/Dockerfile

+8-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ RUN ./install-mipsel-musl.sh
5757
COPY host-x86_64/dist-various-1/install-aarch64-none-elf.sh /build
5858
RUN ./install-aarch64-none-elf.sh
5959

60+
COPY host-x86_64/dist-various-1/install-llvm-mingw.sh /build
61+
RUN ./install-llvm-mingw.sh
62+
6063
# Suppress some warnings in the openwrt toolchains we downloaded
6164
ENV STAGING_DIR=/tmp
6265

@@ -141,6 +144,8 @@ ENV TARGETS=$TARGETS,armv7r-none-eabi
141144
ENV TARGETS=$TARGETS,armv7r-none-eabihf
142145
ENV TARGETS=$TARGETS,thumbv7neon-unknown-linux-gnueabihf
143146
ENV TARGETS=$TARGETS,armv7a-none-eabi
147+
ENV TARGETS=$TARGETS,aarch64-pc-windows-gnullvm
148+
ENV TARGETS=$TARGETS,x86_64-pc-windows-gnullvm
144149

145150
# riscv targets currently do not need a C compiler, as compiler_builtins
146151
# doesn't currently have it enabled, and the riscv gcc compiler is not
@@ -170,7 +175,9 @@ ENV CFLAGS_armv5te_unknown_linux_musleabi="-march=armv5te -marm -mfloat-abi=soft
170175
CC_riscv32imc_unknown_none_elf=false \
171176
CC_riscv32imac_unknown_none_elf=false \
172177
CC_riscv64imac_unknown_none_elf=false \
173-
CC_riscv64gc_unknown_none_elf=false
178+
CC_riscv64gc_unknown_none_elf=false \
179+
CC_aarch64_pc_windows_gnullvm=aarch64-w64-mingw32-clang \
180+
CC_x86_64_pc_windows_gnullvm=x86_64-w64-mingw32-clang
174181

175182
ENV RUST_CONFIGURE_ARGS \
176183
--musl-root-armv5te=/musl-armv5te \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
curl -L https://github.com/mstorsjo/llvm-mingw/releases/download/20230614/llvm-mingw-20230614-ucrt-ubuntu-20.04-x86_64.tar.xz | \
6+
tar --extract --lzma --strip 1 --directory /usr/local

Diff for: src/doc/rustc/src/platform-support/pc-windows-gnullvm.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Target triples available so far:
1414

1515
## Requirements
1616

17-
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.
17+
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.
1818
Std support is expected to be on pair with `*-pc-windows-gnu`.
1919

2020
Binaries for this target should be at least on pair with `*-pc-windows-gnu` in terms of requirements and functionality.
@@ -25,15 +25,12 @@ Like with any other Windows target created binaries are in PE format.
2525

2626
## Building the target
2727

28-
For cross-compilation I recommend using [llvm-mingw](https://github.com/mstorsjo/llvm-mingw) toolchain, one change that seems necessary beside configuring cross compilers is disabling experimental `m86k` target. Otherwise LLVM build fails with `multiple definition ...` errors.
29-
Native bootstrapping builds require rather fragile hacks until host artifacts are available so I won't describe them here.
28+
For cross-compilation I recommend using [llvm-mingw](https://github.com/mstorsjo/llvm-mingw) toolchain, one change that seems necessary beside configuring cross-compilers is disabling experimental `m86k` target. Otherwise, LLVM build fails with `multiple definition ...` errors.
29+
Native bootstrapping builds require rather fragile hacks until host artifacts are available, so I won't describe them here.
3030

3131
## Building Rust programs
3232

33-
Rust does not yet ship pre-compiled artifacts for this target. To compile for
34-
this target, you will either need to build Rust with the target enabled (see
35-
"Building the target" above), or build your own copy of `core` by using
36-
`build-std` or similar.
33+
Rust does ship pre-compiled std library for those targets. That means one can cross-compile for those targets from other hosts.
3734

3835
## Testing
3936

0 commit comments

Comments
 (0)