fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

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