Skip to contentSkip to conversation

Error building sample modules

DISCUSSION Thomas Thanner 3 participants 5 messages May 25, 2021 – May 26, 2021 Rust

lore
Share & tools
lore
#0 lore raw

Hi,

I get the ERROR below building the rust sample modules.

Has somebody an idea, what I make wrong ?

Thanks

Thomas

make LLVM=1 -j4

...

...

OBJCOPY arch/x86/boot/setup.bin
BUILD   arch/x86/boot/bzImage
Kernel: arch/x86/boot/bzImage is ready  (#1)
ERROR: modpost: too long symbol "_RNvXsp_NtCsbDqzXfLQacH_6kernel12module_paramjNtB5_11ModuleParam5value" [samples/rust/rust_module_parameters.ko]
ERROR: modpost: too long symbol "_RNvXs0_NtCsbDqzXfLQacH_6kernel5printNtB5_13LogLineWriterNtNtCsbDqzXfLQacH_4core3fmt5Write9write_str" [samples/rust/rust_minimal.ko] scripts/Makefile.modpost:132: recipe for target 'Module.symvers' failed
make[1]: *** [Module.symvers] Error 1
make[1]: *** Deleting file 'Module.symvers'

#1 lore raw

Hi Thomas,

Quoted 2 lines · Thomas Thanner

Has somebody an idea, what I make wrong ?

A few general questions for reproducing your issue:
- Which Git tree/commit are you compiling?
- What is your kernel configuration?
- What is your version of GCC, LLVM/Clang, rustc and bindgen?

Thank you!

Cheers,
Miguel

#2 lore raw
In reply to Thomas Thanner
Quoted 4 lines · Thomas Thanner

ERROR: modpost: too long symbol "_RNvXsp_NtCsbDqzXfLQacH_6kernel12module_paramjNtB5_11ModuleParam5value" [samples/rust/rust_module_parameters.ko]

Sven privately told me he recalls this being CONFIG_MODVERSIONS (thanks!).

Thomas, can you try disabling:

Enable loadable module support --->
Module versioning support

(Ref: https://github.com/Rust-for-Linux/linux/issues/59)

Cheers,
Miguel

#3 lore raw

Hi Miguel,

yes, thanks, that worked.

Now I have two built-in rust modules. And two loadable modules.

I have to compare that to normal linux modules. The built-in rust_minimal doesn't show up in /sys/module. If I do insmod rust_minimal.ko then it shows up. I have to do that a bit more systematically with the four modules.

Thanks for the moment

Thomas

Quoted 15 lines · Miguel Ojeda
Quoted 3 lines · Thomas Thanner

ERROR: modpost: too long symbol "_RNvXsp_NtCsbDqzXfLQacH_6kernel12module_paramjNtB5_11ModuleParam5value" [samples/rust/rust_module_parameters.ko]

Sven privately told me he recalls this being CONFIG_MODVERSIONS (thanks!).

Thomas, can you try disabling:

Enable loadable module support --->
Module versioning support

(Ref: https://github.com/Rust-for-Linux/linux/issues/59)

Cheers,
Miguel

#4 lore raw
Quoted 9 lines · Thomas Thanner

Hi Miguel,

yes, thanks, that worked.

Now I have two built-in rust modules. And two loadable modules.

I have to compare that to normal linux modules. The built-in rust_minimal doesn't show up in /sys/module. If I do insmod rust_minimal.ko then it shows up. I have to do that a bit more systematically with the four modules.

If you module has no parameters or options, then building it into the kernel will not cause it to show up in /sys/modules/ as what is there to show in that location for it?

If you load it as a module, there is stuff to show (memory maps and the like), so it makes sense it shows up then.

Try it with a .c module to see if it does the same thing.

thanks,

greg k-h