On Fri, 11 Oct 2024 08:23:18 -0700
Sami Tolvanen <[email protected]> wrote:

> On Fri, Oct 11, 2024 at 5:13 AM Gary Guo <[email protected]> wrote:
> >
> > On Fri, 11 Oct 2024 10:13:34 +0000
> > Alice Ryhl <[email protected]> wrote:
> >  
> > > +#ifndef CONFIG_JUMP_LABEL
> > > +int rust_helper_static_key_count(struct static_key *key)
> > > +{
> > > +     return static_key_count(key);
> > > +}
> > > +EXPORT_SYMBOL_GPL(rust_helper_static_key_count);  
> >
> > ^ Explicit export should be removed. This only works because we didn't
> > remove export.h from all helpers.c yet, but there's a patch to do
> > that and this will stop working.  
> 
> What's the benefit of removing explicit exports from the Rust helper C
> code? It requires special casing things like modversions for these
> files, so I assume there's a reason for this. I asked about it here,
> but never got a response:
> 
> https://lore.kernel.org/rust-for-linux/cabcjkudqaevlcdqtqyfe2+iw+jeqbpntggyjvrz0by6hgdf...@mail.gmail.com/
> 
> Sami

Ah, I didn't saw that email, probably because I archived the mails after
the patch is applied.

We're working towards having an option that enables inlining these
helpers into Rust; when that option is enabled, the helpers must not be
exported. See
https://lore.kernel.org/rust-for-linux/[email protected]/
and https://lwn.net/Articles/993163/.

It's also quite tedious for every helper to carry this export.

Best,
Gary

Reply via email to