Skip to content

Build Issues

This page collects common build-related problems from the learning repo.

Kernel Module Build Fails

Common checks:

uname -r
ls /lib/modules/$(uname -r)/build
make -C /lib/modules/$(uname -r)/build M=$PWD modules

Typical causes:

  • Kernel headers are not installed.
  • KDIR points to a different kernel version.
  • ARCH or CROSS_COMPILE is missing during cross compilation.
  • The source tree is copied without required generated header files.

Related pages:

Module.symvers Missing

For many simple out-of-tree modules, this may not be fatal. It becomes more important when modules depend on exported symbols from other modules.

Check whether the kernel header package provides the expected build tree and generated files.

Cross Compilation Uses the Wrong Toolchain

Check:

aarch64-linux-gnu-gcc -v
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- ...

Make sure the toolchain architecture matches the target kernel architecture.