]> git.proxmox.com Git - rustc.git/blob - src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / ci / docker / host-x86_64 / dist-x86_64-musl / Dockerfile
1 FROM ubuntu:16.04
2
3 RUN apt-get update && apt-get install -y --no-install-recommends \
4 g++ \
5 make \
6 ninja-build \
7 file \
8 wget \
9 curl \
10 ca-certificates \
11 python3 \
12 git \
13 cmake \
14 xz-utils \
15 sudo \
16 gdb \
17 patch \
18 libssl-dev \
19 pkg-config
20
21 WORKDIR /build/
22
23 # Build cmake before musl toolchain, as we replace the compiler during that step.
24 COPY scripts/cmake.sh /scripts/
25 RUN /scripts/cmake.sh
26
27 COPY scripts/musl-toolchain.sh /build/
28 # We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
29 RUN CFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
30 CXXFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
31 REPLACE_CC=1 bash musl-toolchain.sh x86_64 && rm -rf build
32
33 COPY scripts/sccache.sh /scripts/
34 RUN sh /scripts/sccache.sh
35
36 ENV HOSTS=x86_64-unknown-linux-musl
37
38 ENV RUST_CONFIGURE_ARGS \
39 --musl-root-x86_64=/usr/local/x86_64-linux-musl \
40 --enable-extended \
41 --enable-profiler \
42 --enable-lld \
43 --set target.x86_64-unknown-linux-musl.crt-static=false \
44 --build $HOSTS
45
46 # Newer binutils broke things on some vms/distros (i.e., linking against
47 # unknown relocs disabled by the following flag), so we need to go out of our
48 # way to produce "super compatible" binaries.
49 #
50 # See: https://github.com/rust-lang/rust/issues/34978
51 # And: https://github.com/rust-lang/rust/issues/59411
52 ENV CFLAGS_x86_64_unknown_linux_musl="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none \
53 -Wl,--compress-debug-sections=none"
54
55 # To run native tests replace `dist` below with `test`
56 ENV SCRIPT python3 ../x.py dist --build $HOSTS