The distros no longer ship sparc compilers so we must use some others.
The best I could find was Frontgrade Gasiler who ship gcc binaries:
https://www.gaisler.com/compilers-operating-systems
Add a simple image for building the test cases.
Signed-off-by: Alex Bennée <alex.bennee(a)linaro.org>
---
.../dockerfiles/sparc-leon-cross.docker | 40 +++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 tests/docker/dockerfiles/sparc-leon-cross.docker
diff --git a/tests/docker/dockerfiles/sparc-leon-cross.docker
b/tests/docker/dockerfiles/sparc-leon-cross.docker
new file mode 100644
index 0000000000..ec391b01eb
--- /dev/null
+++ b/tests/docker/dockerfiles/sparc-leon-cross.docker
@@ -0,0 +1,40 @@
+#
+# Docker sparc cross-compiler target (tests only)
+#
+#
+#
+# While the normal cross builds take care to setup proper multiarch
+# build environments which can cross build QEMU this just installs the
+# basic compilers for as many targets as possible. We shall use this
+# to build and run linux-user tests on GitLab
+#
+FROM docker.io/library/debian:12-slim
+
+RUN export DEBIAN_FRONTEND=noninteractive && \
+ apt-get update && \
+ apt-get install -y eatmydata && \
+ eatmydata apt-get dist-upgrade -y
+
+# Add extra build tools and as many cross compilers as we can for testing
+RUN DEBIAN_FRONTEND=noninteractive eatmydata\
+ apt install -y --no-install-recommends \
+ ca-certificates \
+ ccache \
+ curl \
+ tar \
+ xz-utils
+
+RUN mkdir -p /opt
+
+RUN curl -#SL
https://download.gaisler.com/anonftp/linux/linux-2.6/toolchains/sparc-gai...
\
+ | tar -xvJC /opt
+
+
+ENV PATH $PATH:/opt/sparc-gaisler-linux5.10/bin
+ENV LD_LIBRARY_PATH /opt/sparc-gaisler-linux5.10/sysroot/leon5/lib/:$LD_LIBRARY_PATH
+
+# 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
--
2.47.2