Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: "Nathan Chancellor" <nathan@kernel.org>,
	"Nicolas Schier" <nsc@kernel.org>,
	linux-kbuild@vger.kernel.org, "Shuah Khan" <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Arnaldo Carvalho de Melo" <acme@kernel.org>,
	"Namhyung Kim" <namhyung@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Jiri Olsa" <jolsa@kernel.org>, "Ian Rogers" <irogers@google.com>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"James Clark" <james.clark@linaro.org>,
	linux-perf-users@vger.kernel.org,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2 5/7] tools: build kernel selftests in tools_build
Date: Sun, 18 Oct 2026 10:39:45 -0400	[thread overview]
Message-ID: <20261018143945.4113338-1-sashal@kernel.org> (raw)
In-Reply-To: <sashiko-outbox-175556@kernel.org>

On Sat, Oct 17, 2026 at 02:32:12PM +0000, sashiko-bot@kernel.org wrote:
>> +config TOOLS_BUILD_SELFTESTS_KEXEC
>> +	bool "kexec"
>> +	depends on X86_64
>
>[Severity: Medium]
>Does this unnecessarily restrict the kexec selftest to X86_64?
>
>Looking at tools/testing/selftests/kexec/Makefile, it explicitly supports both
>x86 (32-bit and 64-bit) and ppc64le:
[...]
>Configuring the tools build on ppc64le or 32-bit x86 will not expose this
>option, silently excluding the test from being built and installed on these
>platforms.

TOOLS_BUILD is only available on x86_64 and arm64 for now
(TOOLS_BUILD_ABI), so no entry can be selected on ppc64le or 32-bit x86.
The kexec Makefile has no tests for arm64, which leaves x86_64.

>> +$(selftest-shared): FORCE
>> +	$(Q)mkdir -p $(@D); \
>> +	newest=$$(find $(CURDIR)/usr/include $(toolsdir)/include $(toolsdir)/arch $(toolsdir)/testing/selftests \
>> +		-type f \( -name '*.h' -o -name '*.mk' -o -name Makefile \) -printf '%T@\n' | \
>> +		sort -n | tail -n 1); \
>> +	touch -d "@$${newest:-0}" $@
>
>[Severity: Medium]
>Will this miss rebuild dependencies on shared build scripts?
[...]
>Modifying core shared files like tools/scripts/Makefile.include,
>tools/scripts/Makefile.arch, or scripts/subarch.include will not trigger a
>rebuild of selftests that include them, which can lead to stale builds.

Right. Of the selftests built here, kexec and vDSO include
tools/scripts/Makefile.arch and rseq includes scripts/subarch.include,
and neither file is checked. I'll add both in the next version.

>[Severity: High]
>Can this trigger a fatal Make syntax error if no selftests are selected?
[...]
>Since this rule uses two colons, it is a static pattern rule. While GNU Make
>ignores empty targets for single-colon rules, an empty target list in a
>double-colon static pattern rule evaluates to : selftest-%: ... and
>triggers a fatal missing target pattern. Stop. build error.

This is not a double-colon rule, and make ignores a static pattern rule
whose target list is empty. With CONFIG_TOOLS_BUILD=y and no tool or
selftest selected, Makefile.kbuild runs with make 4.4.1 and reports
nothing to be done for __tools_build, with and without -n.

-- 
Thanks,
Sasha

  reply	other threads:[~2026-10-18 14:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 14:31 [RFC PATCH v2 0/7] kbuild: build the userspace tools in tools/ with the kernel Sasha Levin
2026-10-16 14:31 ` [RFC PATCH v2 1/7] kbuild: factor the userspace ABI flags out into KBUILD_USERABI Sasha Levin
2026-10-17 14:32   ` sashiko-bot
2026-10-18 14:39     ` Sasha Levin
2026-10-16 14:31 ` [RFC PATCH v2 2/7] kbuild: add "make tools_build" to build userspace tools from tools/ Sasha Levin
2026-10-17 14:32   ` sashiko-bot
2026-10-18 14:39     ` Sasha Levin
2026-10-16 14:31 ` [RFC PATCH v2 3/7] perf build: Add MINIMAL=1 to build without optional features Sasha Levin
2026-10-16 15:41   ` Ian Rogers
2026-10-18 13:53     ` Sasha Levin
2026-10-16 14:31 ` [RFC PATCH v2 4/7] tools: build perf in tools_build Sasha Levin
2026-10-16 14:31 ` [RFC PATCH v2 5/7] tools: build kernel selftests " Sasha Levin
2026-10-16 16:17   ` Shuah Khan
2026-10-17 14:32   ` sashiko-bot
2026-10-18 14:39     ` Sasha Levin [this message]
2026-10-16 14:31 ` [RFC PATCH v2 6/7] kbuild: build the tools selected in tools/Kconfig as part of "make all" Sasha Levin
2026-10-16 14:31 ` [RFC PATCH v2 7/7] Documentation: describe building tools with the kernel Sasha Levin

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=20261018143945.4113338-1-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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