lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240926-battering-revolt-6c6a7827413e@spud>
Date: Thu, 26 Sep 2024 17:21:11 +0100
From: Conor Dooley <conor@...nel.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc: Gary Guo <gary@...yguo.net>, Jason Montleon <jmontleo@...hat.com>,
	ojeda@...nel.org, alex.gaynor@...il.com, boqun.feng@...il.com,
	bjorn3_gh@...tonmail.com, benno.lossin@...ton.me,
	a.hindborg@...nel.org, aliceryhl@...gle.com,
	paul.walmsley@...ive.com, palmer@...belt.com, aou@...s.berkeley.edu,
	nathan@...nel.org, ndesaulniers@...gle.com, morbo@...gle.com,
	justinstitt@...gle.com, rust-for-linux@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
	llvm@...ts.linux.dev, stable@...r.kernel.org
Subject: Re: [PATCH] RISC-V: Fix building rust when using GCC toolchain

On Thu, Sep 26, 2024 at 06:11:17PM +0200, Miguel Ojeda wrote:
> On Thu, Sep 26, 2024 at 5:56 PM Conor Dooley <conor@...nel.org> wrote:
> >
> > Mixed builds are allowed on the c side, since we can figure out what the
> 
> I am not sure what you mean by allowed on the C side. For out-of-tree
> modules you mean?

No. Things like clang + ld & gas.
I don't care about out of tree modules ;)

> > versions of each tool are. If there's a way to detect the version of
> > libclang in use by the rust side, then I would be okay with mixed gcc +
> > rustc builds.
> 
> If you mean the libclang used by bindgen, yes, we have such a check
> (warning) in scripts/rust_is_available.sh. We can also have it as a
> Kconfig symbol if needed.

Okay. Short term then is deny gcc + rust, longer term is allow it with
the same caveats as the aforementioned mixed stuff.

> Regarding rustc's LLVM version, I wanted to have a similar check in
> scripts/rust_is_available.sh (also a warning), but it would have been
> quite noisy, and if LTO is not enabled it should generally be OK. So
> we are adding instead a Kconfig symbol for that, which will be used
> for a couple things. Gary has a WIP patch for this one.

Cool, I'll check that out.

> > Yes, I would rather this was not applied at all. My plan was to send a
> > patch making HAVE_RUST depend on CC_IS_CLANG, but just ain't got around
> > to it yet, partly cos I was kinda hoping to mention this to you guys at
> > LPC last week, but I never got the chance to talk to any rust people (or
> > go to any rust talks either!).
> 
> To be clear, that `depends on` would need to be only for RISC-V, i.e.
> other architectures are "OK" with those. It is really, really
> experimental, as we have always warned, but some people is using it
> successfully, apparently.

Yes, just for riscv. The logic in our Kconfig menu is currently something
like
select HAVE_RUST if RUSTC_SUPPORTS_RISCV
so that would just become
select HAVE_RUST if RUSTC_SUPPORTS_RISCV && CC_IS_CLANG

> 
> > Sure, I can add a comment there.
> 
> Thanks!
> 
> > In sorta related news, is there a plan for config "options" that will
> > allow us to detect gcc-rs or the gcc rust backend?
> 
> gccrs is way too early to even think about that. rustc_codegen_gcc,
> yeah, if needed, we can add a symbol for that when we start supporting
> the backend.

Cool, sounds good.

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ