Skip to content

Commit 023521e

Browse files
committed
Auto merge of #133809 - mrkajetanp:ci-aarch64-dist, r=Kobzol
ci: Move dist-aarch64-linux to an aarch64 runner Move the dist-aarch64-linux CI job to an aarch64 runner instead of cross-compiling it from an x86 one. This will make it possible to perform optimisations such as LTO, PGO and BOLT later on. r? `@Kobzol` try-job: dist-aarch64-linux try-job: dist-x86_64-linux try-job: dist-i686-linux
2 parents c434b4b + 3afda7e commit 023521e

File tree

16 files changed

+129
-99
lines changed

16 files changed

+129
-99
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# We document platform support for minimum glibc 2.17 and kernel 3.2.
2+
# CentOS 7 has headers for kernel 3.10, but that's fine as long as we don't
3+
# actually use newer APIs in rustc or std without a fallback. It's more
4+
# important that we match glibc for ELF symbol versioning.
5+
FROM centos:7
6+
7+
WORKDIR /build
8+
9+
# CentOS 7 EOL is June 30, 2024, but the repos remain in the vault.
10+
RUN sed -i /etc/yum.repos.d/*.repo -e 's!^mirrorlist!#mirrorlist!' \
11+
-e 's!^#baseurl=http://mirror.centos.org/!baseurl=https://vault.centos.org/!'
12+
RUN sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
13+
14+
RUN yum upgrade -y && \
15+
yum install -y \
16+
automake \
17+
bzip2 \
18+
file \
19+
gcc \
20+
gcc-c++ \
21+
git \
22+
glibc-devel \
23+
libedit-devel \
24+
libstdc++-devel \
25+
make \
26+
ncurses-devel \
27+
openssl-devel \
28+
patch \
29+
perl \
30+
perl-core \
31+
pkgconfig \
32+
python3 \
33+
unzip \
34+
wget \
35+
xz \
36+
zlib-devel \
37+
&& yum clean all
38+
39+
RUN mkdir -p /rustroot/bin
40+
41+
ENV PATH=/rustroot/bin:$PATH
42+
ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
43+
ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
44+
WORKDIR /tmp
45+
RUN mkdir /home/user
46+
COPY scripts/shared.sh /tmp/
47+
48+
# Need at least GCC 5.1 to compile LLVM
49+
COPY scripts/build-gcc.sh /tmp/
50+
RUN ./build-gcc.sh && yum remove -y gcc gcc-c++
51+
52+
ENV CC=gcc CXX=g++
53+
54+
# LLVM 17 needs cmake 3.20 or higher.
55+
COPY scripts/cmake.sh /tmp/
56+
RUN ./cmake.sh
57+
58+
# Build LLVM+Clang
59+
COPY scripts/build-clang.sh /tmp/
60+
ENV LLVM_BUILD_TARGETS=AArch64
61+
RUN ./build-clang.sh
62+
ENV CC=clang CXX=clang++
63+
64+
# Build zstd to enable `llvm.libzstd`.
65+
COPY scripts/build-zstd.sh /tmp/
66+
RUN ./build-zstd.sh
67+
68+
COPY scripts/sccache.sh /scripts/
69+
RUN sh /scripts/sccache.sh
70+
71+
ENV PGO_HOST=aarch64-unknown-linux-gnu
72+
ENV HOSTS=aarch64-unknown-linux-gnu
73+
74+
ENV CPATH=/usr/include/aarch64-linux-gnu/:$CPATH
75+
76+
ENV RUST_CONFIGURE_ARGS \
77+
--build=aarch64-unknown-linux-gnu \
78+
--enable-full-tools \
79+
--enable-profiler \
80+
--enable-sanitizers \
81+
--enable-compiler-docs \
82+
--set target.aarch64-unknown-linux-gnu.linker=clang \
83+
--set target.aarch64-unknown-linux-gnu.ar=/rustroot/bin/llvm-ar \
84+
--set target.aarch64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \
85+
--set llvm.link-shared=true \
86+
--set llvm.thin-lto=true \
87+
--set llvm.libzstd=true \
88+
--set llvm.ninja=false \
89+
--set rust.debug-assertions=false \
90+
--set rust.jemalloc \
91+
--set rust.use-lld=true \
92+
--set rust.codegen-units=1
93+
94+
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
95+
96+
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=clang
97+
ENV DIST_SRC 1
98+
ENV LIBCURL_NO_PKG_CONFIG 1
99+
ENV DIST_REQUIRE_ALL_TOOLS 1

src/ci/docker/host-x86_64/dist-aarch64-linux/Dockerfile

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/ci/docker/host-x86_64/dist-aarch64-linux/aarch64-linux-gnu.defconfig

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,20 @@ ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
4646
ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
4747
WORKDIR /tmp
4848
RUN mkdir /home/user
49-
COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
49+
COPY scripts/shared.sh /tmp/
5050

5151
# Need at least GCC 5.1 to compile LLVM nowadays
52-
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
52+
COPY scripts/build-gcc.sh /tmp/
53+
ENV GCC_BUILD_TARGET=i686
5354
RUN ./build-gcc.sh && yum remove -y gcc gcc-c++
5455

5556
COPY scripts/cmake.sh /tmp/
5657
RUN ./cmake.sh
5758

5859
# Now build LLVM+Clang, afterwards configuring further compilations to use the
5960
# clang/clang++ compilers.
60-
COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
61+
COPY scripts/build-clang.sh /tmp/
62+
ENV LLVM_BUILD_TARGETS=X86
6163
RUN ./build-clang.sh
6264
ENV CC=clang CXX=clang++
6365

src/ci/docker/host-x86_64/dist-powerpc64le-linux/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN /scripts/crosstool-ng-build.sh
1818
WORKDIR /build
1919

2020
RUN apt-get install -y --no-install-recommends rpm2cpio cpio
21-
COPY host-x86_64/dist-powerpc64le-linux/shared.sh host-x86_64/dist-powerpc64le-linux/build-powerpc64le-toolchain.sh /build/
21+
COPY scripts/shared.sh host-x86_64/dist-powerpc64le-linux/build-powerpc64le-toolchain.sh /build/
2222
RUN ./build-powerpc64le-toolchain.sh
2323

2424
COPY scripts/sccache.sh /scripts/

src/ci/docker/host-x86_64/dist-powerpc64le-linux/shared.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
4646
ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
4747
WORKDIR /tmp
4848
RUN mkdir /home/user
49-
COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
49+
COPY scripts/shared.sh /tmp/
5050

5151
# Need at least GCC 5.1 to compile LLVM nowadays
52-
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
52+
COPY scripts/build-gcc.sh /tmp/
5353
RUN ./build-gcc.sh && yum remove -y gcc gcc-c++
5454

5555
# LLVM 17 needs cmake 3.20 or higher.
@@ -58,12 +58,13 @@ RUN ./cmake.sh
5858

5959
# Now build LLVM+Clang, afterwards configuring further compilations to use the
6060
# clang/clang++ compilers.
61-
COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
61+
COPY scripts/build-clang.sh /tmp/
62+
ENV LLVM_BUILD_TARGETS=X86
6263
RUN ./build-clang.sh
6364
ENV CC=clang CXX=clang++
6465

6566
# Build zstd to enable `llvm.libzstd`.
66-
COPY host-x86_64/dist-x86_64-linux/build-zstd.sh /tmp/
67+
COPY scripts/build-zstd.sh /tmp/
6768
RUN ./build-zstd.sh
6869

6970
COPY scripts/sccache.sh /scripts/

src/ci/docker/host-x86_64/dist-x86_64-linux/shared.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ ENV RUST_CONFIGURE_ARGS \
5454
--set rust.randomize-layout=true \
5555
--set rust.thin-lto-import-instr-limit=10
5656

57-
COPY host-x86_64/dist-x86_64-linux/shared.sh /scripts/
58-
COPY host-x86_64/dist-x86_64-linux/build-gccjit.sh /scripts/
57+
COPY scripts/shared.sh /scripts/
58+
COPY scripts/build-gccjit.sh /scripts/
5959

6060
RUN /scripts/build-gccjit.sh /scripts
6161

src/ci/docker/host-x86_64/x86_64-gnu-llvm-19/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ ENV RUST_CONFIGURE_ARGS \
5454
--set rust.randomize-layout=true \
5555
--set rust.thin-lto-import-instr-limit=10
5656

57-
COPY host-x86_64/dist-x86_64-linux/shared.sh /scripts/
58-
COPY host-x86_64/dist-x86_64-linux/build-gccjit.sh /scripts/
57+
COPY scripts/shared.sh /scripts/
58+
COPY scripts/build-gccjit.sh /scripts/
5959

6060
RUN /scripts/build-gccjit.sh /scripts
6161

0 commit comments

Comments
 (0)