Skip to content

Commit

Permalink
Provide prebuilt std for gnullvm targets
Browse files Browse the repository at this point in the history
  • Loading branch information
mati865 committed Aug 1, 2023
1 parent b3df56a commit 5396bcd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
9 changes: 8 additions & 1 deletion src/ci/docker/host-x86_64/dist-various-1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ RUN ./install-mipsel-musl.sh
COPY host-x86_64/dist-various-1/install-aarch64-none-elf.sh /build
RUN ./install-aarch64-none-elf.sh

COPY host-x86_64/dist-various-1/install-llvm-mingw.sh /build
RUN ./install-llvm-mingw.sh

# Suppress some warnings in the openwrt toolchains we downloaded
ENV STAGING_DIR=/tmp

Expand Down Expand Up @@ -141,6 +144,8 @@ ENV TARGETS=$TARGETS,armv7r-none-eabi
ENV TARGETS=$TARGETS,armv7r-none-eabihf
ENV TARGETS=$TARGETS,thumbv7neon-unknown-linux-gnueabihf
ENV TARGETS=$TARGETS,armv7a-none-eabi
ENV TARGETS=$TARGETS,aarch64-pc-windows-gnullvm
ENV TARGETS=$TARGETS,x86_64-pc-windows-gnullvm

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

ENV RUST_CONFIGURE_ARGS \
--musl-root-armv5te=/musl-armv5te \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -ex

curl -L https://github.com/mstorsjo/llvm-mingw/releases/download/20230614/llvm-mingw-20230614-ucrt-ubuntu-20.04-x86_64.tar.xz | \
tar --extract --lzma --strip 1 --directory /usr/local
11 changes: 4 additions & 7 deletions src/doc/rustc/src/platform-support/pc-windows-gnullvm.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Target triples available so far:

## Requirements

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.
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.
Expand All @@ -25,15 +25,12 @@ Like with any other Windows target created binaries are in PE format.

## Building the target

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.
Native bootstrapping builds require rather fragile hacks until host artifacts are available so I won't describe them here.
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.
Native bootstrapping builds require rather fragile hacks until host artifacts are available, so I won't describe them here.

## Building Rust programs

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

## Testing

Expand Down

0 comments on commit 5396bcd

Please sign in to comment.