* [PATCH] kselftest/arm64: signal: copy each test binary only once
@ 2026-10-14 20:01 Sasha Levin
2026-10-15 18:12 ` Catalin Marinas
2026-10-15 18:29 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Sasha Levin @ 2026-10-14 20:01 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon
Cc: Sasha Levin, Mark Brown, Cristian Marussi, Shuah Khan,
linux-arm-kernel, linux-kselftest, linux-kernel
The signal tests are built in testcases/ and then copied to the output
directory. The copy rule lists every generated program as a target and
copies all of them in each recipe:
$(TEST_GEN_PROGS): $(PROGS)
cp $(PROGS) $(OUTPUT)/
In a parallel build make runs that recipe once for each program, so
several cp processes write the same destination files at the same time.
cp then fails with "cannot create regular file ...: File exists", which
fails the arm64 build even though every test compiled. A cross build of
the arm64 signal tests at -j8 hit this in all of 8 runs.
Use a static pattern rule so that each output depends on, and copies,
only its own binary.
Fixes: f96bf4340316 ("kselftest: arm64: mangle_pstate_invalid_compat_toggle and common utils")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/arm64/signal/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/arm64/signal/Makefile b/tools/testing/selftests/arm64/signal/Makefile
index 1381039fb36f9..c4df4be41636c 100644
--- a/tools/testing/selftests/arm64/signal/Makefile
+++ b/tools/testing/selftests/arm64/signal/Makefile
@@ -17,8 +17,8 @@ TEST_GEN_PROGS := $(notdir $(PROGS))
# the toplevel makefile
include ../../lib.mk
-$(TEST_GEN_PROGS): $(PROGS)
- cp $(PROGS) $(OUTPUT)/
+$(TEST_GEN_PROGS): $(OUTPUT)/%: testcases/%
+ cp $< $@
# Common test-unit targets to build common-layout test-cases executables
# Needs secondary expansion to properly include the testcase c-file in pre-reqs
base-commit: 4eb2586bd40db27d77cc5b724ca9386ed0c71d53
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] kselftest/arm64: signal: copy each test binary only once
2026-10-14 20:01 [PATCH] kselftest/arm64: signal: copy each test binary only once Sasha Levin
@ 2026-10-15 18:12 ` Catalin Marinas
2026-10-15 18:29 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2026-10-15 18:12 UTC (permalink / raw)
To: Will Deacon, Sasha Levin
Cc: Mark Brown, Cristian Marussi, Shuah Khan, linux-arm-kernel,
linux-kselftest, linux-kernel
On Wed, 14 Oct 2026 16:01:40 -0400, Sasha Levin wrote:
> The signal tests are built in testcases/ and then copied to the output
> directory. The copy rule lists every generated program as a target and
> copies all of them in each recipe:
>
> $(TEST_GEN_PROGS): $(PROGS)
> cp $(PROGS) $(OUTPUT)/
>
> [...]
Applied to arm64 (for-next/kselftest), thanks!
[1/1] kselftest/arm64: signal: copy each test binary only once
https://git.kernel.org/arm64/c/7b3b147c4104
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] kselftest/arm64: signal: copy each test binary only once
2026-10-14 20:01 [PATCH] kselftest/arm64: signal: copy each test binary only once Sasha Levin
2026-10-15 18:12 ` Catalin Marinas
@ 2026-10-15 18:29 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-10-15 18:29 UTC (permalink / raw)
To: Sasha Levin
Cc: Catalin Marinas, Will Deacon, Cristian Marussi, Shuah Khan,
linux-arm-kernel, linux-kselftest, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 637 bytes --]
On Wed, Oct 14, 2026 at 04:01:40PM -0400, Sasha Levin wrote:
> The signal tests are built in testcases/ and then copied to the output
> directory. The copy rule lists every generated program as a target and
> copies all of them in each recipe:
The build stuff for the signal testcases is a menance, it's being far
too cute.
> -$(TEST_GEN_PROGS): $(PROGS)
> - cp $(PROGS) $(OUTPUT)/
> +$(TEST_GEN_PROGS): $(OUTPUT)/%: testcases/%
> + cp $< $@
You'd have thought that'd be clearer with two separate rules but the
obvious doesn't work and we're already being so clever I think this is
fine:
Reviewed-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-15 18:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-14 20:01 [PATCH] kselftest/arm64: signal: copy each test binary only once Sasha Levin
2026-10-15 18:12 ` Catalin Marinas
2026-10-15 18:29 ` Mark Brown
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®