Skip to content

Commit e70386e

Browse files
Auto merge of #140772 - mati865:gnullvm-host, r=<try>
{aarch64,x86_64}-*-windows-gnullvm: build host tools This will require MCP, but I suppose we need to know how long it takes to build first. 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. And WiX that bootstrap relies upon to create .msi installers only supports Windows. I haven't tried, but it might be usable via Wine. Almost every commit is self-contained, so let me know if I should split them into separate PRs. try-job: dist-aarch64-windows-gnullvm try-job: dist-x86_64-windows-gnullvm
2 parents fe5c95d + cacda77 commit e70386e

File tree

7 files changed

+127
-15
lines changed

7 files changed

+127
-15
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
FROM ubuntu:22.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+
COPY host-x86_64/dist-aarch64-windows-gnullvm/install-llvm-mingw.sh /build
18+
RUN ./install-llvm-mingw.sh
19+
20+
COPY scripts/sccache.sh /scripts/
21+
RUN sh /scripts/sccache.sh
22+
23+
ENV CC_aarch64_pc_windows_gnullvm=aarch64-w64-mingw32-clang \
24+
CXX_aarch64_pc_windows_gnullvm=aarch64-w64-mingw32-clang++
25+
26+
ENV HOST=aarch64-pc-windows-gnullvm
27+
28+
# We are bootstrapping this target and cannot use previously built artifacts.
29+
# Without this option Clang is given `"-I/checkout/obj/build/aarch64-pc-windows-gnullvm/ci-llvm/include"`
30+
# despite no such directory existing:
31+
# ❯ ls obj/dist-windows-gnullvm/build/aarch64-pc-windows-gnullvm/ -1
32+
#  llvm
33+
#  stage2
34+
ENV NO_DOWNLOAD_CI_LLVM 1
35+
36+
ENV RUST_CONFIGURE_ARGS \
37+
--enable-extended \
38+
--enable-profiler \
39+
--enable-sanitizers \
40+
--disable-docs \
41+
--set llvm.download-ci-llvm=false \
42+
--set rust.llvm-tools=false
43+
# LLVM cross tools are not installed into expected location so copying fails.
44+
# Probably will solve itself when building from Windows.
45+
# --enable-full-tools \
46+
47+
ENV SCRIPT python3 ../x.py dist --host $HOST --target $HOST
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
release_date=20250430
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+
ln -s aarch64-w64-windows-gnu.cfg /usr/local/bin/aarch64-pc-windows-gnu.cfg

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: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM ubuntu:22.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+
COPY host-x86_64/dist-x86_64-windows-gnullvm/install-llvm-mingw.sh /build
18+
RUN ./install-llvm-mingw.sh
19+
20+
COPY scripts/sccache.sh /scripts/
21+
RUN sh /scripts/sccache.sh
22+
23+
ENV CC_i686_pc_windows_gnullvm=i686-w64-mingw32-clang \
24+
CC_x86_64_pc_windows_gnullvm=x86_64-w64-mingw32-clang \
25+
CXX_x86_64_pc_windows_gnullvm=x86_64-w64-mingw32-clang++
26+
27+
ENV HOST=x86_64-pc-windows-gnullvm
28+
ENV TARGETS=i686-pc-windows-gnullvm,x86_64-pc-windows-gnullvm
29+
30+
# We are bootstrapping this target and cannot use previously built artifacts.
31+
# Without this option Clang is given `"-I/checkout/obj/build/aarch64-pc-windows-gnullvm/ci-llvm/include"`
32+
# despite no such directory existing:
33+
# ❯ ls obj/dist-windows-gnullvm/build/aarch64-pc-windows-gnullvm/ -1
34+
#  llvm
35+
#  stage2
36+
ENV NO_DOWNLOAD_CI_LLVM 1
37+
38+
ENV RUST_CONFIGURE_ARGS \
39+
--enable-extended \
40+
--enable-profiler \
41+
--enable-sanitizers \
42+
--disable-docs \
43+
--set llvm.download-ci-llvm=false \
44+
--set rust.llvm-tools=false
45+
# LLVM cross tools are not installed into expected location so copying fails.
46+
# Probably will solve itself when building from Windows.
47+
# --enable-full-tools \
48+
49+
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=20250528
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 i686 x86_64; 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

0 commit comments

Comments
 (0)