blob: 538ab534902a14d6c1197a136908280f45fb8d99 [file] [log] [blame]
#
# Docker cross-compiler target
#
# This docker target uses prebuilt toolchains for LoongArch64 from:
# https://github.com/loongson/build-tools/releases
#
FROM docker.io/library/debian:11-slim
# Duplicate deb line as deb-src
RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
apt build-dep -yy qemu
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt-get install -y --no-install-recommends \
build-essential \
bison \
ca-certificates \
ccache \
clang \
flex \
curl \
gettext \
git \
ninja-build \
python3-pip \
python3-setuptools \
python3-venv \
python3-wheel && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
RUN /usr/bin/pip3 install tomli
RUN curl -#SL https://github.com/loongson/build-tools/releases/download/2023.08.08/CLFS-loongarch64-8.1-x86_64-cross-tools-gcc-glibc.tar.xz \
| tar -xJC /opt
ENV PATH $PATH:/opt/cross-tools/bin
ENV LD_LIBRARY_PATH /opt/cross-tools/lib:/opt/cross-tools/loongarch64-unknown-linux-gnu/lib:$LD_LIBRARY_PATH
ENV QEMU_CONFIGURE_OPTS --disable-docs --disable-tools
ENV DEF_TARGET_LIST loongarch64-linux-user,loongarch64-softmmu
ENV MAKE /usr/bin/make
# 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