module compiling : asm/linkage.h file not found

后端 未结 5 1509
别跟我提以往
别跟我提以往 2021-01-01 19:18

I am trying to compile an example of \"hello world\" Kernel Module, problems found on ubuntu 11.04, kernel 3.2.6, gcc 4.5.2 and fedora 16, kernel 3.2.7, gcc 4.6.7.

c

5条回答
  •  礼貌的吻别
    2021-01-01 19:48

    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

提交回复
热议问题