rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Haiyue Wang <haiyuewa@163.com>
To: Miguel Ojeda <ojeda@kernel.org>,
	Sami Tolvanen <samitolvanen@google.com>,
	Alex Gaynor <alex.gaynor@gmail.com>
Cc: linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"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>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	patches@lists.linux.dev, stable@vger.kernel.org
Subject: Re: [PATCH v2] gendwarfksyms: Skip files with no exports
Date: Mon, 10 Nov 2025 22:23:21 +0800	[thread overview]
Message-ID: <ca686233-f687-4147-b22a-72d0b0bedfcc@163.com> (raw)
In-Reply-To: <20251110131913.1789896-1-ojeda@kernel.org>

On 11/10/2025 9:19 PM, Miguel Ojeda wrote:
> From: Sami Tolvanen <samitolvanen@google.com>
> 
> Starting with Rust 1.91.0 (released 2025-10-30), in upstream commit
> ab91a63d403b ("Ignore intrinsic calls in cross-crate-inlining cost model")
> [1][2], `bindings.o` stops containing DWARF debug information because the
> `Default` implementations contained `write_bytes()` calls which are now
> ignored in that cost model (note that `CLIPPY=1` does not reproduce it).
> 
> This means `gendwarfksyms` complains:
> 
>        RUSTC L rust/bindings.o
>      error: gendwarfksyms: process_module: dwarf_get_units failed: no debugging information?
> 
> There are several alternatives that would work here: conditionally
> skipping in the cases needed (but that is subtle and brittle), forcing
> DWARF generation with e.g. a dummy `static` (ugly and we may need to
> do it in several crates), skipping the call to the tool in the Kbuild
> command when there are no exports (fine) or teaching the tool to do so
> itself (simple and clean).
> 
> Thus do the last one: don't attempt to process files if we have no symbol
> versions to calculate.
> 
>    [ I used the commit log of my patch linked below since it explained the
>      root issue and expanded it a bit more to summarize the alternatives.
> 
>        - Miguel ]
> 
> Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
> Reported-by: Haiyue Wang <haiyuewa@163.com>
> Closes: https://lore.kernel.org/rust-for-linux/b8c1c73d-bf8b-4bf2-beb1-84ffdcd60547@163.com/
> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Link: https://lore.kernel.org/rust-for-linux/CANiq72nKC5r24VHAp9oUPR1HVPqT+=0ab9N0w6GqTF-kJOeiSw@mail.gmail.com/
> Link: https://github.com/rust-lang/rust/commit/ab91a63d403b0105cacd72809cd292a72984ed99 [1]
> Link: https://github.com/rust-lang/rust/pull/145910 [2]
> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> ---
>   scripts/gendwarfksyms/gendwarfksyms.c | 3 ++-
>   scripts/gendwarfksyms/gendwarfksyms.h | 2 +-
>   scripts/gendwarfksyms/symbols.c       | 4 +++-
>   3 files changed, 6 insertions(+), 3 deletions(-)
> 

Tested-by: Haiyue Wang <haiyuewa@163.com>


  reply	other threads:[~2025-11-10 14:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10 13:19 [PATCH v2] gendwarfksyms: Skip files with no exports Miguel Ojeda
2025-11-10 14:23 ` Haiyue Wang [this message]
2025-11-10 14:57 ` Alice Ryhl
2025-11-10 16:48   ` Miguel Ojeda
2025-11-11 15:05     ` Alice Ryhl
2025-11-11 13:54 ` Miguel Ojeda
2025-11-11 13:58   ` Miguel Ojeda
2025-11-11 15:24   ` Sedat Dilek
2025-11-11 19:45     ` Miguel Ojeda
2025-11-17  5:28     ` Sedat Dilek
2025-11-17  7:04       ` Miguel Ojeda
2025-11-11 19:44 ` Miguel Ojeda
2025-11-18 14:57 ` Giuliano Procida
2025-11-18 16:20   ` Miguel Ojeda
2025-11-18 16:26   ` Sami Tolvanen

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=ca686233-f687-4147-b22a-72d0b0bedfcc@163.com \
    --to=haiyuewa@163.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=samitolvanen@google.com \
    --cc=stable@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /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;
as well as URLs for NNTP newsgroup(s).