rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Andreas Hindborg <nmi@metaspace.dk>
Cc: Daniel Wagner <wagi@kernel.org>,
	Boqun Feng <abstractionfbq@gmail.com>,
	"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>
Subject: Re: ABI stability and Rust
Date: Wed, 2 Apr 2025 20:12:45 +0100	[thread overview]
Message-ID: <2025040256-immature-winking-c062@gregkh> (raw)
In-Reply-To: <87iknmv1xs.fsf@metaspace.dk>

On Wed, Apr 02, 2025 at 06:44:10PM +0000, Andreas Hindborg wrote:
> Hi Daniel,
> 
> I just wanted to mention that we discussed ABI stability in our
> bi-weekly rust subsystem meeting today [1].

Linux, for C, does not support "binary api stability" not at all, UNLESS
you build with the same exact toolchain (i.e. your build will be
deterministic that way only.)

I don't see why Rust would be any different here, if you want stability,
don't change the compiler, it's that simple.

Yes, we all know how people/distros have gotten away with changing
compilers over time and the binary api does not change, but that's due
to how the c compilers work over tim.  It's NOTHING that the kernel can,
or should, do here.

So if anyone really cares about this, put the work into the compiler
side, it's not a kernel issue.

> a) Ship a blessed toolchain for each kernel image you ship. Users
>    building out-of-tree modules must use this toolchain.

That's what the enterprise distros, and Android, does today, why is this
not a valid option for them to continue to do?

> b) If users cannot use the blessed toolchain, they must link all rust
>    code into their module and ensure no rust symbols in vmlinux are called.

They are not guaranteed compaibility if they change their C compiler
either, so why would Rust be any different?

> Outside of those options, I don't think there are any other solutions. I
> would not hedge my bets on rustc getting ABI stability, ever.

Then just stick with the same toolchain for the lifetime of the release
they wish to keep stable.  Not anything that we need to worry about,
this is on the external users to care about if they want something crazy
like this.

thanks,

greg k-h

  parent reply	other threads:[~2025-04-02 19:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-02 18:44 ABI stability and Rust Andreas Hindborg
2025-04-02 19:00 ` Miguel Ojeda
2025-04-07 11:17   ` Daniel Wagner
2025-04-02 19:12 ` Greg KH [this message]
2025-04-07 11:23   ` Daniel Wagner

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=2025040256-immature-winking-c062@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=abstractionfbq@gmail.com \
    --cc=nmi@metaspace.dk \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=wagi@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;
as well as URLs for NNTP newsgroup(s).