-
Notifications
You must be signed in to change notification settings - Fork 12.9k
/
Dockerfile
50 lines (42 loc) · 1.51 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
file \
wget \
curl \
ca-certificates \
python2.7 \
git \
cmake \
xz-utils \
sudo \
gdb \
patch \
libssl-dev \
pkg-config
WORKDIR /build/
COPY scripts/musl-toolchain.sh /build/
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
RUN CFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
CXXFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
REPLACE_CC=1 bash musl-toolchain.sh x86_64 && rm -rf build
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
ENV HOSTS=x86_64-unknown-linux-musl
ENV RUST_CONFIGURE_ARGS \
--musl-root-x86_64=/usr/local/x86_64-linux-musl \
--enable-extended \
--disable-docs \
--set target.x86_64-unknown-linux-musl.crt-static=false \
--build $HOSTS
# 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
# way to produce "super compatible" binaries.
#
# See: https://github.com/rust-lang/rust/issues/34978
# And: https://github.com/rust-lang/rust/issues/59411
ENV CFLAGS_x86_64_unknown_linux_musl="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none \
-Wl,--compress-debug-sections=none"
# To run native tests replace `dist` below with `test`
ENV SCRIPT python2.7 ../x.py dist --build $HOSTS