Build error: failed to run custom build command for `linux-kernel-module v0.1.0


I am trying to compile linux-kernel-modules(GitHub - fishinabarrel/linux-kernel-module-rust: Framework for writing Linux kernel modules in safe Rust)
But there is a build error.
How can I solve it? I saw this error with another example.
My system is Ubuntu 16.04.LTS, 4.15.0-122-generic.

error: failed to run custom build command for linux-kernel-module v0.1.0 (/home/jaemu.ha/rust/linux-kernel-module-rust)

Caused by:
process didn't exit successfully: /home/jaemu.ha/rust/linux-kernel-module-rust/hello-world/target/debug/build/linux-kernel-module-c8b0c0243c77ff00/build-script-build (exit code: 101)
--- stdout

--- stderr
error: error opening '/home/jaemu.ha/rust/linux-kernel-module-rust/hello-world/target/x86_64-linux-kernel/debug/.libhello_world.a.d': No such file or directory
error: error opening '/home/jaemu.ha/rust/linux-kernel-module-rust/hello-world/target/x86_64-linux-kernel/debug/.libhello_world.a.d': No such file or directory, err: true
thread 'main' panicked at 'Unable to generate bindings: ()', /home/jaemu.ha/rust/linux-kernel-module-rust/
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
/home/jaemu.ha/rust/linux-kernel-module-rust/hello-world/Kbuild:9: recipe for target '/home/jaemu.ha/rust/linux-kernel-module-rust/hello-world/target/x86_64-linux-kernel/debug/libhello_world.a' failed
make[2]: *** [/home/jaemu.ha/rust/linux-kernel-module-rust/hello-world/target/x86_64-linux-kernel/debug/libhello_world.a] Error 101
Makefile:1585: recipe for target 'module/home/jaemu.ha/rust/linux-kernel-module-rust/hello-world' failed
make[1]: *** [module/home/jaemu.ha/rust/linux-kernel-module-rust/hello-world] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-122-generic'
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 2

This repository has been archived by the owner. It is now read-only.


For most purposes, if you're interested in writing Linux kernel modules in Rust, you should look at, which is an effort to contribute that process to the upstream kernel.

You should probably look at GitHub - Rust-for-Linux/linux: Adding support for the Rust language to the Linux kernel. instead.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.