Module Compiling:Asm/Linkage.H File Not Found

module compiling : asm/linkage.h file not found


obj-m += hello.o

all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

is a proper way to build modules see kbuild documentation

And to see difference beetween your compiler invocation you could

cat /lib/modules/$(shell uname -r)/build/Makefile

And analyze an output

LKM - can't compile module - missing headers files but header packages are installed

Ok I found the problem after some further reading thanks to Tsyvarev :)

The main cause of the problem was with my Makefile, the following does work for me:

obj-m += helloworld.o

all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

That fixed the original issue I was having, new one popped up not related to this thread but all fixed.



Related Topics



Leave a reply



Submit