2 # Docker Hexagon cross-compiler target
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 its
8 FROM docker.io/library/debian:11-slim
10 # Duplicate deb line as deb-src
11 RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
12 RUN apt-get update && \
13 DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
14 DEBIAN_FRONTEND=noninteractive eatmydata \
15 # Install common build utilities
16 apt-get install -y --no-install-recommends \
29 # Install QEMU build deps for use in CI
30 DEBIAN_FRONTEND=noninteractive eatmydata \
31 apt build-dep -yy --arch-only qemu && \
32 mkdir -p /usr/libexec/ccache-wrappers && \
33 ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \
34 ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
35 ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \
36 ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc && \
37 dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
39 RUN /usr/bin/pip3 install tomli
41 ENV TOOLCHAIN_INSTALL /opt
42 ENV TOOLCHAIN_RELEASE 12.Dec.2023
43 ENV TOOLCHAIN_BASENAME "clang+llvm-${TOOLCHAIN_RELEASE}-cross-hexagon-unknown-linux-musl"
44 ENV TOOLCHAIN_URL https://codelinaro.jfrog.io/artifactory/codelinaro-toolchain-for-hexagon/${TOOLCHAIN_RELEASE}/${TOOLCHAIN_BASENAME}.tar.xz
45 ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
47 RUN curl -#SL "$TOOLCHAIN_URL" | tar -xJC "$TOOLCHAIN_INSTALL"
48 ENV PATH $PATH:${TOOLCHAIN_INSTALL}/${TOOLCHAIN_BASENAME}/x86_64-linux-gnu/bin
49 ENV MAKE /usr/bin/make
50 # As a final step configure the user (if env is defined)
53 RUN if [ "${USER}" ]; then \
54 id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi