Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d1d8e38

Browse files
committed
Auto merge of #140772 - mati865:gnullvm-host, r=Kobzol
{aarch64,x86_64}-pc-windows-gnullvm: build host tools This is a temporary single-release workflow to create stage0 for these targets. I opted for bootstrapping from Linux because that's the easiest host system to work with, but once this hits beta, having dedicated Windows runners would be sensible and probably preferable. `--enable-full-tools` for whatever reason doesn't seem to work when cross-compiling, because LLVM tools for the new hosts are not copied into the expected directory. rust-lang/compiler-team#877
2 parents 044514e + d577b39 commit d1d8e38

File tree

8 files changed

+121
-21
lines changed

8 files changed

+121
-21
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 & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ RUN ./install-riscv64-none-elf.sh
5555
COPY host-x86_64/dist-various-1/install-riscv32-none-elf.sh /build
5656
RUN ./install-riscv32-none-elf.sh
5757

58-
COPY host-x86_64/dist-various-1/install-llvm-mingw.sh /build
59-
RUN ./install-llvm-mingw.sh
60-
6158
# Suppress some warnings in the openwrt toolchains we downloaded
6259
ENV STAGING_DIR=/tmp
6360

@@ -114,9 +111,6 @@ ENV TARGETS=$TARGETS,armv7r-none-eabi
114111
ENV TARGETS=$TARGETS,armv7r-none-eabihf
115112
ENV TARGETS=$TARGETS,thumbv7neon-unknown-linux-gnueabihf
116113
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
120114

121115
ENV CFLAGS_armv5te_unknown_linux_musleabi="-march=armv5te -marm -mfloat-abi=soft" \
122116
CFLAGS_arm_unknown_linux_musleabi="-march=armv6 -marm" \
@@ -148,10 +142,7 @@ ENV CFLAGS_armv5te_unknown_linux_musleabi="-march=armv5te -marm -mfloat-abi=soft
148142
CC_riscv64imac_unknown_none_elf=riscv64-unknown-elf-gcc \
149143
CFLAGS_riscv64imac_unknown_none_elf=-march=rv64imac -mabi=lp64 \
150144
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
145+
CFLAGS_riscv64gc_unknown_none_elf=-march=rv64gc -mabi=lp64
155146

156147
ENV RUST_CONFIGURE_ARGS \
157148
--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)

AltStyle によって変換されたページ (->オリジナル) /