From: sashiko-bot@kernel.org
To: "Peder Bergan" <peder.bergan@gmail.com>,
"Miguel Ojeda" <ojeda@kernel.org>
Cc: "Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Onur Özkan" <work@onurozkan.dev>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nicolas Schier" <nsc@kernel.org>,
"Sami Tolvanen" <samitolvanen@google.com>,
"Matthew Maurer" <mmaurer@google.com>,
"Masahiro Yamada" <masahiroy@kernel.org>,
"Gwan-gyeong Mun" <gwan-gyeong.mun@intel.com>,
linux-kbuild@vger.kernel.org, linux-modules@vger.kernel.org,
"Petr Pavlu" <petr.pavlu@suse.com>
Subject: Re: [PATCH] rust: kbuild: generate a symbol version for rust_build_error
Date: Thu, 19 Nov 2026 09:08:59 +0000 [thread overview]
Message-ID: <sashiko-outbox-222788@kernel.org> (raw)
In-Reply-To: <20261118-fix-rust-build-error-modversions-v1-1-7c1023764f30@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] rust: kbuild: wrong $(src)/Makefile dependency on
$(obj)/build_error.o
--
commit 9e904760dafd3ce72fdc411a11382bf2076cfd36
Author: Peder Bergan <peder.bergan@gmail.com>
rust: kbuild: generate a symbol version for rust_build_error
This commit enables gendwarfksyms for build_error.o so rust_build_error gets
a symbol version when CONFIG_MODVERSIONS is enabled, and adds a conditional
dependency on rust/Makefile for incremental builds.
> diff --git a/rust/Makefile b/rust/Makefile
> index 0165626decbe7..dd5b0a958d0cd 100644
> --- a/rust/Makefile
> +++ b/rust/Makefile
> @@ -773,8 +773,9 @@ $(obj)/pin_init.o: $(src)/pin-init/src/lib.rs $(obj)/compiler_builtins.o \
> # treated as such so that we pass the same flags. Otherwise, for instance,
> # `rustc` will complain about missing sanitizer flags causing an ABI mismatch.
> $(obj)/build_error.o: private is-kernel-object := y
> -$(obj)/build_error.o: private skip_gendwarfksyms = 1
> -$(obj)/build_error.o: $(src)/build_error.rs $(obj)/compiler_builtins.o FORCE
> +# Rebuild when the symbol version generation rule changes.
> +$(obj)/build_error.o: $(src)/build_error.rs $(obj)/compiler_builtins.o \
> + $(if $(CONFIG_MODVERSIONS),$(src)/Makefile) FORCE
> +$(call if_changed_rule,rustc_library)
[Severity: Low]
Does adding $(src)/Makefile here rebuild $(obj)/build_error.o when
CONFIG_MODVERSIONS is enabled in an existing build tree?
if_changed_rule checks $(newer-prereqs), which uses $? and only triggers when
a prerequisite's mtime is newer than the target. Toggling CONFIG_MODVERSIONS
from n to y in Kconfig does not touch $(src)/Makefile, so its mtime stays
older than an existing $(obj)/build_error.o and the object is not rebuilt to
generate the symbol version.
Conversely, once CONFIG_MODVERSIONS is enabled, any edit to rust/Makefile
updates its mtime and forces a rebuild of $(obj)/build_error.o, $(obj)/kernel.o
and all downstream Rust targets. Tracking config changes that do not alter
the saved command is normally done via
$(wildcard $(objtree)/include/config/MODVERSIONS).
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261118-fix-rust-build-error-modversions-v1-1-7c1023764f30@gmail.com?part=1
prev parent reply other threads:[~2026-11-19 9:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 9:08 [PATCH] rust: kbuild: generate a symbol version for rust_build_error Peder Bergan via B4 Relay
2026-11-19 0:44 ` Sami Tolvanen
2026-11-19 2:24 ` Gary Guo
2026-11-19 9:08 ` sashiko-bot [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=sashiko-outbox-222788@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=gary@garyguo.net \
--cc=gwan-gyeong.mun@intel.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=masahiroy@kernel.org \
--cc=mmaurer@google.com \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=ojeda@kernel.org \
--cc=peder.bergan@gmail.com \
--cc=petr.pavlu@suse.com \
--cc=samitolvanen@google.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/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