[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260130041054.GA528072@ax162>
Date: Thu, 29 Jan 2026 21:10:54 -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 Thu, Jan 29, 2026 at 12:59:13AM +0000, Gary Guo wrote:
> > Does Rust have the equivalent of '-Rpass-analysis' from clang? There was
> > '-Rpass-analysis=stack-frame-layout' that was added in LLVM 16:
>
> No, Rust doesn't expose such mechanism. As a matter of fact, klint is backend
> agnostic so in theory it is supposed to work with rustc_codegen_gcc, too.
>
> So far I don't have plan on adding LLVM specific analyses as doing so is quite
> tricky with the modular backend design in Rust (I would effectively need to
> replace the entire codegen backend with a patched rustc_codegen_llvm).
Ah, I had not thought about klint hooking that pass. I was more thinking
that the tool could recommend adding such an option to the problematic
target's RUSTFLAGS to get the output of the pass as part of the regular
kernel build, like adding '-Rpass-analysis=stack-frame-layout' to a .c
file's CFLAGS. If that option does not exist, then that line of
questioning is dead.
Cheers,
Nathan
Powered by blists - more mailing lists