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