Skip to content

Upgrade dist-i586-gnu-i586-i686-musl to ubuntu:22.04 #102530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/ci/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,22 @@ For targets: `aarch64-unknown-linux-gnu`
- C compiler > gcc version = 8.3.0
- C compiler > C++ = ENABLE -- to cross compile LLVM

### `i586-linux-gnu.config`

For targets: `i586-unknown-linux-gnu`

- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
- Path and misc options > Patches origin = Bundled only
- Target options > Target Architecture = x86
- Target options > Architecture level = i586
- Target options > Target CFLAGS = -Wa,-mrelax-relocations=no
- Operating System > Target OS = linux
- Operating System > Linux kernel version = 3.2.101
- Binary utilities > Version of binutils = 2.32
- C-library > glibc version = 2.17.0
- C compiler > gcc version = 8.3.0
- C compiler > C++ = ENABLE

### `powerpc-linux-gnu.config`

For targets: `powerpc-unknown-linux-gnu`
Expand Down
35 changes: 29 additions & 6 deletions src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM ubuntu:16.04
FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
g++-multilib \
make \
Expand All @@ -17,6 +18,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libssl-dev \
pkg-config

COPY scripts/cross-apt-packages.sh /scripts/
RUN sh /scripts/cross-apt-packages.sh

COPY scripts/crosstool-ng-1.24.sh /scripts/
RUN sh /scripts/crosstool-ng-1.24.sh

COPY scripts/rustbuild-setup.sh /scripts/
RUN sh /scripts/rustbuild-setup.sh
WORKDIR /tmp

COPY host-x86_64/dist-i586-gnu-i586-i686-musl/i586-linux-gnu.config \
host-x86_64/dist-i586-gnu-i586-i686-musl/build-i586-gnu-toolchain.sh \
/tmp/
RUN su rustbuild -c ./build-i586-gnu-toolchain.sh
ENV PATH=$PATH:/x-tools/i586-unknown-linux-gnu/bin
ENV \
CC_i586_unknown_linux_gnu=i586-unknown-linux-gnu-gcc \
AR_i586_unknown_linux_gnu=i586-unknown-linux-gnu-ar

WORKDIR /build/
COPY scripts/musl.sh /build/
RUN CC=gcc CFLAGS="-m32 -Wa,-mrelax-relocations=no" \
Expand All @@ -27,17 +47,20 @@ RUN CC=gcc CFLAGS="-m32 -Wa,-mrelax-relocations=no" \
bash musl.sh i586 --target=i586 && \
rm -rf /build

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

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh

ENV RUST_CONFIGURE_ARGS \
--musl-root-i586=/musl-i586 \
--musl-root-i686=/musl-i686 \
--disable-docs \
--set llvm.allow-old-toolchain
--disable-docs

# Newer binutils broke things on some vms/distros (i.e., linking against
# unknown relocs disabled by the following flag), so we need to go out of our
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -ex

hide_output() {
set +x
on_err="
echo ERROR: An error was encountered with the build.
cat /tmp/build.log
exit 1
"
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
"$@" &> /tmp/build.log
rm /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
set -x
}

mkdir build
cd build
cp ../i586-linux-gnu.config .config
hide_output ct-ng build
cd ..
rm -rf build
Loading