out of tree kernel module build is somehow broken
fneddy opened this issue · 2 comments
fneddy commented
out of tree kernel module build is somehow broken
the problem
it seems that out of tree kernel module is not behaving as expected (or as I expect it). if i
- download the newest vanilla stable source,
- extract it,
- enable rust,
- compile the kernel,
- try to build an out of tree rust module against it
it fails. I need to go back to the kernel source dir and redo the make
AFTER i called once an out of tree kernel module build so the core crate is found.
steps to reproduce
- download and extract newest stable kernel
> curl ...
> tar xfk linux.tar.xz
- compile kernel
> export LLVM=1
> cd $KDIR
> time make clean
> time make mrproper
> time make defconfig
> time make rust.config
> time make all -j $(($(nproc)-1))
- try to compile the out of tree kernel module
> cd $MODULE_DIR
> make -C $KDIR M=$PWD
error[E0463]: can't find crate for `core`
|
= note: the `target` target may not be installed
= help: consider downloading the target with `rustup target add target`
= help: consider building the standard library from source with `cargo build -Zbuild-std`
....
now if redo the make all
in KDIR
AFTER i triggered the out of tree module build everything works as expected and i can now build out of tree kernel modules.
> cd $KDIR
> time make all -j $(($(nproc)-1))
> cd $MODULE_DIR
> make -C $KDIR M=$PWD
this happens independent if export LLVM=1
or unset LLVM=1
is called before build.
fneddy commented
nevermind ... did this in a script and PWD was NOT in my module_dir ...
ojeda commented
No worries -- thanks for reporting!