Skip to content

Commit a8a847e

Browse files
committed
Auto merge of #102530 - cuviper:upgrade-i586-gnu, r=pietroalbini
Upgrade dist-i586-gnu-i586-i686-musl to ubuntu:22.04 The system GCC 5 in ubuntu:16.04 will be too old to compile LLVM 16, so we need an upgrade. To avoid raising the minimum glibc requirements for `i586-unknown-linux-gnu`, this target is converted to a crosstool-ng toolchain, *relaxing* it to the same Linux 3.2 / glibc 2.17 minimum we use elsewhere. The musl targets still use Ubuntu's system toolchain, but this doesn't have the same compatibility concerns.
2 parents 39323a5 + cd1a369 commit a8a847e

File tree

5 files changed

+798
-7
lines changed

5 files changed

+798
-7
lines changed

src/ci/docker/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,22 @@ For targets: `aarch64-unknown-linux-gnu`
230230
- C compiler > gcc version = 8.3.0
231231
- C compiler > C++ = ENABLE -- to cross compile LLVM
232232
233+
### `i586-linux-gnu.config`
234+
235+
For targets: `i586-unknown-linux-gnu`
236+
237+
- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
238+
- Path and misc options > Patches origin = Bundled only
239+
- Target options > Target Architecture = x86
240+
- Target options > Architecture level = i586
241+
- Target options > Target CFLAGS = -Wa,-mrelax-relocations=no
242+
- Operating System > Target OS = linux
243+
- Operating System > Linux kernel version = 3.2.101
244+
- Binary utilities > Version of binutils = 2.32
245+
- C-library > glibc version = 2.17.0
246+
- C compiler > gcc version = 8.3.0
247+
- C compiler > C++ = ENABLE
248+
233249
### `powerpc-linux-gnu.config`
234250
235251
For targets: `powerpc-unknown-linux-gnu`

src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/Dockerfile

+29-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
FROM ubuntu:16.04
1+
FROM ubuntu:22.04
22

3+
ARG DEBIAN_FRONTEND=noninteractive
34
RUN apt-get update && apt-get install -y --no-install-recommends \
45
g++-multilib \
56
make \
@@ -17,6 +18,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1718
libssl-dev \
1819
pkg-config
1920

21+
COPY scripts/cross-apt-packages.sh /scripts/
22+
RUN sh /scripts/cross-apt-packages.sh
23+
24+
COPY scripts/crosstool-ng-1.24.sh /scripts/
25+
RUN sh /scripts/crosstool-ng-1.24.sh
26+
27+
COPY scripts/rustbuild-setup.sh /scripts/
28+
RUN sh /scripts/rustbuild-setup.sh
29+
WORKDIR /tmp
30+
31+
COPY host-x86_64/dist-i586-gnu-i586-i686-musl/i586-linux-gnu.config \
32+
host-x86_64/dist-i586-gnu-i586-i686-musl/build-i586-gnu-toolchain.sh \
33+
/tmp/
34+
RUN su rustbuild -c ./build-i586-gnu-toolchain.sh
35+
ENV PATH=$PATH:/x-tools/i586-unknown-linux-gnu/bin
36+
ENV \
37+
CC_i586_unknown_linux_gnu=i586-unknown-linux-gnu-gcc \
38+
AR_i586_unknown_linux_gnu=i586-unknown-linux-gnu-ar
39+
2040
WORKDIR /build/
2141
COPY scripts/musl.sh /build/
2242
RUN CC=gcc CFLAGS="-m32 -Wa,-mrelax-relocations=no" \
@@ -27,17 +47,20 @@ RUN CC=gcc CFLAGS="-m32 -Wa,-mrelax-relocations=no" \
2747
bash musl.sh i586 --target=i586 && \
2848
rm -rf /build
2949

50+
# FIXME: musl really shouldn't be linking libgcc_s.so, as it's linked to glibc,
51+
# but it's required by src/test/ui/proc-macro/crt-static.rs. Ubuntu:16.04 gcc-5
52+
# had libgcc_s.so as a symlink to the absolute libgcc_s.so.1, but now it's an
53+
# ld-script that expects to find libgcc_s.so.1 in the library search path.
54+
# See also https://github.com/rust-lang/rust/issues/82521
55+
RUN ln -s /usr/lib32/libgcc_s.so.1 /musl-i686/lib/
56+
3057
COPY scripts/sccache.sh /scripts/
3158
RUN sh /scripts/sccache.sh
3259

33-
COPY scripts/cmake.sh /scripts/
34-
RUN /scripts/cmake.sh
35-
3660
ENV RUST_CONFIGURE_ARGS \
3761
--musl-root-i586=/musl-i586 \
3862
--musl-root-i686=/musl-i686 \
39-
--disable-docs \
40-
--set llvm.allow-old-toolchain
63+
--disable-docs
4164

4265
# Newer binutils broke things on some vms/distros (i.e., linking against
4366
# unknown relocs disabled by the following flag), so we need to go out of our
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
hide_output() {
5+
set +x
6+
on_err="
7+
echo ERROR: An error was encountered with the build.
8+
cat /tmp/build.log
9+
exit 1
10+
"
11+
trap "$on_err" ERR
12+
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
13+
PING_LOOP_PID=$!
14+
"$@" &> /tmp/build.log
15+
rm /tmp/build.log
16+
trap - ERR
17+
kill $PING_LOOP_PID
18+
set -x
19+
}
20+
21+
mkdir build
22+
cd build
23+
cp ../i586-linux-gnu.config .config
24+
hide_output ct-ng build
25+
cd ..
26+
rm -rf build

0 commit comments

Comments
 (0)