Huawei / TCP_option_address

A kernel module to obtain source IP address in the TCP option section.
GNU General Public License v2.0
183 stars 61 forks source link

在内核5.4.268环境下-编译错误 #15

Open kelo2014 opened 3 weeks ago

kelo2014 commented 3 weeks ago

环境: 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

kelo2014 commented 3 weeks ago

求指导

kelo2014 commented 3 weeks ago

4.19内核环境编译成功