All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem with rust module
@ 2024-04-26  9:45 qwer trump
  2024-04-26 11:25 ` Miguel Ojeda
  0 siblings, 1 reply; 4+ messages in thread
From: qwer trump @ 2024-04-26  9:45 UTC (permalink / raw)
  To: linux-kbuild

Hi, all

I try to compile a  sample rust module with below Makefile:

obj-m += rust_minimal.o
all:
    make -C ../.. M=$(PWD) modules

but failed with below message:

ERROR: modpost: too long symbol
"_RNvNtNtCschHAZg3Q02y_6kernel5print14format_strings4INFO"
[/linux-rust/samples/rust/rust_minimal.ko]

But I see there are many long symbols in Module.symvers. So I guess there's
something wrong with modpost.

The relevant code is as follows:
   list_for_each_entry(s, &mod->unresolved_symbols, list) {
          if (!s->module)
              continue;
          if (!s->crc_valid) {
              warn("\"%s\" [%s.ko] has no CRC!\n",
                  s->name, mod->name);
              continue;
          }
          if (strlen(s->name) >= MODULE_NAME_LEN) {
              error("too long symbol \"%s\" [%s.ko]\n",
                    s->name, mod->name);
              break;
          }

 MODULE_NAME_LEN is weird. Is the code right?

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with rust module
  2024-04-26  9:45 Problem with rust module qwer trump
@ 2024-04-26 11:25 ` Miguel Ojeda
  2024-04-28  1:00   ` qwer trump
  0 siblings, 1 reply; 4+ messages in thread
From: Miguel Ojeda @ 2024-04-26 11:25 UTC (permalink / raw)
  To: qwer trump; +Cc: linux-kbuild, rust-for-linux

On Fri, Apr 26, 2024 at 11:46 AM qwer trump <vivazsj@gmail.com> wrote:
>
> ERROR: modpost: too long symbol
> "_RNvNtNtCschHAZg3Q02y_6kernel5print14format_strings4INFO"
> [/linux-rust/samples/rust/rust_minimal.ko]
>
> But I see there are many long symbols in Module.symvers. So I guess there's
> something wrong with modpost.

This shows up with `CONFIG_MODVERSIONS=y`, but you should not be able
to enable the Rust support if you have that enabled (until it gets
resolved, see [1][2]).

Do you have `CONFIG_MODVERSIONS` enabled?

Thanks!

Cheers,
Miguel

[1] https://lore.kernel.org/rust-for-linux/20230111161155.1349375-1-gary@garyguo.net/
[2] https://lore.kernel.org/rust-for-linux/20231115185858.2110875-1-mmaurer@google.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with rust module
  2024-04-26 11:25 ` Miguel Ojeda
@ 2024-04-28  1:00   ` qwer trump
  2024-04-29 14:56     ` Masahiro Yamada
  0 siblings, 1 reply; 4+ messages in thread
From: qwer trump @ 2024-04-28  1:00 UTC (permalink / raw)
  To: Miguel Ojeda; +Cc: linux-kbuild, rust-for-linux

Hi,Miguel
Thanks for your reply. I really have this config enabled.

Best Regards

Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> 于2024年4月26日周五 19:26写道:
>
> On Fri, Apr 26, 2024 at 11:46 AM qwer trump <vivazsj@gmail.com> wrote:
> >
> > ERROR: modpost: too long symbol
> > "_RNvNtNtCschHAZg3Q02y_6kernel5print14format_strings4INFO"
> > [/linux-rust/samples/rust/rust_minimal.ko]
> >
> > But I see there are many long symbols in Module.symvers. So I guess there's
> > something wrong with modpost.
>
> This shows up with `CONFIG_MODVERSIONS=y`, but you should not be able
> to enable the Rust support if you have that enabled (until it gets
> resolved, see [1][2]).
>
> Do you have `CONFIG_MODVERSIONS` enabled?
>
> Thanks!
>
> Cheers,
> Miguel
>
> [1] https://lore.kernel.org/rust-for-linux/20230111161155.1349375-1-gary@garyguo.net/
> [2] https://lore.kernel.org/rust-for-linux/20231115185858.2110875-1-mmaurer@google.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with rust module
  2024-04-28  1:00   ` qwer trump
@ 2024-04-29 14:56     ` Masahiro Yamada
  0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2024-04-29 14:56 UTC (permalink / raw)
  To: qwer trump; +Cc: Miguel Ojeda, linux-kbuild, rust-for-linux

On Sun, Apr 28, 2024 at 10:01 AM qwer trump <vivazsj@gmail.com> wrote:
>
> Hi,Miguel
> Thanks for your reply. I really have this config enabled.



Then, you were attempting to build the rust module
with CONFIG_RUST disabled.


RUST depends on !MODVERSIONS.




>
> Best Regards
>
> Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> 于2024年4月26日周五 19:26写道:
> >
> > On Fri, Apr 26, 2024 at 11:46 AM qwer trump <vivazsj@gmail.com> wrote:
> > >
> > > ERROR: modpost: too long symbol
> > > "_RNvNtNtCschHAZg3Q02y_6kernel5print14format_strings4INFO"
> > > [/linux-rust/samples/rust/rust_minimal.ko]
> > >
> > > But I see there are many long symbols in Module.symvers. So I guess there's
> > > something wrong with modpost.
> >
> > This shows up with `CONFIG_MODVERSIONS=y`, but you should not be able
> > to enable the Rust support if you have that enabled (until it gets
> > resolved, see [1][2]).
> >
> > Do you have `CONFIG_MODVERSIONS` enabled?
> >
> > Thanks!
> >
> > Cheers,
> > Miguel
> >
> > [1] https://lore.kernel.org/rust-for-linux/20230111161155.1349375-1-gary@garyguo.net/
> > [2] https://lore.kernel.org/rust-for-linux/20231115185858.2110875-1-mmaurer@google.com/
>


--
Best Regards


Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-29 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26  9:45 Problem with rust module qwer trump
2024-04-26 11:25 ` Miguel Ojeda
2024-04-28  1:00   ` qwer trump
2024-04-29 14:56     ` Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.