lkj009
Posts: 2
Joined: Sun Mar 31, 2019 1:13 am

WARNING: "__sanitizer_cov_trace_pc" [/home/pi/hello/hello.ko] undefined!

Sun Mar 31, 2019 1:22 am

I tried to build kernel module example which is very basic.
but I encountered problem

result is
[email protected]:~/hello $ make
make -C /lib/modules/4.19.30-v7+/build M=/home/pi/hello modules
make[1]: 디렉터리 '/home/pi/linux-5b12bd4c8cc5043a24fe2aaec09d4ded0e8d56d4' 들어감
Building modules, stage 2.
MODPOST 1 modules
WARNING: "__sanitizer_cov_trace_pc" [/home/pi/hello/hello.ko] undefined!
make[1]: 디렉터리 '/home/pi/linux-5b12bd4c8cc5043a24fe2aaec09d4ded0e8d56d4' 나감
[email protected]:~/hello $

[email protected]:~/hello $ sudo insmod hello.ko
insmod: ERROR: could not insert module hello.ko: Unknown symbol in module


Makefile
obj-m := hello.o
MDIR := /lib/modules/$(shell uname -r)/build

default:
$(MAKE) -C $(MDIR) M=$(shell pwd) modules

hello.c
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>

static int hello_init(void)
{
printk( "Hello world 1.\n");
return 0;
}

static void hello_exit(void)
{
printk("Goodbye world 1.\n");
}

module_init(hello_init);
module_exit(hello_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("AAA");
MODULE_DESCRIPTION("Raspberry pi module");
MODULE_VERSION("0.1");

lkj009
Posts: 2
Joined: Sun Mar 31, 2019 1:13 am

Re: WARNING: "__sanitizer_cov_trace_pc" [/home/pi/hello/hello.ko] undefined!

Sat Apr 06, 2019 9:42 am

It was solved ,
I followed the guide below link

https://www.raspberrypi.org/documentation/linux/kernel/

1.Updating your kernel
2.Building a new kernel (not rpi-4.18.y but rpi-4.19.y)
3.Configuring the kernel
4. Applying patches to the kernel <== skip
5. Getting the kernel headers

Return to “Linux Kernel”