]> git.lizzy.rs Git - rust.git/blob - src/ci/docker/host-x86_64/dist-i586-gnu-i586-i686-musl/Dockerfile
Rollup merge of #74872 - JohnTitor:ping-risc-v, r=Mark-Simulacrum
[rust.git] / src / ci / docker / host-x86_64 / dist-i586-gnu-i586-i686-musl / Dockerfile
1 FROM ubuntu:16.04
2
3 RUN apt-get update && apt-get install -y --no-install-recommends \
4   g++-multilib \
5   make \
6   file \
7   curl \
8   ca-certificates \
9   python3 \
10   git \
11   cmake \
12   xz-utils \
13   sudo \
14   gdb \
15   patch \
16   libssl-dev \
17   pkg-config
18
19 WORKDIR /build/
20 COPY scripts/musl.sh /build/
21 RUN CC=gcc CFLAGS="-m32 -Wa,-mrelax-relocations=no" \
22     CXX=g++ CXXFLAGS="-m32 -Wa,-mrelax-relocations=no" \
23     bash musl.sh i686 --target=i686 && \
24     CC=gcc CFLAGS="-march=pentium -m32 -Wa,-mrelax-relocations=no" \
25     CXX=g++ CXXFLAGS="-march=pentium -m32 -Wa,-mrelax-relocations=no" \
26     bash musl.sh i586 --target=i586 && \
27     rm -rf /build
28
29 COPY scripts/sccache.sh /scripts/
30 RUN sh /scripts/sccache.sh
31
32 ENV RUST_CONFIGURE_ARGS \
33       --musl-root-i586=/musl-i586 \
34       --musl-root-i686=/musl-i686 \
35       --disable-docs
36
37 # Newer binutils broke things on some vms/distros (i.e., linking against
38 # unknown relocs disabled by the following flag), so we need to go out of our
39 # way to produce "super compatible" binaries.
40 #
41 # See: https://github.com/rust-lang/rust/issues/34978
42 ENV CFLAGS_i686_unknown_linux_musl=-Wa,-mrelax-relocations=no
43 ENV CFLAGS_i586_unknown_linux_gnu=-Wa,-mrelax-relocations=no
44 ENV CFLAGS_i586_unknown_linux_musl=-Wa,-mrelax-relocations=no
45
46 ENV TARGETS=i586-unknown-linux-gnu,i686-unknown-linux-musl
47
48 ENV SCRIPT \
49       python3 ../x.py --stage 2 test --target $TARGETS && \
50       python3 ../x.py dist --target $TARGETS,i586-unknown-linux-musl