* [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases
@ 2025-07-16 10:54 Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 1/6] tests/tcg: special case sparc " Alex Bennée
` (7 more replies)
0 siblings, 8 replies; 12+ messages in thread
From: Alex Bennée @ 2025-07-16 10:54 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Mark Cave-Ayland, Thomas Huth,
Philippe Mathieu-Daudé, devel, Alex Bennée,
Artyom Tarasenko
We didn't have any reliable way to build sparc test cases. I have
found someone who ships a compiler but the binaries still don't run
due to the need for CASA.
I'm posting mainly for those who actually care who might want to fix
up the remaining cases.
Alex.
Alex Bennée (6):
tests/tcg: special case sparc test cases
tests/tcg: special case sparc32plus test cases
configure: update sparc and sparc32plus target compiler detection
tests/docker: add sparc-leon-cross container image
configure: enable the container fallbacks for sparc/sparc32plus
docs/about: deprecate add sparc/sparc32plus-*-user
docs/about/deprecated.rst | 8 ++++
configure | 11 ++++-
.../dockerfiles/sparc-leon-cross.docker | 40 +++++++++++++++++
tests/tcg/Makefile.target | 9 ++--
tests/tcg/sparc/Makefile.target | 45 +++++++++++++++++++
tests/tcg/sparc32plus | 1 +
6 files changed, 108 insertions(+), 6 deletions(-)
create mode 100644 tests/docker/dockerfiles/sparc-leon-cross.docker
create mode 100644 tests/tcg/sparc/Makefile.target
create mode 120000 tests/tcg/sparc32plus
--
2.47.2
^ permalink raw reply [flat|nested] 12+ messages in thread
* [RFC PATCH 1/6] tests/tcg: special case sparc test cases
2025-07-16 10:54 [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases Alex Bennée
@ 2025-07-16 10:54 ` Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 2/6] tests/tcg: special case sparc32plus " Alex Bennée
` (6 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2025-07-16 10:54 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Mark Cave-Ayland, Thomas Huth,
Philippe Mathieu-Daudé, devel, Alex Bennée,
Artyom Tarasenko
Due to an existing bug #1771 we can't run anything we build so we have
to suppress the normal multiarch build. As we can't have duplicate
build rules we need to copy the bits we need from the normal multiarch
Makefile so we can redefine all the run-% rules.
For signals and vma-pthread they also need slightly different LDFLAGS
to link to the atomic support library.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tests/tcg/Makefile.target | 9 ++++---
tests/tcg/sparc/Makefile.target | 45 +++++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+), 4 deletions(-)
create mode 100644 tests/tcg/sparc/Makefile.target
diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
index af68f11664..8bcafaaf7b 100644
--- a/tests/tcg/Makefile.target
+++ b/tests/tcg/Makefile.target
@@ -103,9 +103,10 @@ ifeq ($(filter %-softmmu, $(TARGET)),)
# then the target. If there are common tests shared between
# sub-targets (e.g. ARM & AArch64) then it is up to
# $(TARGET_NAME)/Makefile.target to include the common parent
-# architecture in its VPATH. However some targets are so minimal we
-# can't even build the multiarch tests.
-ifneq ($(filter $(TARGET_NAME),aarch64_be),)
+# architecture in its VPATH. However some targets are so
+# minimal/broken just include directly and skip the common multiarch
+# tests Makefile.
+ifeq ($(filter $(TARGET_NAME),aarch64_be sparc),$(TARGET_NAME))
-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.target
else
-include $(SRC_PATH)/tests/tcg/multiarch/Makefile.target
@@ -147,7 +148,7 @@ all: $(TESTS) $(EXTRA_TESTS)
RUN_TESTS=$(patsubst %,run-%, $(TESTS))
# If plugins exist also include those in the tests
-ifeq ($(CONFIG_PLUGIN),y)
+ifeq ($(CONFIG_PLUGIN)$(SKIP_PLUGIN_TESTS),y)
PLUGIN_SRC=$(SRC_PATH)/tests/tcg/plugins
PLUGIN_LIB=../plugins
VPATH+=$(PLUGIN_LIB)
diff --git a/tests/tcg/sparc/Makefile.target b/tests/tcg/sparc/Makefile.target
new file mode 100644
index 0000000000..0b5f9e8b2d
--- /dev/null
+++ b/tests/tcg/sparc/Makefile.target
@@ -0,0 +1,45 @@
+# -*- Mode: makefile -*-
+#
+# For Sparc we only have multiarch tests - however as everything is
+# currently broken we have to duplicate the bits needed from the
+# multiarch makefile. This can be removed if we ever get running again
+# (or we deprecate the target).
+#
+
+# Compressed copy of tests/tcg/multiarch/Makefile.target
+MULTIARCH_SRC=$(SRC_PATH)/tests/tcg/multiarch
+VPATH += $(MULTIARCH_SRC)
+MULTIARCH_SRCS = $(notdir $(wildcard $(MULTIARCH_SRC)/*.c))
+ifeq ($(filter %-linux-user, $(TARGET)),$(TARGET))
+VPATH += $(MULTIARCH_SRC)/linux
+MULTIARCH_SRCS += $(notdir $(wildcard $(MULTIARCH_SRC)/linux/*.c))
+endif
+MULTIARCH_TESTS = $(MULTIARCH_SRCS:.c=)
+
+float_%: LDFLAGS+=-lm
+float_%: float_%.c libs/float_helpers.c
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< $(MULTIARCH_SRC)/libs/float_helpers.c -o $@ $(LDFLAGS)
+
+fnmsub: LDFLAGS+=-lm
+testthread: LDFLAGS+=-lpthread
+threadcount: LDFLAGS+=-lpthread
+munmap-pthread: CFLAGS+=-pthread
+munmap-pthread: LDFLAGS+=-pthread
+sigreturn-sigmask: CFLAGS+=-pthread
+sigreturn-sigmask: LDFLAGS+=-pthread
+sha1: CFLAGS+=-Wno-stringop-overread -Wno-unknown-warning-option
+
+TESTS += $(MULTIARCH_TESTS)
+# End of copy of multiarch/Makefile.target
+
+# atomic primitives used by these tests need -latomic
+signals: LDFLAGS+=-lrt -lpthread -latomic
+vma-pthread: CFLAGS+=-pthread
+vma-pthread: LDFLAGS+=-pthread -latomic
+
+# all tests currently broken due to broken CASA
+run-%:
+ $(call skip-test, $*, "CASA is broken (see bug #1771)")
+
+# we can't even think about plugin tests yet
+SKIP_PLUGIN_TESTS=y
--
2.47.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [RFC PATCH 2/6] tests/tcg: special case sparc32plus test cases
2025-07-16 10:54 [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 1/6] tests/tcg: special case sparc " Alex Bennée
@ 2025-07-16 10:54 ` Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 3/6] configure: update sparc and sparc32plus target compiler detection Alex Bennée
` (5 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2025-07-16 10:54 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Mark Cave-Ayland, Thomas Huth,
Philippe Mathieu-Daudé, devel, Alex Bennée,
Artyom Tarasenko
We can re-use the sparc Makefile to ensure we build but don't run the
tests.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tests/tcg/Makefile.target | 2 +-
tests/tcg/sparc32plus | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
create mode 120000 tests/tcg/sparc32plus
diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
index 8bcafaaf7b..bc5d2cdeeb 100644
--- a/tests/tcg/Makefile.target
+++ b/tests/tcg/Makefile.target
@@ -106,7 +106,7 @@ ifeq ($(filter %-softmmu, $(TARGET)),)
# architecture in its VPATH. However some targets are so
# minimal/broken just include directly and skip the common multiarch
# tests Makefile.
-ifeq ($(filter $(TARGET_NAME),aarch64_be sparc),$(TARGET_NAME))
+ifeq ($(filter $(TARGET_NAME),aarch64_be sparc sparc32plus),$(TARGET_NAME))
-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.target
else
-include $(SRC_PATH)/tests/tcg/multiarch/Makefile.target
diff --git a/tests/tcg/sparc32plus b/tests/tcg/sparc32plus
new file mode 120000
index 0000000000..af551a9571
--- /dev/null
+++ b/tests/tcg/sparc32plus
@@ -0,0 +1 @@
+sparc
\ No newline at end of file
--
2.47.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [RFC PATCH 3/6] configure: update sparc and sparc32plus target compiler detection
2025-07-16 10:54 [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 1/6] tests/tcg: special case sparc " Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 2/6] tests/tcg: special case sparc32plus " Alex Bennée
@ 2025-07-16 10:54 ` Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 4/6] tests/docker: add sparc-leon-cross container image Alex Bennée
` (4 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2025-07-16 10:54 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Mark Cave-Ayland, Thomas Huth,
Philippe Mathieu-Daudé, devel, Alex Bennée,
Artyom Tarasenko
The sparc64 compiler can nominally be configured to compile 32 bit and
v8plus binaries although in practice no one is now shipping them.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
configure | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 2b2b3d6597..3651cc3085 100755
--- a/configure
+++ b/configure
@@ -1356,6 +1356,7 @@ fi
: ${cross_prefix_sh4="sh4-linux-gnu-"}
: ${cross_prefix_sparc64="sparc64-linux-gnu-"}
: ${cross_prefix_sparc="$cross_prefix_sparc64"}
+: ${cross_prefix_sparc32plus="$cross_prefix_sparc64"}
: ${cross_prefix_tricore="tricore-"}
: ${cross_prefix_x86_64="x86_64-linux-gnu-"}
@@ -1371,8 +1372,8 @@ fi
: ${cross_cc_ppc64le="$cross_cc_ppc64"}
: ${cross_cc_cflags_ppc64le="-m64 -mlittle-endian"}
: ${cross_cc_cflags_sparc64="-m64 -mcpu=ultrasparc"}
-: ${cross_cc_sparc="$cross_cc_sparc64"}
: ${cross_cc_cflags_sparc="-m32 -mcpu=supersparc"}
+: ${cross_cc_cflags_sparc32plus="-m32 -mv8plus"}
: ${cross_cc_cflags_x86_64="-m64 -mcx16"}
compute_target_variable() {
@@ -1543,7 +1544,7 @@ probe_target_compiler() {
i386:x86_64 | \
mips*:mips64 | \
ppc*:ppc64 | \
- sparc:sparc64 | \
+ sparc:sparc32plus:sparc64 | \
"$cpu:$cpu")
try='native cross' ;;
esac
--
2.47.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [RFC PATCH 4/6] tests/docker: add sparc-leon-cross container image
2025-07-16 10:54 [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases Alex Bennée
` (2 preceding siblings ...)
2025-07-16 10:54 ` [RFC PATCH 3/6] configure: update sparc and sparc32plus target compiler detection Alex Bennée
@ 2025-07-16 10:54 ` Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 5/6] configure: enable the container fallbacks for sparc/sparc32plus Alex Bennée
` (3 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2025-07-16 10:54 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Mark Cave-Ayland, Thomas Huth,
Philippe Mathieu-Daudé, devel, Alex Bennée,
Artyom Tarasenko
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@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-gaisler-linux5.10-2.1.tar.xz \
+ | 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
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [RFC PATCH 5/6] configure: enable the container fallbacks for sparc/sparc32plus
2025-07-16 10:54 [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases Alex Bennée
` (3 preceding siblings ...)
2025-07-16 10:54 ` [RFC PATCH 4/6] tests/docker: add sparc-leon-cross container image Alex Bennée
@ 2025-07-16 10:54 ` Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 6/6] docs/about: deprecate add sparc/sparc32plus-*-user Alex Bennée
` (2 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2025-07-16 10:54 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Mark Cave-Ayland, Thomas Huth,
Philippe Mathieu-Daudé, devel, Alex Bennée,
Artyom Tarasenko
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
configure | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/configure b/configure
index 3651cc3085..f187480d3a 100755
--- a/configure
+++ b/configure
@@ -1442,6 +1442,8 @@ probe_target_compiler() {
riscv64) container_hosts=x86_64 ;;
s390x) container_hosts=x86_64 ;;
sh4) container_hosts=x86_64 ;;
+ sparc) container_hosts=x86_64 ;;
+ sparc32plus) container_hosts=x86_64 ;;
sparc64) container_hosts=x86_64 ;;
tricore) container_hosts=x86_64 ;;
x86_64) container_hosts="aarch64 ppc64le x86_64" ;;
@@ -1469,6 +1471,10 @@ probe_target_compiler() {
container_image=debian-all-test-cross
container_cross_prefix=powerpc${target_arch#ppc}-linux-gnu-
;;
+ sparc|sparc32plus)
+ container_image=sparc-leon-cross
+ container_cross_prefix=sparc-gaisler-linux5.10-
+ ;;
# debian-legacy-test-cross architectures (need Debian 11)
# - libc6.1-dev-alpha-cross: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1054412
--
2.47.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [RFC PATCH 6/6] docs/about: deprecate add sparc/sparc32plus-*-user
2025-07-16 10:54 [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases Alex Bennée
` (4 preceding siblings ...)
2025-07-16 10:54 ` [RFC PATCH 5/6] configure: enable the container fallbacks for sparc/sparc32plus Alex Bennée
@ 2025-07-16 10:54 ` Alex Bennée
2025-07-16 11:02 ` Thomas Huth
2025-07-17 12:32 ` [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases Mark Cave-Ayland
2025-07-21 19:52 ` Mark Cave-Ayland
7 siblings, 1 reply; 12+ messages in thread
From: Alex Bennée @ 2025-07-16 10:54 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Mark Cave-Ayland, Thomas Huth,
Philippe Mathieu-Daudé, devel, Alex Bennée,
Artyom Tarasenko
Even with a toolchain *-user is still broken. Maybe we should just
deprecate the target. I haven't deprecated for system as we have
functional tests that work and will continue to do so.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
docs/about/deprecated.rst | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index d50645a071..c2199129d8 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -267,6 +267,14 @@ known-good implementation to test against. GCC is in the process of
dropping their support for iwMMXt codegen. These CPU types are
therefore deprecated in QEMU, and will be removed in a future release.
+``sparc`` and ``sparc32plus`` (since 10.1)
+''''''''''''''''''''''''''''''''''''''''''
+
+Without regular testing these targets have bit-rotted and even after
+scrapping together the seemingly last packaged toolchain we can't
+generate binaries that can currently be run.
+
+
System emulator CPUs
--------------------
--
2.47.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [RFC PATCH 6/6] docs/about: deprecate add sparc/sparc32plus-*-user
2025-07-16 10:54 ` [RFC PATCH 6/6] docs/about: deprecate add sparc/sparc32plus-*-user Alex Bennée
@ 2025-07-16 11:02 ` Thomas Huth
0 siblings, 0 replies; 12+ messages in thread
From: Thomas Huth @ 2025-07-16 11:02 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: Paolo Bonzini, Mark Cave-Ayland, Philippe Mathieu-Daudé,
devel, Artyom Tarasenko
On 16/07/2025 12.54, Alex Bennée wrote:
> Even with a toolchain *-user is still broken. Maybe we should just
> deprecate the target. I haven't deprecated for system as we have
> functional tests that work and will continue to do so.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
> docs/about/deprecated.rst | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
> index d50645a071..c2199129d8 100644
> --- a/docs/about/deprecated.rst
> +++ b/docs/about/deprecated.rst
> @@ -267,6 +267,14 @@ known-good implementation to test against. GCC is in the process of
> dropping their support for iwMMXt codegen. These CPU types are
> therefore deprecated in QEMU, and will be removed in a future release.
>
> +``sparc`` and ``sparc32plus`` (since 10.1)
> +''''''''''''''''''''''''''''''''''''''''''
> +
> +Without regular testing these targets have bit-rotted and even after
> +scrapping together the seemingly last packaged toolchain we can't
> +generate binaries that can currently be run.
I think it's fair to deprecate it in this case. If someone wants to maintain
it, they can come up with patches and we can revert this patch. Otherwise
it's only dead code anyway.
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases
2025-07-16 10:54 [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases Alex Bennée
` (5 preceding siblings ...)
2025-07-16 10:54 ` [RFC PATCH 6/6] docs/about: deprecate add sparc/sparc32plus-*-user Alex Bennée
@ 2025-07-17 12:32 ` Mark Cave-Ayland
2025-07-17 13:51 ` Alex Bennée
2025-07-17 15:10 ` Richard Henderson
2025-07-21 19:52 ` Mark Cave-Ayland
7 siblings, 2 replies; 12+ messages in thread
From: Mark Cave-Ayland @ 2025-07-17 12:32 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: Paolo Bonzini, Thomas Huth, Philippe Mathieu-Daudé, devel,
Artyom Tarasenko
On 16/07/2025 11:54, Alex Bennée wrote:
> We didn't have any reliable way to build sparc test cases. I have
> found someone who ships a compiler but the binaries still don't run
> due to the need for CASA.
>
> I'm posting mainly for those who actually care who might want to fix
> up the remaining cases.
>
> Alex.
>
> Alex Bennée (6):
> tests/tcg: special case sparc test cases
> tests/tcg: special case sparc32plus test cases
> configure: update sparc and sparc32plus target compiler detection
> tests/docker: add sparc-leon-cross container image
> configure: enable the container fallbacks for sparc/sparc32plus
> docs/about: deprecate add sparc/sparc32plus-*-user
>
> docs/about/deprecated.rst | 8 ++++
> configure | 11 ++++-
> .../dockerfiles/sparc-leon-cross.docker | 40 +++++++++++++++++
> tests/tcg/Makefile.target | 9 ++--
> tests/tcg/sparc/Makefile.target | 45 +++++++++++++++++++
> tests/tcg/sparc32plus | 1 +
> 6 files changed, 108 insertions(+), 6 deletions(-)
> create mode 100644 tests/docker/dockerfiles/sparc-leon-cross.docker
> create mode 100644 tests/tcg/sparc/Makefile.target
> create mode 120000 tests/tcg/sparc32plus
I think the basic Debian toolchain for 32-bit SPARC is working because it is
currently used to build OpenBIOS, so I don't think we're quite at deprecation point yet.
Let me have a look and see if I can figure out what is going on here.
ATB,
Mark.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases
2025-07-17 12:32 ` [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases Mark Cave-Ayland
@ 2025-07-17 13:51 ` Alex Bennée
2025-07-17 15:10 ` Richard Henderson
1 sibling, 0 replies; 12+ messages in thread
From: Alex Bennée @ 2025-07-17 13:51 UTC (permalink / raw)
To: Mark Cave-Ayland
Cc: qemu-devel, Paolo Bonzini, Thomas Huth,
Philippe Mathieu-Daudé, devel, Artyom Tarasenko
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> writes:
> On 16/07/2025 11:54, Alex Bennée wrote:
>
>> We didn't have any reliable way to build sparc test cases. I have
>> found someone who ships a compiler but the binaries still don't run
>> due to the need for CASA.
>> I'm posting mainly for those who actually care who might want to fix
>> up the remaining cases.
>> Alex.
>> Alex Bennée (6):
>> tests/tcg: special case sparc test cases
>> tests/tcg: special case sparc32plus test cases
>> configure: update sparc and sparc32plus target compiler detection
>> tests/docker: add sparc-leon-cross container image
>> configure: enable the container fallbacks for sparc/sparc32plus
>> docs/about: deprecate add sparc/sparc32plus-*-user
>> docs/about/deprecated.rst | 8 ++++
>> configure | 11 ++++-
>> .../dockerfiles/sparc-leon-cross.docker | 40 +++++++++++++++++
>> tests/tcg/Makefile.target | 9 ++--
>> tests/tcg/sparc/Makefile.target | 45 +++++++++++++++++++
>> tests/tcg/sparc32plus | 1 +
>> 6 files changed, 108 insertions(+), 6 deletions(-)
>> create mode 100644 tests/docker/dockerfiles/sparc-leon-cross.docker
>> create mode 100644 tests/tcg/sparc/Makefile.target
>> create mode 120000 tests/tcg/sparc32plus
>
> I think the basic Debian toolchain for 32-bit SPARC is working because
> it is currently used to build OpenBIOS, so I don't think we're quite
> at deprecation point yet.
If you can figure out the right runes to compile then we can just tweak
configure and also use the debian-all-test-cross image as a fallback.
>
> Let me have a look and see if I can figure out what is going on here.
Ack.
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases
2025-07-17 12:32 ` [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases Mark Cave-Ayland
2025-07-17 13:51 ` Alex Bennée
@ 2025-07-17 15:10 ` Richard Henderson
1 sibling, 0 replies; 12+ messages in thread
From: Richard Henderson @ 2025-07-17 15:10 UTC (permalink / raw)
To: qemu-devel
On 7/17/25 05:32, Mark Cave-Ayland wrote:
> I think the basic Debian toolchain for 32-bit SPARC is working because it is currently
> used to build OpenBIOS, so I don't think we're quite at deprecation point yet.
Bear in mind that a cross-compiler for firmware may not have all of the runtime libraries
required for building userland binaries.
r~
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases
2025-07-16 10:54 [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases Alex Bennée
` (6 preceding siblings ...)
2025-07-17 12:32 ` [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases Mark Cave-Ayland
@ 2025-07-21 19:52 ` Mark Cave-Ayland
7 siblings, 0 replies; 12+ messages in thread
From: Mark Cave-Ayland @ 2025-07-21 19:52 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: Paolo Bonzini, Thomas Huth, Philippe Mathieu-Daudé,
Artyom Tarasenko
On 16/07/2025 11:54, Alex Bennée wrote:
> We didn't have any reliable way to build sparc test cases. I have
> found someone who ships a compiler but the binaries still don't run
> due to the need for CASA.
>
> I'm posting mainly for those who actually care who might want to fix
> up the remaining cases.
>
> Alex.
>
> Alex Bennée (6):
> tests/tcg: special case sparc test cases
> tests/tcg: special case sparc32plus test cases
> configure: update sparc and sparc32plus target compiler detection
> tests/docker: add sparc-leon-cross container image
> configure: enable the container fallbacks for sparc/sparc32plus
> docs/about: deprecate add sparc/sparc32plus-*-user
>
> docs/about/deprecated.rst | 8 ++++
> configure | 11 ++++-
> .../dockerfiles/sparc-leon-cross.docker | 40 +++++++++++++++++
> tests/tcg/Makefile.target | 9 ++--
> tests/tcg/sparc/Makefile.target | 45 +++++++++++++++++++
> tests/tcg/sparc32plus | 1 +
> 6 files changed, 108 insertions(+), 6 deletions(-)
> create mode 100644 tests/docker/dockerfiles/sparc-leon-cross.docker
> create mode 100644 tests/tcg/sparc/Makefile.target
> create mode 120000 tests/tcg/sparc32plus
For reference: I did some experiments here to find out what was happening, and the
problem is that glibc dropped support for sparcv8 some time ago. This leaves the
SPARC 32-bit default implementation being that for the LEON cpu which *does* include
the cas instruction and therefore it can appear in the output binary.
As an experiment I set up a new repository at
https://github.com/mcayland/sparc-linux-cross/ containing a Dockerfile that can build
a suitable toolchain using an older glibc, along with the final container at
ghcr.io/mcayland/sparc-linux-cross. Using this I can get much further with the tcg tests:
make -C tests/tcg/sparc-linux-user SPEED=quick run
make[2]: Entering directory
'/home/mca/src/upstream/qemu/build/tests/tcg/sparc-linux-user'
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc catch-syscalls > catch-syscalls.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc float_convd > float_convd.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc float_convs > float_convs.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc float_madds > float_madds.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc fnmsub > fnmsub.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc follow-fork-mode > follow-fork-mode.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc late-attach > late-attach.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc munmap-pthread > munmap-pthread.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc overflow > overflow.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc prot-none > prot-none.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc segfault > segfault.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc sha1 > sha1.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc sha512 > sha512.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc sigbus > sigbus.out
SKIPPED signals is broken on sparc because
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc sigreturn-sigmask > sigreturn-sigmask.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc test-mmap > test-mmap.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc test-plugin-mem-access >
test-plugin-mem-access.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc testthread > testthread.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc threadcount > threadcount.out
SKIPPED vma-pthread is broken on sparc because
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc linux-madvise > linux-madvise.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc linux-shmat-maps > linux-shmat-maps.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc linux-shmat-null > linux-shmat-null.out
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc linux-sigrtminmax > linux-sigrtminmax.out
SKIPPED linux-test is broken on sparc because
timeout -s KILL --foreground 120 env
QEMU=/home/mca/src/upstream/qemu/build/qemu-sparc
/home/mca/src/upstream/qemu/build/qemu-sparc test-vma > test-vma.out
make[2]: Leaving directory '/home/mca/src/upstream/qemu/build/tests/tcg/sparc-linux-user'
make[1]: Leaving directory '/home/mca/src/upstream/qemu/build'
Using this there are 3 tests that are broken. The signals and vma-pthread tests are
caused by the use of -latomic during linking, and closer examination shows that
despite using sparcv8, libatomic is still being built as sparcv8plus in the container:
root@46da5c5071f0:/opt/local/sparc-linux-gnu/lib# file libatomic.so.1.2.0
libatomic.so.1.2.0: ELF 32-bit MSB shared object, SPARC32PLUS, V8+ Required, total
store ordering, version 1 (SYSV), dynamically linked, with debug_info, not stripped
This could also be due to the use of atomic instructions only available on some more
modern CPUs.
In summary it seems that things aren't completely broken, but certainly there is some
concern that sparcv8 support does not appear to be being actively tested within the
current toolchain, and could possibly disappear at some point as it already has done
with glibc.
ATB,
Mark.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-07-21 19:53 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16 10:54 [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 1/6] tests/tcg: special case sparc " Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 2/6] tests/tcg: special case sparc32plus " Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 3/6] configure: update sparc and sparc32plus target compiler detection Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 4/6] tests/docker: add sparc-leon-cross container image Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 5/6] configure: enable the container fallbacks for sparc/sparc32plus Alex Bennée
2025-07-16 10:54 ` [RFC PATCH 6/6] docs/about: deprecate add sparc/sparc32plus-*-user Alex Bennée
2025-07-16 11:02 ` Thomas Huth
2025-07-17 12:32 ` [RFC PATCH 0/6] Fix building of sparc/sparc32plus test cases Mark Cave-Ayland
2025-07-17 13:51 ` Alex Bennée
2025-07-17 15:10 ` Richard Henderson
2025-07-21 19:52 ` Mark Cave-Ayland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).