wkz / ply

Light-weight Dynamic Tracer for Linux
https://wkz.github.io/ply
GNU General Public License v2.0
399 stars 152 forks source link

compile error #26

Closed TinyWindzz closed 3 years ago

TinyWindzz commented 3 years ago

make all-recursive make[1]: 正在进入目录 /home/frank/ply' Making all in include make[2]: 正在进入目录/home/frank/ply/include' make[2]: 没有什么可以做的为 all'。 make[2]:正在离开目录/home/frank/ply/include' Making all in src make[2]: 正在进入目录 /home/frank/ply/src' Making all in libply make[3]: 正在进入目录/home/frank/ply/src/libply' make all-am make[4]: 正在进入目录 /home/frank/ply/src/libply' CC arch/libply_la-aarch64.lo CC aux/libply_la-kallsyms.lo CC aux/libply_la-perf_event.lo CC aux/libply_la-printxf.lo CC aux/libply_la-syscall.lo CC aux/libply_la-utils.lo CC built-in/libply_la-aggregation.lo CC built-in/libply_la-built-in.lo CC built-in/libply_la-buffer.lo CC built-in/libply_la-flow.lo CC built-in/libply_la-math.lo In file included from /home/frank/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/libc/usr/include/linux/bpf.h:11:0, from ../../include/ply/ir.h:14, from ../../include/ply/sym.h:13, from ../../include/ply/ply.h:12, from built-in/math.c:11: built-in/math.c: In function 'relop_ir_post': built-in/math.c:253:32: error: 'BPF_JLT' undeclared (first use in this function); did you mean 'BPF_JGT'? jmp.code |= BPF_OP(unsignd ? BPF_JLT : BPF_JSLT); ^ built-in/math.c:253:32: note: each undeclared identifier is reported only once for each function it appears in built-in/math.c:253:42: error: 'BPF_JSLT' undeclared (first use in this function); did you mean 'BPF_JLT'? jmp.code |= BPF_OP(unsignd ? BPF_JLT : BPF_JSLT); ^ built-in/math.c:257:42: error: 'BPF_JSLE' undeclared (first use in this function); did you mean 'BPF_JSLT'? jmp.code |= BPF_OP(unsignd ? BPF_JLE : BPF_JSLE); ^ make[4]: *** [built-in/libply_la-math.lo] 错误 1 make[4]:正在离开目录/home/frank/ply/src/libply' make[3]: [all] 错误 2 make[3]:正在离开目录 `/home/frank/ply/src/libply' make[2]: [all-recursive] 错误 1 make[2]:正在离开目录 /home/frank/ply/src' make[1]: *** [all-recursive] 错误 1 make[1]:正在离开目录/home/frank/ply' make: *** [all] 错误 2

TinyWindzz commented 3 years ago

with command: ./autogen.sh
./configure --host=aarch64-linux-gnu make

wkz commented 3 years ago

Honest question: Are you happy with how you've formatted that output?

I'm over here providing free support and you can't be bothered to paste the log in a way that is at least somewhat readable. Normally I would paste it in my editor, fix the formatting, and try to give you some help. Unfortunately for you, you caught me on a bad day; sorry. Fix the formatting and I'll take a look at it.

jgsun commented 3 years ago

error: 'BPF_JSLE' undeclared It seems that the kernel header version don't meet the ply.

@wkz Which version of ply support kernel version 4.9?

TinyWindzz commented 3 years ago

My compilation environment is ubuntu x64(linux-4.4), and I'd like to cross compile ply for linux-5.4 arm64. Any ideas or suggestions?

Thx

wkz commented 3 years ago

BPF_JSLE has been in the kernel since 4.14, so if you're building against 5.4 you should have no problems. The fact that you do have problems indicate one of the following:

Have you installed your target's kernel headers somewhere in your toolchain's path? I.e. have you executed make headers_install from your kernel?

TinyWindzz commented 3 years ago

I made the following modification, and finally compiled it successfully.

make headers_install ARCH=arm64 INSTALL_HDR_PATH=/home/frank/project/kernel_head CFLAGS="-I /home/frank/project/kernel_head/include" ./configure --host=aarch64-linux-gnu --

BR/frank