Code: Select all
make -C /lib/modules/6.1.25-lkp-kernel/build/ M=$(PWD) modules
make[1]: Entering directory '/home/c2kp/kernels/linux-6.1.25'
CC [M] /home/c2kp/Linux-Kernel-Programming_2E/ch4/helloworld_lkm/helloworld_lkm.o
MODPOST /home/c2kp/Linux-Kernel-Programming_2E/ch4/helloworld_lkm/Module.symvers
ERROR: modpost: "__asan_unregister_globals" [/home/c2kp/Linux-Kernel-Programming_2E/ch4/helloworld_lkm/helloworld_lkm.ko] undefined!
ERROR: modpost: "__asan_register_globals" [/home/c2kp/Linux-Kernel-Programming_2E/ch4/helloworld_lkm/helloworld_lkm.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:126: /home/c2kp/Linux-Kernel-Programming_2E/ch4/helloworld_lkm/Module.symvers] Error 1
make[1]: *** [Makefile:1964: modpost] Error 2
make[1]: Leaving directory '/home/c2kp/kernels/linux-6.1.25'
make: *** [Makefile:9: all] Error 2
Code: Select all
PWD := $(shell pwd)
KDIR := /lib/modules/$(shell uname -r)/build/
obj-m += helloworld_lkm.o
ccflags-y += -fsanitize=kernel-address
all:
make -C $(KDIR) M=$(PWD) modules
install:
make -C $(KDIR) M=$(PWD) modules_install
clean:
make -C $(KDIR) M=$(PWD) clean