* [PATCH 0/5] selftests: target selection fixes for cross and LLVM builds
@ 2026-10-14 20:01 Sasha Levin
2026-10-14 20:01 ` [PATCH 3/5] selftests/thermal: allow cross builds of the Intel tests Sasha Levin
0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2026-10-14 20:01 UTC (permalink / raw)
To: Shuah Khan
Cc: Sasha Levin, Ivan Orlov, Rafael J. Wysocki, Srinivas Pandruvada,
Daniel Lezcano, linux-pm, David Woodhouse, Nageswara R Sastry,
kexec, Willy Tarreau, Thomas Weißschuh, Wake Liu,
linux-kselftest, linux-kernel
A few suites select their tests from the build host instead of the
target, or depend on the host C library in ways that break cross
builds. This series fixes the ones found while building the selftests
for several architectures:
- prctl and the Intel thermal suites build nothing when CROSS_COMPILE
is set, even for x86, and prctl restricts two generic tests to x86.
- set-anon-vma-name-test fails instead of skipping on kernels built
without CONFIG_ANON_VMA_NAME.
- kexec only recognizes the ppc64le spelling of PowerPC and decides
about the x86-64 jump test from the build host.
- size links a custom _start against the static C library, which
fails on ARM with clang and on LoongArch; it now uses nolibc.
The patches are independent of each other.
Sasha Levin (5):
selftests/prctl: build generated tests for the target architecture
selftests/prctl: skip the anonymous VMA naming test when unsupported
selftests/thermal: allow cross builds of the Intel tests
selftests/kexec: select tests using the target compiler
selftests/size: use nolibc startup and syscall wrappers
tools/testing/selftests/kexec/Makefile | 26 ++++++++-------
tools/testing/selftests/prctl/Makefile | 18 +++++-----
.../selftests/prctl/set-anon-vma-name-test.c | 3 ++
tools/testing/selftests/size/Makefile | 9 ++++-
tools/testing/selftests/size/get_size.c | 33 +++++--------------
.../thermal/intel/power_floor/Makefile | 12 +++----
.../thermal/intel/workload_hint/Makefile | 12 +++----
7 files changed, 52 insertions(+), 61 deletions(-)
base-commit: 4eb2586bd40db27d77cc5b724ca9386ed0c71d53
--
2.53.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 3/5] selftests/thermal: allow cross builds of the Intel tests
2026-10-14 20:01 [PATCH 0/5] selftests: target selection fixes for cross and LLVM builds Sasha Levin
@ 2026-10-14 20:01 ` Sasha Levin
0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2026-10-14 20:01 UTC (permalink / raw)
To: Shuah Khan
Cc: Sasha Levin, Rafael J. Wysocki, Srinivas Pandruvada,
Daniel Lezcano, linux-pm, linux-kselftest, linux-kernel
The power_floor and workload_hint Makefiles build nothing when
CROSS_COMPILE is set, even for an x86 target, and they include lib.mk
only on x86. Other architectures therefore have no install or
emit_tests rules for these suites, and their installation fails with a
missing target.
Select the x86 tests from the target ARCH when it is given and from the
host's SUBARCH otherwise, and include lib.mk unconditionally so that the
suites install and emit an empty runlist on other architectures. Use a
private ARCH_PROCESSED instead of the ARCH override added by
commit 5a1292137e89 ("selftests: fix ARCH normalization to handle
command-line argument"): the override changed the value lib.mk uses to
pick the clang target, whereas leaving ARCH unset lets lib.mk use the
compiler's native triple. A command-line ARCH such as x86_64 is still
normalized for the selection, while an ARCH spelling that lib.mk does
not know, such as i686 with LLVM=1, is rejected as in other selftests.
Fixes: 27801542b2b8 ("selftests/thermel/intel: Add test to read workload hint")
Fixes: d4d27e5a1a88 ("selftests/thermel/intel: Add test to read power floor status")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../selftests/thermal/intel/power_floor/Makefile | 12 +++++-------
.../selftests/thermal/intel/workload_hint/Makefile | 12 +++++-------
2 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/tools/testing/selftests/thermal/intel/power_floor/Makefile b/tools/testing/selftests/thermal/intel/power_floor/Makefile
index 07463c2160e09..16d26eab55652 100644
--- a/tools/testing/selftests/thermal/intel/power_floor/Makefile
+++ b/tools/testing/selftests/thermal/intel/power_floor/Makefile
@@ -1,12 +1,10 @@
# SPDX-License-Identifier: GPL-2.0
-ifndef CROSS_COMPILE
-ARCH ?= $(shell uname -m 2>/dev/null || echo not)
-override ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+top_srcdir = ../../../../../..
+include $(top_srcdir)/scripts/subarch.include
+ARCH_PROCESSED := $(shell echo $(or $(ARCH),$(SUBARCH)) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
-ifeq ($(ARCH),x86)
+ifeq ($(ARCH_PROCESSED),x86)
TEST_GEN_PROGS := power_floor_test
+endif
include ../../../lib.mk
-
-endif
-endif
diff --git a/tools/testing/selftests/thermal/intel/workload_hint/Makefile b/tools/testing/selftests/thermal/intel/workload_hint/Makefile
index 49e3bc2b20f9d..e53d6ecd9f8de 100644
--- a/tools/testing/selftests/thermal/intel/workload_hint/Makefile
+++ b/tools/testing/selftests/thermal/intel/workload_hint/Makefile
@@ -1,12 +1,10 @@
# SPDX-License-Identifier: GPL-2.0
-ifndef CROSS_COMPILE
-ARCH ?= $(shell uname -m 2>/dev/null || echo not)
-override ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+top_srcdir = ../../../../../..
+include $(top_srcdir)/scripts/subarch.include
+ARCH_PROCESSED := $(shell echo $(or $(ARCH),$(SUBARCH)) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
-ifeq ($(ARCH),x86)
+ifeq ($(ARCH_PROCESSED),x86)
TEST_GEN_PROGS := workload_hint_test
+endif
include ../../../lib.mk
-
-endif
-endif
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-14 20:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-14 20:01 [PATCH 0/5] selftests: target selection fixes for cross and LLVM builds Sasha Levin
2026-10-14 20:01 ` [PATCH 3/5] selftests/thermal: allow cross builds of the Intel tests Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox