2021-05-12 13:20:26 +03:00
|
|
|
#
|
|
|
|
# Docker Hexagon cross-compiler target
|
|
|
|
#
|
|
|
|
# This docker target is used for building hexagon tests. As it also
|
2022-09-14 18:59:47 +03:00
|
|
|
# needs to be able to build QEMU itself in CI we include its
|
|
|
|
# build-deps.
|
2021-05-12 13:20:26 +03:00
|
|
|
#
|
2022-09-14 18:59:47 +03:00
|
|
|
FROM docker.io/library/debian:11-slim
|
2021-05-12 13:20:26 +03:00
|
|
|
|
2022-12-21 12:04:10 +03:00
|
|
|
# Duplicate deb line as deb-src
|
|
|
|
RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
|
|
|
|
RUN apt-get update && \
|
2021-05-12 13:20:26 +03:00
|
|
|
DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
|
|
|
|
DEBIAN_FRONTEND=noninteractive eatmydata \
|
2022-12-21 12:04:10 +03:00
|
|
|
# Install common build utilities
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
curl \
|
2023-08-29 19:15:17 +03:00
|
|
|
ccache \
|
2022-12-21 12:04:10 +03:00
|
|
|
xz-utils \
|
2022-09-14 18:59:47 +03:00
|
|
|
ca-certificates \
|
2022-12-21 12:04:10 +03:00
|
|
|
bison \
|
2021-05-12 13:20:26 +03:00
|
|
|
flex \
|
2022-12-21 12:04:10 +03:00
|
|
|
git \
|
2023-05-11 06:54:19 +03:00
|
|
|
ninja-build \
|
2023-08-09 00:35:47 +03:00
|
|
|
python3-pip \
|
|
|
|
python3-setuptools \
|
|
|
|
python3-venv \
|
|
|
|
python3-wheel && \
|
2021-05-12 13:20:26 +03:00
|
|
|
# Install QEMU build deps for use in CI
|
|
|
|
DEBIAN_FRONTEND=noninteractive eatmydata \
|
2023-08-29 19:15:17 +03:00
|
|
|
apt build-dep -yy --arch-only qemu && \
|
|
|
|
mkdir -p /usr/libexec/ccache-wrappers && \
|
|
|
|
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \
|
|
|
|
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
|
|
|
|
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \
|
|
|
|
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
|
2022-12-21 12:04:10 +03:00
|
|
|
|
2023-08-09 00:35:47 +03:00
|
|
|
RUN /usr/bin/pip3 install tomli
|
2022-12-21 12:04:10 +03:00
|
|
|
|
|
|
|
ENV TOOLCHAIN_INSTALL /opt
|
2024-01-15 02:23:54 +03:00
|
|
|
ENV TOOLCHAIN_RELEASE 12.Dec.2023
|
2022-12-21 12:04:10 +03:00
|
|
|
ENV TOOLCHAIN_BASENAME "clang+llvm-${TOOLCHAIN_RELEASE}-cross-hexagon-unknown-linux-musl"
|
2024-01-15 02:23:54 +03:00
|
|
|
ENV TOOLCHAIN_URL https://codelinaro.jfrog.io/artifactory/codelinaro-toolchain-for-hexagon/${TOOLCHAIN_RELEASE}/${TOOLCHAIN_BASENAME}.tar.xz
|
2023-08-29 19:15:17 +03:00
|
|
|
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
|
2022-12-21 12:04:10 +03:00
|
|
|
|
|
|
|
RUN curl -#SL "$TOOLCHAIN_URL" | tar -xJC "$TOOLCHAIN_INSTALL"
|
|
|
|
ENV PATH $PATH:${TOOLCHAIN_INSTALL}/${TOOLCHAIN_BASENAME}/x86_64-linux-gnu/bin
|
2024-05-13 14:15:49 +03:00
|
|
|
ENV MAKE /usr/bin/make
|
2023-02-28 22:06:48 +03:00
|
|
|
# As a final step configure the user (if env is defined)
|
|
|
|
ARG USER
|
|
|
|
ARG UID
|
|
|
|
RUN if [ "${USER}" ]; then \
|
|
|
|
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
|