From: Andrew Morton <akpm@linux-foundation.org>
To: Aleksei Oladko <aleksey.oladko@virtuozzo.com>
Cc: Shuah Khan <shuah@kernel.org>,
Wei Yang <richard.weiyang@gmail.com>,
Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>,
Chelsy Ratnawat <chelsyratnawat2001@gmail.com>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests: fix ARCH normalization to handle command-line argument
Date: Mon, 9 Mar 2026 14:06:23 -0700 [thread overview]
Message-ID: <20260309140623.f0ed9289571da7f9b690aae2@linux-foundation.org> (raw)
In-Reply-To: <20260309205145.572778-1-aleksey.oladko@virtuozzo.com>
On Mon, 9 Mar 2026 20:51:45 +0000 Aleksei Oladko <aleksey.oladko@virtuozzo.com> wrote:
> 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.
lgtm, thanks.
> --- a/tools/testing/selftests/ipc/Makefile
> +++ b/tools/testing/selftests/ipc/Makefile
> @@ -1,12 +1,12 @@
> # SPDX-License-Identifier: GPL-2.0
> -uname_M := $(shell uname -m 2>/dev/null || echo not)
> -ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/)
> +ARCH ?= $(shell uname -m 2>/dev/null || echo not)
What does this `echo not' do? ARCH=not if uname failed?
prev parent reply other threads:[~2026-03-09 21:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 20:51 [PATCH] selftests: fix ARCH normalization to handle command-line argument Aleksei Oladko
2026-03-09 21:06 ` Andrew Morton [this message]
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=20260309140623.f0ed9289571da7f9b690aae2@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=aleksey.oladko@virtuozzo.com \
--cc=chelsyratnawat2001@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=reddybalavignesh9979@gmail.com \
--cc=richard.weiyang@gmail.com \
--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