环境:
CentOS Linux release 7.9.2009 (Core)
CentOS Linux (5.4.268-1.el7.elrepo.x86_64) 7 (Core)
编译报如下错误:
make CONFIG_TOA=m -C /lib/modules/uname -r/build M=pwd modules
make[1]: Entering directory `/usr/src/kernels/5.4.268-1.el7.elrepo.x86_64'
CC [M] /share/kernel2/TCP_option_address-master/src/toa.o
In file included from :0:0:
./arch/x86/include/asm/page_64.h: In function ‘clear_page’:
././include/linux/compiler_types.h:214:24: error: expected ‘(’ before ‘__inline’
define asm_inline asm __inline
^
./arch/x86/include/asm/alternative.h:256:2: note: in expansion of macro ‘asm_inline’
asm_inline volatile (ALTERNATIVE_2("call %P[old]", "call %P[new1]", feature1,\
^
./arch/x86/include/asm/page_64.h:49:2: note: in expansion of macro ‘alternative_call_2’
alternative_call_2(clear_page_orig,
^
In file included from ./arch/x86/include/asm/barrier.h:5:0,
from ./include/linux/compiler.h:325,
from ./include/linux/init.h:5,
from /share/kernel2/TCP_option_address-master/src/toa.h:4,
from /share/kernel2/TCP_option_address-master/src/toa.c:1:
./arch/x86/include/asm/alternative.h:128:2: error: expected identifier or ‘(’ before string constant
"# ALT: oldinstr2\n" \
^
./arch/x86/include/asm/alternative.h:168:2: note: in expansion of macro ‘OLDINSTR_2’
OLDINSTR_2(oldinstr, 1, 2) \
^
./arch/x86/include/asm/alternative.h:256:23: note: in expansion of macro ‘ALTERNATIVE_2’
asm_inline volatile (ALTERNATIVE_2("call %P[old]", "call %P[new1]", feature1,\
^
./arch/x86/include/asm/page_64.h:49:2: note: in expansion of macro ‘alternative_call_2’
alternative_call_2(clear_page_orig,
^
In file included from :0:0:
././include/linux/compiler_types.h:214:24: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
define asm_inline asm __inline
^
./arch/x86/include/asm/alternative.h:256:2: note: in expansion of macro ‘asm_inline’
asm_inline volatile (ALTERNATIVE_2("call %P[old]", "call %P[new1]", feature1,\
^
./arch/x86/include/asm/page_64.h:49:2: note: in expansion of macro ‘alternative_call_2’
alternative_call_2(clear_page_orig,
^
"output.log" 7019L, 343872C
error.log
环境: CentOS Linux release 7.9.2009 (Core) CentOS Linux (5.4.268-1.el7.elrepo.x86_64) 7 (Core)
编译报如下错误: make CONFIG_TOA=m -C /lib/modules/:0:0:
./arch/x86/include/asm/page_64.h: In function ‘clear_page’:
././include/linux/compiler_types.h:214:24: error: expected ‘(’ before ‘__inline’
uname -r
/build M=pwd
modules make[1]: Entering directory `/usr/src/kernels/5.4.268-1.el7.elrepo.x86_64' CC [M] /share/kernel2/TCP_option_address-master/src/toa.o In file included fromdefine asm_inline asm __inline
./arch/x86/include/asm/alternative.h:256:2: note: in expansion of macro ‘asm_inline’ asm_inline volatile (ALTERNATIVE_2("call %P[old]", "call %P[new1]", feature1,\ ^ ./arch/x86/include/asm/page_64.h:49:2: note: in expansion of macro ‘alternative_call_2’ alternative_call_2(clear_page_orig, ^ In file included from ./arch/x86/include/asm/barrier.h:5:0, from ./include/linux/compiler.h:325, from ./include/linux/init.h:5, from /share/kernel2/TCP_option_address-master/src/toa.h:4, from /share/kernel2/TCP_option_address-master/src/toa.c:1: ./arch/x86/include/asm/alternative.h:128:2: error: expected identifier or ‘(’ before string constant "# ALT: oldinstr2\n" \ ^ ./arch/x86/include/asm/alternative.h:168:2: note: in expansion of macro ‘OLDINSTR_2’ OLDINSTR_2(oldinstr, 1, 2) \ ^ ./arch/x86/include/asm/alternative.h:256:23: note: in expansion of macro ‘ALTERNATIVE_2’ asm_inline volatile (ALTERNATIVE_2("call %P[old]", "call %P[new1]", feature1,\ ^ ./arch/x86/include/asm/page_64.h:49:2: note: in expansion of macro ‘alternative_call_2’ alternative_call_2(clear_page_orig, ^ In file included from:0:0:
././include/linux/compiler_types.h:214:24: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
define asm_inline asm __inline
./arch/x86/include/asm/alternative.h:256:2: note: in expansion of macro ‘asm_inline’ asm_inline volatile (ALTERNATIVE_2("call %P[old]", "call %P[new1]", feature1,\ ^ ./arch/x86/include/asm/page_64.h:49:2: note: in expansion of macro ‘alternative_call_2’ alternative_call_2(clear_page_orig, ^ "output.log" 7019L, 343872C error.log