Skip to content

Commit 2c2bc10

Browse files
committed
{aarch64,x86_64}-pc-windows-gnullvm: build host tools
1 parent 45acf54 commit 2c2bc10

File tree

8 files changed

+121
-18
lines changed

8 files changed

+121
-18
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM ubuntu:24.04
2+
3+
WORKDIR /build
4+
5+
ARG DEBIAN_FRONTEND=noninteractive
6+
RUN apt-get update && apt-get install -y --no-install-recommends \
7+
ca-certificates \
8+
cmake \
9+
curl \
10+
g++ \
11+
git \
12+
make \
13+
ninja-build \
14+
python3 \
15+
xz-utils
16+
17+
ENV ARCH=aarch64
18+
COPY host-x86_64/dist-x86_64-windows-gnullvm/install-llvm-mingw.sh /build
19+
RUN ./install-llvm-mingw.sh
20+
21+
COPY scripts/sccache.sh /scripts/
22+
RUN sh /scripts/sccache.sh
23+
24+
ENV CC_aarch64_pc_windows_gnullvm=aarch64-w64-mingw32-clang \
25+
CXX_aarch64_pc_windows_gnullvm=aarch64-w64-mingw32-clang++
26+
27+
ENV HOST=aarch64-pc-windows-gnullvm
28+
29+
# We are bootstrapping this target and cannot use previously built artifacts.
30+
# Without this option Clang is given `"-I/checkout/obj/build/aarch64-pc-windows-gnullvm/ci-llvm/include"`
31+
# despite no such directory existing:
32+
# $ ls obj/dist-windows-gnullvm/build/aarch64-pc-windows-gnullvm/ -1
33+
# llvm
34+
# stage2
35+
ENV NO_DOWNLOAD_CI_LLVM 1
36+
37+
ENV RUST_CONFIGURE_ARGS \
38+
--enable-extended \
39+
--enable-profiler \
40+
--enable-sanitizers \
41+
--disable-docs \
42+
--set llvm.download-ci-llvm=false \
43+
--set rust.llvm-tools=false
44+
# LLVM cross tools are not installed into expected location so copying fails.
45+
# Probably will solve itself once this target can host itself on Windows.
46+
# --enable-full-tools \
47+
48+
ENV SCRIPT python3 ../x.py dist --host $HOST --target $HOST

src/ci/docker/host-x86_64/dist-various-1/Dockerfile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ ENV TARGETS=$TARGETS,armv7r-none-eabi
114114
ENV TARGETS=$TARGETS,armv7r-none-eabihf
115115
ENV TARGETS=$TARGETS,thumbv7neon-unknown-linux-gnueabihf
116116
ENV TARGETS=$TARGETS,armv7a-none-eabi
117-
ENV TARGETS=$TARGETS,aarch64-pc-windows-gnullvm
118-
ENV TARGETS=$TARGETS,i686-pc-windows-gnullvm
119-
ENV TARGETS=$TARGETS,x86_64-pc-windows-gnullvm
120117

121118
ENV CFLAGS_armv5te_unknown_linux_musleabi="-march=armv5te -marm -mfloat-abi=soft" \
122119
CFLAGS_arm_unknown_linux_musleabi="-march=armv6 -marm" \
@@ -148,10 +145,7 @@ ENV CFLAGS_armv5te_unknown_linux_musleabi="-march=armv5te -marm -mfloat-abi=soft
148145
CC_riscv64imac_unknown_none_elf=riscv64-unknown-elf-gcc \
149146
CFLAGS_riscv64imac_unknown_none_elf=-march=rv64imac -mabi=lp64 \
150147
CC_riscv64gc_unknown_none_elf=riscv64-unknown-elf-gcc \
151-
CFLAGS_riscv64gc_unknown_none_elf=-march=rv64gc -mabi=lp64 \
152-
CC_aarch64_pc_windows_gnullvm=aarch64-w64-mingw32-clang \
153-
CC_i686_pc_windows_gnullvm=i686-w64-mingw32-clang \
154-
CC_x86_64_pc_windows_gnullvm=x86_64-w64-mingw32-clang
148+
CFLAGS_riscv64gc_unknown_none_elf=-march=rv64gc -mabi=lp64
155149

156150
ENV RUST_CONFIGURE_ARGS \
157151
--musl-root-armv5te=/musl-armv5te \

src/ci/docker/host-x86_64/dist-various-1/install-llvm-mingw.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
FROM ubuntu:24.04
2+
3+
WORKDIR /build
4+
5+
ARG DEBIAN_FRONTEND=noninteractive
6+
RUN apt-get update && apt-get install -y --no-install-recommends \
7+
ca-certificates \
8+
cmake \
9+
curl \
10+
g++ \
11+
git \
12+
make \
13+
ninja-build \
14+
python3 \
15+
xz-utils
16+
17+
ENV ARCH='i686 x86_64'
18+
COPY host-x86_64/dist-x86_64-windows-gnullvm/install-llvm-mingw.sh /build
19+
RUN ./install-llvm-mingw.sh
20+
21+
COPY scripts/sccache.sh /scripts/
22+
RUN sh /scripts/sccache.sh
23+
24+
ENV CC_i686_pc_windows_gnullvm=i686-w64-mingw32-clang \
25+
CC_x86_64_pc_windows_gnullvm=x86_64-w64-mingw32-clang \
26+
CXX_x86_64_pc_windows_gnullvm=x86_64-w64-mingw32-clang++
27+
28+
ENV HOST=x86_64-pc-windows-gnullvm
29+
ENV TARGETS=i686-pc-windows-gnullvm,x86_64-pc-windows-gnullvm
30+
31+
# We are bootstrapping this target and cannot use previously built artifacts.
32+
# Without this option Clang is given `"-I/checkout/obj/build/aarch64-pc-windows-gnullvm/ci-llvm/include"`
33+
# despite no such directory existing:
34+
# $ ls obj/dist-windows-gnullvm/build/aarch64-pc-windows-gnullvm/ -1
35+
# llvm
36+
# stage2
37+
ENV NO_DOWNLOAD_CI_LLVM 1
38+
39+
ENV RUST_CONFIGURE_ARGS \
40+
--enable-extended \
41+
--enable-profiler \
42+
--enable-sanitizers \
43+
--disable-docs \
44+
--set llvm.download-ci-llvm=false \
45+
--set rust.llvm-tools=false
46+
# LLVM cross tools are not installed into expected location so copying fails.
47+
# Probably will solve itself once these targets can host themselves on Windows.
48+
# --enable-full-tools \
49+
50+
ENV SCRIPT python3 ../x.py dist --host $HOST --target $TARGETS
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
release_date=20250613
6+
archive=llvm-mingw-${release_date}-ucrt-ubuntu-22.04-x86_64.tar.xz
7+
curl -L https://github.com/mstorsjo/llvm-mingw/releases/download/${release_date}/${archive} | \
8+
tar --extract --xz --strip 1 --directory /usr/local
9+
10+
# https://github.com/mstorsjo/llvm-mingw/issues/493
11+
for arch in $ARCH; do
12+
ln -s $arch-w64-windows-gnu.cfg /usr/local/bin/$arch-pc-windows-gnu.cfg
13+
done

src/ci/github-actions/jobs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@ auto:
237237
- name: dist-s390x-linux
238238
<<: *job-linux-4c
239239

240+
- name: dist-aarch64-windows-gnullvm
241+
<<: *job-linux-4c
242+
243+
- name: dist-x86_64-windows-gnullvm
244+
<<: *job-linux-4c
245+
240246
- name: dist-various-1
241247
<<: *job-linux-4c
242248

src/doc/rustc/src/platform-support.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ so Rustup may install the documentation for a similar tier 1 target instead.
8888

8989
target | notes
9090
-------|-------
91+
[`aarch64-pc-windows-gnullvm`](platform-support/windows-gnullvm.md) | ARM64 MinGW (Windows 10+), LLVM ABI
9192
[`aarch64-pc-windows-msvc`](platform-support/windows-msvc.md) | ARM64 Windows MSVC
9293
`aarch64-unknown-linux-musl` | ARM64 Linux with musl 1.2.3
9394
[`aarch64-unknown-linux-ohos`](platform-support/openharmony.md) | ARM64 OpenHarmony
@@ -105,6 +106,7 @@ target | notes
105106
[`riscv64gc-unknown-linux-gnu`](platform-support/riscv64gc-unknown-linux-gnu.md) | RISC-V Linux (kernel 4.20+, glibc 2.29)
106107
[`riscv64gc-unknown-linux-musl`](platform-support/riscv64gc-unknown-linux-musl.md) | RISC-V Linux (kernel 4.20+, musl 1.2.3)
107108
[`s390x-unknown-linux-gnu`](platform-support/s390x-unknown-linux-gnu.md) | S390x Linux (kernel 3.2+, glibc 2.17)
109+
[`x86_64-pc-windows-gnullvm`](platform-support/windows-gnullvm.md) | 64-bit x86 MinGW (Windows 10+), LLVM ABI
108110
[`x86_64-unknown-freebsd`](platform-support/freebsd.md) | 64-bit x86 FreeBSD
109111
[`x86_64-unknown-illumos`](platform-support/illumos.md) | illumos
110112
`x86_64-unknown-linux-musl` | 64-bit Linux with musl 1.2.3
@@ -147,7 +149,6 @@ target | std | notes
147149
[`aarch64-apple-ios-macabi`](platform-support/apple-ios-macabi.md) | ✓ | Mac Catalyst on ARM64
148150
[`aarch64-apple-ios-sim`](platform-support/apple-ios.md) | ✓ | Apple iOS Simulator on ARM64
149151
[`aarch64-linux-android`](platform-support/android.md) | ✓ | ARM64 Android
150-
[`aarch64-pc-windows-gnullvm`](platform-support/windows-gnullvm.md) | ✓ | ARM64 MinGW (Windows 10+), LLVM ABI
151152
[`aarch64-unknown-fuchsia`](platform-support/fuchsia.md) | ✓ | ARM64 Fuchsia
152153
`aarch64-unknown-none` | * | Bare ARM64, hardfloat
153154
`aarch64-unknown-none-softfloat` | * | Bare ARM64, softfloat
@@ -204,7 +205,6 @@ target | std | notes
204205
[`x86_64-apple-ios-macabi`](platform-support/apple-ios-macabi.md) | ✓ | Mac Catalyst on x86_64
205206
[`x86_64-fortanix-unknown-sgx`](platform-support/x86_64-fortanix-unknown-sgx.md) | ✓ | [Fortanix ABI] for 64-bit Intel SGX
206207
[`x86_64-linux-android`](platform-support/android.md) | ✓ | 64-bit x86 Android
207-
[`x86_64-pc-windows-gnullvm`](platform-support/windows-gnullvm.md) | ✓ | 64-bit x86 MinGW (Windows 10+), LLVM ABI
208208
[`x86_64-unknown-fuchsia`](platform-support/fuchsia.md) | ✓ | 64-bit x86 Fuchsia
209209
`x86_64-unknown-linux-gnux32` | ✓ | 64-bit Linux (x32 ABI) (kernel 4.15+, glibc 2.27)
210210
[`x86_64-unknown-none`](platform-support/x86_64-unknown-none.md) | * | Freestanding/bare-metal x86_64, softfloat

src/doc/rustc/src/platform-support/windows-gnullvm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# \*-windows-gnullvm
22

3-
**Tier: 2 (without host tools)**
3+
**Tier: 2 (with host tools)**
44

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

0 commit comments

Comments
 (0)