Re: [PATCH] x86/Kconfig: make CFI_AUTO_DEFAULT depend on !RUST
From: Peter Zijlstra
Date: Thu Apr 10 2025 - 10:14:19 EST
On Thu, Apr 10, 2025 at 03:59:53PM +0200, Alice Ryhl wrote:
> On Thu, Apr 10, 2025 at 3:34 PM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> >
> > On Thu, Apr 10, 2025 at 03:27:55PM +0200, Miguel Ojeda wrote:
> > > On Thu, Apr 10, 2025 at 3:26 PM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > > >
> > > > New compiler can't build old core?
> > >
> > > No, that is not intended to work -- `core` is tied to the compiler.
> >
> > OMFG, you just gave me another reason to hate on this rust-bucket of a
> > language :-/ What language can't even build an old version of its own
> > runtime :-(
>
> I don't think there's anything unreasonable about having a place to
> put logic that depends on compiler internals.
Having compiler internals exposed to such an extend that programs can
make use of them _is_ weird. It creates the whole problem of where to
put it.
C++ doesn't have anything like this afaik. Esp. if you disable rtti and
exception muck, you get a very minimal runtime. And even if you don't,
it certainly doesn't break every 6 weeks. ABIs and all that.
Maybe I've been living in C/C++ land for too long, but you either expose
a full language feature and then everybody can use it, runtime,
libraries and user code alike, or you don't.
> > Anyway, given this core nonsense is now CFI unsound, it is no longer
> > suitable to build the kernel. So either refrain from using part of the
> > core that trips this, or get it fixed asap.
>
> I submitted a PR that I believe should fix it:
> https://github.com/rust-lang/rust/pull/139632
Thanks!