On Wed, Dec 8, 2021 at 12:02 AM Nick Desaulniers
[off-list ref] 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