fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.6 KiB56 linesraw
1FROM ubuntu:22.04
2
3ARG DEBIAN_FRONTEND=noninteractive
4RUN apt-get update && apt-get install -y --no-install-recommends \
5  g++ \
6  make \
7  ninja-build \
8  file \
9  wget \
10  curl \
11  ca-certificates \
12  python3 \
13  git \
14  cmake \
15  bzip2 \
16  xz-utils \
17  sudo \
18  gdb \
19  patch \
20  libssl-dev \
21  pkg-config \
22  && rm -rf /var/lib/apt/lists/*
23
24WORKDIR /build/
25
26COPY scripts/musl-toolchain.sh /build/
27# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
28RUN CFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
29    CXXFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
30    REPLACE_CC=1 bash musl-toolchain.sh x86_64 && rm -rf build
31
32COPY scripts/sccache.sh /scripts/
33RUN sh /scripts/sccache.sh
34
35ENV HOSTS=x86_64-unknown-linux-musl
36
37ENV RUST_CONFIGURE_ARGS \
38      --musl-root-x86_64=/usr/local/x86_64-linux-musl \
39      --enable-extended \
40      --enable-sanitizers \
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
52ENV 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`
56ENV SCRIPT python3 ../x.py dist --build $HOSTS