linux/tools/testing/selftests/prctl
Aleksei Oladko 5a1292137e 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>
2026-03-27 21:19:44 -07:00
..
.gitignore selftests:prctl: add set-process-name to .gitignore 2023-07-25 10:33:25 -06:00
config selftests: prctl: Add new prctl test for PR_SET_VMA action 2023-03-28 10:28:33 -06:00
disable-tsc-ctxt-sw-stress-test.c
disable-tsc-on-off-stress-test.c
disable-tsc-test.c
Makefile selftests: fix ARCH normalization to handle command-line argument 2026-03-27 21:19:44 -07:00
set-anon-vma-name-test.c selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
set-process-name.c selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00