Skip to content

{aarch64,x86_64}-pc-windows-gnullvm: build host tools #140772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions src/ci/docker/host-x86_64/dist-aarch64-windows-gnullvm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM ubuntu:24.04

WORKDIR /build

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
curl \
g++ \
git \
make \
ninja-build \
python3 \
xz-utils

ENV ARCH=aarch64
COPY host-x86_64/dist-x86_64-windows-gnullvm/install-llvm-mingw.sh /build
RUN ./install-llvm-mingw.sh

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV CC_aarch64_pc_windows_gnullvm=aarch64-w64-mingw32-clang \
CXX_aarch64_pc_windows_gnullvm=aarch64-w64-mingw32-clang++

ENV HOST=aarch64-pc-windows-gnullvm

# We are bootstrapping this target and cannot use previously built artifacts.
# Without this option Clang is given `"-I/checkout/obj/build/aarch64-pc-windows-gnullvm/ci-llvm/include"`
# despite no such directory existing:
# $ ls obj/dist-windows-gnullvm/build/aarch64-pc-windows-gnullvm/ -1
# llvm
# stage2
ENV NO_DOWNLOAD_CI_LLVM 1

ENV RUST_CONFIGURE_ARGS \
--enable-extended \
--enable-profiler \
--enable-sanitizers \
--disable-docs \
--set llvm.download-ci-llvm=false \
--set rust.llvm-tools=false
# LLVM cross tools are not installed into expected location so copying fails.
# Probably will solve itself once this target can host itself on Windows.
# --enable-full-tools \

ENV SCRIPT python3 ../x.py dist --host $HOST --target $HOST
8 changes: 1 addition & 7 deletions src/ci/docker/host-x86_64/dist-various-1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ 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,i686-pc-windows-gnullvm
ENV TARGETS=$TARGETS,x86_64-pc-windows-gnullvm

ENV CFLAGS_armv5te_unknown_linux_musleabi="-march=armv5te -marm -mfloat-abi=soft" \
CFLAGS_arm_unknown_linux_musleabi="-march=armv6 -marm" \
Expand Down Expand Up @@ -148,10 +145,7 @@ ENV CFLAGS_armv5te_unknown_linux_musleabi="-march=armv5te -marm -mfloat-abi=soft
CC_riscv64imac_unknown_none_elf=riscv64-unknown-elf-gcc \
CFLAGS_riscv64imac_unknown_none_elf=-march=rv64imac -mabi=lp64 \
CC_riscv64gc_unknown_none_elf=riscv64-unknown-elf-gcc \
CFLAGS_riscv64gc_unknown_none_elf=-march=rv64gc -mabi=lp64 \
CC_aarch64_pc_windows_gnullvm=aarch64-w64-mingw32-clang \
CC_i686_pc_windows_gnullvm=i686-w64-mingw32-clang \
CC_x86_64_pc_windows_gnullvm=x86_64-w64-mingw32-clang
CFLAGS_riscv64gc_unknown_none_elf=-march=rv64gc -mabi=lp64

ENV RUST_CONFIGURE_ARGS \
--musl-root-armv5te=/musl-armv5te \
Expand Down

This file was deleted.

50 changes: 50 additions & 0 deletions src/ci/docker/host-x86_64/dist-x86_64-windows-gnullvm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM ubuntu:24.04

WORKDIR /build

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
curl \
g++ \
git \
make \
ninja-build \
python3 \
xz-utils

ENV ARCH='i686 x86_64'
COPY host-x86_64/dist-x86_64-windows-gnullvm/install-llvm-mingw.sh /build
RUN ./install-llvm-mingw.sh

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV CC_i686_pc_windows_gnullvm=i686-w64-mingw32-clang \
CC_x86_64_pc_windows_gnullvm=x86_64-w64-mingw32-clang \
CXX_x86_64_pc_windows_gnullvm=x86_64-w64-mingw32-clang++

ENV HOST=x86_64-pc-windows-gnullvm
ENV TARGETS=i686-pc-windows-gnullvm,x86_64-pc-windows-gnullvm

# We are bootstrapping this target and cannot use previously built artifacts.
# Without this option Clang is given `"-I/checkout/obj/build/aarch64-pc-windows-gnullvm/ci-llvm/include"`
# despite no such directory existing:
# $ ls obj/dist-windows-gnullvm/build/aarch64-pc-windows-gnullvm/ -1
# llvm
# stage2
ENV NO_DOWNLOAD_CI_LLVM 1

ENV RUST_CONFIGURE_ARGS \
--enable-extended \
--enable-profiler \
--enable-sanitizers \
--disable-docs \
--set llvm.download-ci-llvm=false \
--set rust.llvm-tools=false
# LLVM cross tools are not installed into expected location so copying fails.
# Probably will solve itself once these targets can host themselves on Windows.
# --enable-full-tools \

ENV SCRIPT python3 ../x.py dist --host $HOST --target $TARGETS
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -ex

release_date=20250613
archive=llvm-mingw-${release_date}-ucrt-ubuntu-22.04-x86_64.tar.xz
curl -L https://github.com/mstorsjo/llvm-mingw/releases/download/${release_date}/${archive} | \
tar --extract --xz --strip 1 --directory /usr/local

# https://github.com/mstorsjo/llvm-mingw/issues/493
for arch in $ARCH; do
ln -s $arch-w64-windows-gnu.cfg /usr/local/bin/$arch-pc-windows-gnu.cfg
done
6 changes: 6 additions & 0 deletions src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ auto:
- name: dist-s390x-linux
<<: *job-linux-4c

- name: dist-aarch64-windows-gnullvm
<<: *job-linux-4c

- name: dist-x86_64-windows-gnullvm
<<: *job-linux-4c

- name: dist-various-1
<<: *job-linux-4c

Expand Down
4 changes: 2 additions & 2 deletions src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ so Rustup may install the documentation for a similar tier 1 target instead.

target | notes
-------|-------
[`aarch64-pc-windows-gnullvm`](platform-support/windows-gnullvm.md) | ARM64 MinGW (Windows 10+), LLVM ABI
[`aarch64-pc-windows-msvc`](platform-support/windows-msvc.md) | ARM64 Windows MSVC
`aarch64-unknown-linux-musl` | ARM64 Linux with musl 1.2.3
[`aarch64-unknown-linux-ohos`](platform-support/openharmony.md) | ARM64 OpenHarmony
Expand All @@ -105,6 +106,7 @@ target | notes
[`riscv64gc-unknown-linux-gnu`](platform-support/riscv64gc-unknown-linux-gnu.md) | RISC-V Linux (kernel 4.20+, glibc 2.29)
[`riscv64gc-unknown-linux-musl`](platform-support/riscv64gc-unknown-linux-musl.md) | RISC-V Linux (kernel 4.20+, musl 1.2.3)
[`s390x-unknown-linux-gnu`](platform-support/s390x-unknown-linux-gnu.md) | S390x Linux (kernel 3.2+, glibc 2.17)
[`x86_64-pc-windows-gnullvm`](platform-support/windows-gnullvm.md) | 64-bit x86 MinGW (Windows 10+), LLVM ABI
[`x86_64-unknown-freebsd`](platform-support/freebsd.md) | 64-bit x86 FreeBSD
[`x86_64-unknown-illumos`](platform-support/illumos.md) | illumos
`x86_64-unknown-linux-musl` | 64-bit Linux with musl 1.2.3
Expand Down Expand Up @@ -147,7 +149,6 @@ target | std | notes
[`aarch64-apple-ios-macabi`](platform-support/apple-ios-macabi.md) | ✓ | Mac Catalyst on ARM64
[`aarch64-apple-ios-sim`](platform-support/apple-ios.md) | ✓ | Apple iOS Simulator on ARM64
[`aarch64-linux-android`](platform-support/android.md) | ✓ | ARM64 Android
[`aarch64-pc-windows-gnullvm`](platform-support/windows-gnullvm.md) | ✓ | ARM64 MinGW (Windows 10+), LLVM ABI
[`aarch64-unknown-fuchsia`](platform-support/fuchsia.md) | ✓ | ARM64 Fuchsia
`aarch64-unknown-none` | * | Bare ARM64, hardfloat
`aarch64-unknown-none-softfloat` | * | Bare ARM64, softfloat
Expand Down Expand Up @@ -204,7 +205,6 @@ target | std | notes
[`x86_64-apple-ios-macabi`](platform-support/apple-ios-macabi.md) | ✓ | Mac Catalyst on x86_64
[`x86_64-fortanix-unknown-sgx`](platform-support/x86_64-fortanix-unknown-sgx.md) | ✓ | [Fortanix ABI] for 64-bit Intel SGX
[`x86_64-linux-android`](platform-support/android.md) | ✓ | 64-bit x86 Android
[`x86_64-pc-windows-gnullvm`](platform-support/windows-gnullvm.md) | ✓ | 64-bit x86 MinGW (Windows 10+), LLVM ABI
[`x86_64-unknown-fuchsia`](platform-support/fuchsia.md) | ✓ | 64-bit x86 Fuchsia
`x86_64-unknown-linux-gnux32` | ✓ | 64-bit Linux (x32 ABI) (kernel 4.15+, glibc 2.27)
[`x86_64-unknown-none`](platform-support/x86_64-unknown-none.md) | * | Freestanding/bare-metal x86_64, softfloat
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc/src/platform-support/windows-gnullvm.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# \*-windows-gnullvm

**Tier: 2 (without host tools)**
**Tier: 2 (with host tools)**

Windows targets similar to `*-windows-gnu` but using UCRT as the runtime and various LLVM tools/libraries instead of GCC/Binutils.

Expand Down