From: Sasha Levin <sashal@kernel.org>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: Sasha Levin <sashal@kernel.org>,
"Paul E. McKenney" <paulmck@kernel.org>,
Boqun Feng <boqun@kernel.org>, Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] selftests/rseq: select only implemented architecture variants
Date: Wed, 14 Oct 2026 16:01:57 -0400 [thread overview]
Message-ID: <20261014200157.1365258-1-sashal@kernel.org> (raw)
The rseq headers implement a limited set of targets, and only the
little-endian ARM, arm64 and RISC-V variants. Building the suite for
LoongArch or for the unsupported endian variants fails in the
architecture dispatch of rseq.h.
Ask the target compiler which architecture it builds for before
selecting the tests and scripts, so that unsupported targets build,
install and emit an empty runlist through the ordinary lib.mk rules.
Pass USERCFLAGS to the probe as well, since lib.mk expands the
generated program lists before it appends USERCFLAGS to CFLAGS, and
filter out only the linker options that the preprocessor would warn
about. If the compiler cannot be run, select the tests so that the
build fails instead of turning the problem into an empty suite.
This does not add LoongArch support and does not address the remaining
compiler-specific build failures on supported targets.
Fixes: ccba8b64452b ("rseq/selftests: Provide Makefile, scripts, gitignore")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/rseq/Makefile | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/rseq/Makefile b/tools/testing/selftests/rseq/Makefile
index aba6317f6cb8e..6875ab493ed74 100644
--- a/tools/testing/selftests/rseq/Makefile
+++ b/tools/testing/selftests/rseq/Makefile
@@ -18,10 +18,22 @@ LDLIBS += -lpthread -ldl
# still track changes to header files and depend on shared object.
OVERRIDE_TARGETS = 1
-TEST_GEN_PROGS = basic_test basic_percpu_ops_test basic_percpu_ops_mm_cid_test \
+comma := ,
+RSEQ_ARCH_SUPPORTED = $(shell printf '\043if defined(__x86_64__) || defined(__i386__) || \
+ defined(__ARMEL__) || defined(__AARCH64EL__) || \
+ defined(__PPC__) || defined(__mips__) || defined(__s390__) || \
+ defined(__or1k__) || (defined(__riscv) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)\n1\n\043endif\n' | \
+ $(filter-out -fuse-ld=%,$(CC)) $(filter-out -L% -Wl$(comma)%,$(CFLAGS) $(USERCFLAGS)) \
+ -E -P -x c - || echo 1)
+
+TEST_GEN_PROGS = $(if $(filter 1,$(RSEQ_ARCH_SUPPORTED)),$(RSEQ_TEST_GEN_PROGS))
+TEST_GEN_PROGS_EXTENDED = $(if $(filter 1,$(RSEQ_ARCH_SUPPORTED)),$(RSEQ_TEST_GEN_PROGS_EXTENDED))
+TEST_PROGS = $(if $(filter 1,$(RSEQ_ARCH_SUPPORTED)),$(RSEQ_TEST_PROGS))
+
+RSEQ_TEST_GEN_PROGS = basic_test basic_percpu_ops_test basic_percpu_ops_mm_cid_test \
param_test_benchmark param_test_mm_cid_benchmark
-TEST_GEN_PROGS_EXTENDED = librseq.so \
+RSEQ_TEST_GEN_PROGS_EXTENDED = librseq.so \
param_test \
param_test_compare_twice \
param_test_mm_cid \
@@ -31,7 +43,7 @@ TEST_GEN_PROGS_EXTENDED = librseq.so \
slice_test \
check_optimized
-TEST_PROGS = run_param_test.sh run_syscall_errors_test.sh run_legacy_check.sh run_timeslice_test.sh
+RSEQ_TEST_PROGS = run_param_test.sh run_syscall_errors_test.sh run_legacy_check.sh run_timeslice_test.sh
TEST_FILES := settings
base-commit: 4eb2586bd40db27d77cc5b724ca9386ed0c71d53
--
2.53.0
reply other threads:[~2026-10-14 20:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261014200157.1365258-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=boqun@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=shuah@kernel.org \
/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
all inboxes | Powered by JetHome®