From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Thomas Huth" <thuth@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
devel@lists.libvirt.org, "Alex Bennée" <alex.bennee@linaro.org>,
"Artyom Tarasenko" <atar4qemu@gmail.com>
Subject: [RFC PATCH 1/6] tests/tcg: special case sparc test cases
Date: Wed, 16 Jul 2025 11:54:09 +0100 [thread overview]
Message-ID: <20250716105414.2330204-2-alex.bennee@linaro.org> (raw)
In-Reply-To: <20250716105414.2330204-1-alex.bennee@linaro.org>
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
next prev parent reply other threads:[~2025-07-16 10:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250716105414.2330204-2-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=atar4qemu@gmail.com \
--cc=devel@lists.libvirt.org \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).