From: Peter Zijlstra <peterz@infradead.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: "Alice Ryhl" <aliceryhl@google.com>,
"Paweł Anikiel" <panikiel@google.com>,
"Sami Tolvanen" <samitolvanen@google.com>,
"Kees Cook" <kees@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Borislav Petkov" <bp@alien8.de>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
"Ingo Molnar" <mingo@redhat.com>,
"Josh Poimboeuf" <jpoimboe@kernel.org>,
"Masahiro Yamada" <masahiroy@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Nathan Chancellor" <nathan@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org,
rust-for-linux@vger.kernel.org,
"Matthew Maurer" <mmaurer@google.com>,
"Ramon de C Valle" <rcvalle@google.com>
Subject: Re: [PATCH] x86/Kconfig: make CFI_AUTO_DEFAULT depend on !RUST
Date: Thu, 10 Apr 2025 17:14:46 +0200 [thread overview]
Message-ID: <20250410151446.GJ9833@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <CANiq72kS8kfCcaqtG0KUN4Ywh6i4PHaFOg12jF+Y7CAb5SJLbA@mail.gmail.com>
On Thu, Apr 10, 2025 at 04:54:20PM +0200, Miguel Ojeda wrote:
> On Thu, Apr 10, 2025 at 4:08 PM Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > 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.
>
> I find it unlikely that C++ stdlibs happen to build and work properly
> with compilers they are not tested for. Say, MS' STL with GCC or
> libc++ with MSVC.
Ignoring MSVC, which is a horrible joke of a compiler (or did Sutter
finally cluebat that team into building a sane compiler?), there are
definitely cross compiler STL implementations around.
> At the very least, you need to agree on builtins or `#ifdef` stuff
> manually for magic bits, and you need to avoid to rely on any compiler
> detail (or bug... :) anywhere (say, the non-conforming template
> behavior from old MSVC), and so on. So you need an active effort to
> make it work, I would expect.
Again, with the exception of MSVC, Boost builds on most C++ compilers
and is the staging ground for many new library features.
> And with new complex features like modules, I find it even more
> unlikely the first implementations of a compiler's stdlib would happen
> to work on the first implementation of the feature of another
> compiler...
Sure, shit happens, but... at least they try, it *should* work.
And the old STL (although STL really is far more a library than runtime,
it being fully optional) will most certainly build on a new compiler
from the same family.
And I know Linus hates on C++ something mighty, but in this parallel
universe where he doesn't, I would still recommend the kernel to not use
STL and instead build its own libraries (or borrow some nice pieces here
and there).
> Now, it is true that Rust's `core` uses a lot of internal features,
> precisely because they don't expect to be built by anything else that
> the current (and current - 1) compiler, so they actually take
> advantage of that.
So I don't think this is a good thing. Even builtin stuff should be
more stable than this.
> It would perhaps be nice to split the "really requires magic" in
> `core` from the rest somehow. In this case it wouldn't have helped
> though, since the formatting machinery still uses builtins last time I
> looked.
Right, to the point where we can carry a copy of the non-magic part
locally that matches the minimum version requirement. And no other bits
are to be used by in-tree rust code.
> Relatedly, GCC Rust's goal is to build an old `core` at the moment, so
> that they have a fixed set of things to solve.
Very sensible. The Rust project should have an stable core subset / variant
:-)
next prev parent reply other threads:[~2025-04-10 15:14 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 11:54 Paweł Anikiel
2025-04-10 12:36 ` Peter Zijlstra
2025-04-10 12:45 ` Peter Zijlstra
2025-04-10 13:09 ` Peter Zijlstra
2025-04-10 13:18 ` Paweł Anikiel
2025-04-10 13:20 ` Alice Ryhl
2025-04-10 13:21 ` Miguel Ojeda
2025-04-10 13:26 ` Peter Zijlstra
2025-04-10 13:27 ` Miguel Ojeda
2025-04-10 13:34 ` Peter Zijlstra
2025-04-10 13:54 ` Miguel Ojeda
2025-04-10 13:57 ` Peter Zijlstra
2025-04-10 14:05 ` Miguel Ojeda
2025-04-10 14:15 ` Peter Zijlstra
2025-04-10 15:04 ` Alice Ryhl
2025-04-10 13:59 ` Alice Ryhl
2025-04-10 14:08 ` Peter Zijlstra
2025-04-10 14:54 ` Miguel Ojeda
2025-04-10 15:14 ` Peter Zijlstra [this message]
2025-04-10 18:01 ` Miguel Ojeda
2025-04-10 15:02 ` Alice Ryhl
2025-04-15 15:15 ` Miguel Ojeda
2025-04-16 10:38 ` Alice Ryhl
2025-04-16 20:20 ` Peter Zijlstra
2025-04-16 21:51 ` Kees Cook
2025-04-17 8:18 ` Peter Zijlstra
2025-04-17 18:40 ` Miguel Ojeda
2025-04-18 9:45 ` Peter Zijlstra
2025-05-06 22:19 ` Miguel Ojeda
2025-05-09 8:46 ` Alice Ryhl
2025-05-09 9:04 ` Miguel Ojeda
2025-05-09 9:11 ` Paweł Anikiel
2025-05-09 9:39 ` Alice Ryhl
2025-05-09 16:34 ` Kees Cook
2025-05-09 19:33 ` Miguel Ojeda
2025-04-10 13:12 ` Paweł Anikiel
2025-04-10 13:25 ` Peter Zijlstra
2025-04-10 15:45 ` [PATCH] objtool: Detect __nocfi calls Peter Zijlstra
2025-04-10 19:09 ` Josh Poimboeuf
2025-04-11 6:46 ` Peter Zijlstra
2025-04-10 19:32 ` Miguel Ojeda
2025-04-10 19:43 ` Sami Tolvanen
2025-04-11 6:44 ` Peter Zijlstra
2025-04-12 12:31 ` Peter Zijlstra
2025-04-10 13:50 ` [PATCH] x86/Kconfig: make CFI_AUTO_DEFAULT depend on !RUST Miguel Ojeda
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=20250410151446.GJ9833@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=jpoimboe@kernel.org \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=mingo@redhat.com \
--cc=mmaurer@google.com \
--cc=nathan@kernel.org \
--cc=ojeda@kernel.org \
--cc=panikiel@google.com \
--cc=rcvalle@google.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=samitolvanen@google.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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
Powered by JetHome