summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/breakpoints/Makefile
diff options
context:
space:
mode:
authorAleksei Oladko <aleksey.oladko@virtuozzo.com>2026-03-09 20:51:45 +0000
committerAndrew Morton <akpm@linux-foundation.org>2026-03-27 21:19:44 -0700
commit5a1292137e89c8c4b12076b17427eb00f788a4ed (patch)
treef794fa89302e3fc8d01f5c48f0365d867cc583b8 /tools/testing/selftests/breakpoints/Makefile
parent8cdf30813ea8ce881cecc08664144416dbdb3e16 (diff)
downloadlinux-next-5a1292137e89c8c4b12076b17427eb00f788a4ed.tar.gz
linux-next-5a1292137e89c8c4b12076b17427eb00f788a4ed.zip
selftests: fix ARCH normalization to handle command-line argument
Several selftests Makefiles (e.g. prctl, breakpoints, etc) attempt to normalize the ARCH variable by converting x86_64 and i.86 to x86. However, it uses the conditional assignment operator '?='. When ARCH is passed as a command-line argument (e.g., during an rpmbuild process), the '?=' operator ignores the shell command and the sed transformation. This leads to an incorrect ARCH value being used, which causes build failures # make -C tools/testing/selftests TARGETS=prctl ARCH=x86_64 make: Entering directory '/build/tools/testing/selftests' make[1]: Entering directory '/build/tools/testing/selftests/prctl' make[1]: *** No targets. Stop. make[1]: Leaving directory '/build/tools/testing/selftests/prctl' make: *** [Makefile:197: all] Error 2 Change the assignment to use 'override' and ':=' to ensure the normalization logic is applied regardless of how the ARCH variable was initially defined. Link: https://lkml.kernel.org/r/20260309205145.572778-1-aleksey.oladko@virtuozzo.com Signed-off-by: Aleksei Oladko <aleksey.oladko@virtuozzo.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Wei Yang <richard.weiyang@gmail.com> Cc: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com> Cc: Chelsy Ratnawat <chelsyratnawat2001@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/testing/selftests/breakpoints/Makefile')
-rw-r--r--tools/testing/selftests/breakpoints/Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/breakpoints/Makefile b/tools/testing/selftests/breakpoints/Makefile
index 9ec2c78de8ca..0b8f5acf7c78 100644
--- a/tools/testing/selftests/breakpoints/Makefile
+++ b/tools/testing/selftests/breakpoints/Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
# Taken from perf makefile
-uname_M := $(shell uname -m 2>/dev/null || echo not)
-ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+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/)
TEST_GEN_PROGS := step_after_suspend_test