错误日志:
$ make
make -C /lib/modules/4.15.0-58-generic/build SUBDIRS=/xxxx/3-netlink modules
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-58-generic'
Makefile:986: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"
CC [M] /xxxx/3-netlink/1-mynlkernel.o
Building modules, stage 2.
MODPOST 1 modules
CC /xxxx/3-netlink/1-mynlkernel.mod.o
LD [M] /xxxx/3-netlink/1-mynlkernel.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-58-generic'
解决办法:
sudo apt-get install libelf-dev
再make就没这个错误了