我尝试编译this project from github,但遇到以下错误:
make -C /lib/modules/5.15.0-53-generic/build M=/home/jr/Documents/ProtoVirt modules EXTRA_CFLAGS="-g -DDEBUG"
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-53-generic'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
You are using: gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
CC [M] /home/jr/Documents/ProtoVirt/protovirt.o
In file included from /home/jr/Documents/ProtoVirt/protovirt.c:23:
/home/jr/Documents/ProtoVirt/protovirt.h: In function ‘__rdmsr1’:
/home/jr/Documents/ProtoVirt/protovirt.h:25:22: error: expected ‘:’ or ‘)’ before ‘_ASM_EXTABLE_HANDLE’
25 | _ASM_EXTABLE_HANDLE(1b, 2b, ex_handler_rdmsr_unsafe)
| ^~~~~~~~~~~~~~~~~~~
/home/jr/Documents/ProtoVirt/protovirt.h:25:42: error: invalid suffix "b" on integer constant
25 | _ASM_EXTABLE_HANDLE(1b, 2b, ex_handler_rdmsr_unsafe)
| ^~
/home/jr/Documents/ProtoVirt/protovirt.h:25:46: error: invalid suffix "b" on integer constant
25 | _ASM_EXTABLE_HANDLE(1b, 2b, ex_handler_rdmsr_unsafe)
| ^~
/home/jr/Documents/ProtoVirt/protovirt.c: In function ‘initVmcsControlField’:
/home/jr/Documents/ProtoVirt/protovirt.c:282:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
282 | void *costum_rip;
| ^~~~
make[2]: *** [scripts/Makefile.build:297: /home/jr/Documents/ProtoVirt/protovirt.o] Error 1
make[1]: *** [Makefile:1903: /home/jr/Documents/ProtoVirt] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-53-generic'
make: *** [Makefile:12: modules] Error 2
我运行的命令是make。有人能给我解释一下我做错了什么吗?
1条答案
按热度按时间v8wbuo2f1#
在最新的内核版本中,
_ASM_EXTABLE_HANDLE
宏被_ASM_EXTABLE_TYPE
所取代。