souvik1997 / kernel-roulette

A kernel module written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Undefined symbols

iakshay opened this issue · comments

Hi,

The make succeeds for me, but I'm getting the following warnings. Any idea on what could be going wrong here?

I'm using rust nightly (1.35), clang 5.0 and linux kernel 4.20.6+.

WARNING: "sample" [/usr/src/kernel-roulette/build/roulette.ko] undefined!
WARNING: "get_chance" [/usr/src/kernel-roulette/build/roulette.ko] undefined!
WARNING: "rust_mod_init" [/usr/src/kernel-roulette/build/roulette.ko] undefined!
WARNING: "rust_mod_exit" [/usr/src/kernel-roulette/build/roulette.ko] undefined!

Thanks!

@iakshay
The build operation looks incomplete.
You should find an error when you do 'insmod'.
The cause of the error is the behavior of Makefile.build in "/lib/modules/uname -r/build/scripts".
A linker doesn't link ".a" files because this Makefile ignores (filters) ".a" files.

Please try to apply this patch to fix this problem.
https://gist.github.com/4ge32/6b4a58fbfce3c5b6ac3012a93f400263