criu/scripts/build/Dockerfile.stable-cross.tmpl
Adrian Reber 4e93a9802d scripts/build: reduce riscv64 cross-compilation template
duplication

Move the riscv64-specific APT repository setup (GPG keys, custom
source lists) from the template into the header file. This allows
the riscv64 template to be a symlink to the shared
Dockerfile.stable-cross.tmpl, like all other cross-compilation
targets. Skip amdgpu_plugin for riscv64 as it is not supported.

Assisted-by: Claude Code (claude-opus-4-6)
Signed-off-by: Adrian Reber <areber@redhat.com>
2026-07-16 09:29:39 +01:00

31 lines
1.1 KiB
Cheetah

# Add the cross compiler sources
RUN echo "deb http://deb.debian.org/debian/ stable main" >> /etc/apt/sources.list && \
dpkg --add-architecture ${DEBIAN_ARCH}
ENV CROSS_COMPILE=${CROSS_TRIPLET}- \
CROSS_ROOT=/usr/${CROSS_TRIPLET} \
AS=/usr/bin/${CROSS_TRIPLET}-as \
AR=/usr/bin/${CROSS_TRIPLET}-ar \
CC=/usr/bin/${CROSS_TRIPLET}-gcc \
CPP=/usr/bin/${CROSS_TRIPLET}-cpp \
CXX=/usr/bin/${CROSS_TRIPLET}-g++ \
LD=/usr/bin/${CROSS_TRIPLET}-ld \
FC=/usr/bin/${CROSS_TRIPLET}-gfortran
ENV PATH="${PATH}:${CROSS_ROOT}/bin" \
PKG_CONFIG_PATH=/usr/lib/${CROSS_TRIPLET}/pkgconfig
COPY contrib/dependencies/apt-cross-packages.sh /criu/contrib/dependencies/apt-cross-packages.sh
COPY contrib/apt-install /criu/contrib/apt-install
WORKDIR /criu
RUN /criu/contrib/dependencies/apt-cross-packages.sh
COPY . /criu
# amdgpu_plugin is not supported on armv7 and riscv64
RUN make mrproper && date && \
make -j $(nproc) && \
if [ "$SUBARCH" != "armv7" ] && [ "$ARCH" != "riscv64" ]; then \
make -j $(nproc) amdgpu_plugin; \
fi && \
make -j $(nproc) zdtm && date