lkml.org 
[lkml]   [2021]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 05/19] rust: add `compiler_builtins` crate
On Wed, Dec 8, 2021 at 12:02 AM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> Rather than panic at runtime, could we do some binary post processing
> in Kbuild with $(NM) to error the build if any of the below symbols
> are referenced from .o files produced by .rs sources?

To error the build, we only need to not define them; i.e. the issue is
passing the build. Eventually, we should be able to avoid defining
them (this is what the comment is referring to).

There are other ways around, like providing an in-tree `core`, but it
is best to see if upstream Rust can do it.

> If we provide definitions of these symbols, then I worry about C code
> that previously would have failed to link at build time when
> referencing these will now succeed at linking when CONFIG_RUST=y is
> enabled, but may panic at runtime IF we happen to hit those code
> paths.

It should be fine -- by the time we consider the Rust support
non-experimental, we should not be defining them.

Cheers,
Miguel

\
 
 \ /
  Last update: 2021-12-09 20:34    [W:0.061 / U:4.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site