Closed frabervo closed 1 month ago
It looks like the kernel was built with Ubuntu's version of rustc, but you are compiling the kernel module with a version of rustc you got from rustup. This is not allowed. You need to use the exact same rustc version for compiling the kernel module as was originally used for compiling the kernel. Try installing the rustc package using sudo apt install rustc
and set the RUSTC
env var to /usr/bin/rustc
to force usage of the Ubuntu rustc version rather than defaulting to the rustup version.
Thank you for the hint. It was able to build.
I want to build an out-of-tree kernel module (hello world) that prints "Hello from Rust" when the module is loaded and print "Goodbye from Rust" when the module is unloaded.
Here is the Makefile:
The Rust code:
When i try to build the module with
make
, i get the error that rustc versions used to compile the crates core, kernel and compiler_builtins are incompatible with the one i'm using.Example:
The complete error message is attached.
Please any hints that can help me? build_error.txt