[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260128220217.GA2129077@ax162>
Date: Wed, 28 Jan 2026 15:02:17 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Gary Guo <gary@...yguo.net>
Cc: Alexandre Courbot <acourbot@...dia.com>, Gary Guo <gary@...nel.org>,
Miguel Ojeda <ojeda@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, Nicolas Schier <nsc@...nel.org>,
Thomas Weißschuh <linux@...ssschuh.net>,
Masahiro Yamada <masahiroy@...nel.org>, Kees Cook <kees@...nel.org>,
rust-for-linux@...r.kernel.org, linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 2/2] kbuild: rust: use klint to provide
CONFIG_FRAME_WARN
On Wed, Jan 28, 2026 at 01:14:27AM +0000, Gary Guo wrote:
> It might be possible to do more detailed analysis by checking what is using the
> stack (e.g. perhaps recovery variable -> stack slots using DWARF if full
> debuginfo is enabled, or find out the instruction that first touches the
Yeah Nick wrote a Python script to use debug info to give a better idea
of stack usage to help us debug these warnings from clang:
https://github.com/ClangBuiltLinux/frame-larger-than
It is rather hacky and feels like there are a number of corner cases
where things don't look quite right but it is better than nothing.
> specific stack location and map it back like that), but doing so is quite tricky
> and the marginal benefit is less than pointing out there's an issue to be
> investigated in the first place.
Does Rust have the equivalent of '-Rpass-analysis' from clang? There was
'-Rpass-analysis=stack-frame-layout' that was added in LLVM 16:
https://github.com/llvm/llvm-project/commit/557a5bc336ffb9b03c53d4d13fd8f0bc9418ec96
I assume that could be used from Rust as well since it is in the LLVM
backend? It does not necessarily show exactly where the stack usage
comes from aside from variables and spills but still, some information
(especially accurate information at this level) is better than nothing.
Cheers,
Nathan
Powered by blists - more mailing lists