2022-07-04 10:06:29 +03:00
|
|
|
#
|
|
|
|
# Docker cross-compiler target
|
|
|
|
#
|
2022-09-14 18:59:46 +03:00
|
|
|
# This docker target uses prebuilt toolchains for LoongArch64 from:
|
2022-07-04 10:06:29 +03:00
|
|
|
# https://github.com/loongson/build-tools/releases
|
|
|
|
#
|
2022-09-14 18:59:46 +03:00
|
|
|
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
|
2022-07-04 10:06:29 +03:00
|
|
|
|
2023-10-29 17:50:19 +03:00
|
|
|
RUN export DEBIAN_FRONTEND=noninteractive && \
|
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y eatmydata && \
|
|
|
|
eatmydata apt-get dist-upgrade -y && \
|
|
|
|
apt build-dep -yy qemu
|
|
|
|
|
2022-07-04 10:06:29 +03:00
|
|
|
RUN apt-get update && \
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
|
|
|
|
DEBIAN_FRONTEND=noninteractive eatmydata \
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
build-essential \
|
2023-10-29 17:50:19 +03:00
|
|
|
bison \
|
2022-07-04 10:06:29 +03:00
|
|
|
ca-certificates \
|
2023-10-29 17:50:19 +03:00
|
|
|
ccache \
|
|
|
|
clang \
|
|
|
|
flex \
|
2022-07-04 10:06:29 +03:00
|
|
|
curl \
|
|
|
|
gettext \
|
|
|
|
git \
|
2023-10-29 17:50:19 +03:00
|
|
|
ninja-build \
|
|
|
|
python3-pip \
|
|
|
|
python3-setuptools \
|
|
|
|
python3-venv \
|
|
|
|
python3-wheel
|
|
|
|
|
|
|
|
RUN /usr/bin/pip3 install tomli
|
2022-07-04 10:06:29 +03:00
|
|
|
|
2023-09-14 18:54:16 +03:00
|
|
|
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 \
|
2022-07-04 10:06:29 +03:00
|
|
|
| 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
|
2023-10-29 17:50:19 +03:00
|
|
|
|
|
|
|
ENV QEMU_CONFIGURE_OPTS --disable-system --disable-docs --disable-tools
|
|
|
|
ENV DEF_TARGET_LIST loongarch64-linux-user,loongarch-softmmu
|
2024-05-13 14:15:49 +03:00
|
|
|
ENV MAKE /usr/bin/make
|
2023-10-29 17:50:19 +03:00
|
|
|
|
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
|