1#
2# Docker Hexagon cross-compiler target
3#
4# This docker target is used for building hexagon tests. As it also
5# needs to be able to build QEMU itself in CI we include it's
6# build-deps. It is also a "stand-alone" image so as not to be
7# triggered by re-builds on other base images given it takes a long
8# time to build.
9#
10FROM qemu/debian10
11
12# Install common build utilities
13RUN apt update && \
14    DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
15    DEBIAN_FRONTEND=noninteractive eatmydata \
16    apt install -y --no-install-recommends \
17        bison \
18        cmake \
19        flex \
20        lld \
21        rsync \
22        wget
23
24ENV TOOLCHAIN_INSTALL /usr/local
25ENV ROOTFS /usr/local
26
27ENV LLVM_URL https://github.com/llvm/llvm-project/archive/bfcd21876adc3498065e4da92799f613e730d475.tar.gz
28ENV MUSL_URL https://github.com/quic/musl/archive/aff74b395fbf59cd7e93b3691905aa1af6c0778c.tar.gz
29ENV LINUX_URL https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.18.tar.xz
30
31ADD build-toolchain.sh /root/hexagon-toolchain/build-toolchain.sh
32
33RUN cd /root/hexagon-toolchain && ./build-toolchain.sh
34
35FROM debian:buster-slim
36# Duplicate deb line as deb-src
37RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
38# Install QEMU build deps for use in CI
39RUN apt update && \
40    DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
41    DEBIAN_FRONTEND=noninteractive eatmydata apt install -yy git ninja-build && \
42    DEBIAN_FRONTEND=noninteractive eatmydata \
43    apt build-dep -yy --arch-only qemu
44COPY --from=0 /usr/local /usr/local
45ENV PATH $PATH:/usr/local/bin/
46