Open WGH- opened 5 years ago
There's a different error on Radare v2.3 (found on Ubuntu 18.04 LTS):
$ r2pm -i bpf
Already up to date.
Install Done For bpf
rm -f *.so
rm -rf *.so.dSYM
cc -g -fPIC -I/usr/include/libr -shared -L/usr/lib/x86_64-linux-gnu -lr_util -lr_parse -lr_syscall -lr_asm -lr_lang -lr_parse -lr_syscall -lr_flag -lr_cons -lr_reg -lr_util -lz -lzip -ldl -o asm_bpf.so asm_bpf.c
asm_bpf.c: In function 'disassemble':
asm_bpf.c:239:18: warning: passing argument 1 of 'r_strbuf_setf' from incompatible pointer type [-Wincompatible-pointer-types]
r_strbuf_setf (&r_op->buf_asm, "%s %s, 0x%08" PFMT64x ", 0x%08" PFMT64x "", op, vbuf,
^
In file included from /usr/include/libr/r_util.h:57:0,
from asm_bpf.c:10:
/usr/include/libr/r_util/r_strbuf.h:18:12: note: expected 'RStrBuf * {aka struct <anonymous> *}' but argument is of type 'char (*)[256]'
R_API bool r_strbuf_setf(RStrBuf *sb, const char *fmt, ...);
^~~~~~~~~~~~~
asm_bpf.c:241:22: warning: passing argument 1 of 'r_strbuf_setf' from incompatible pointer type [-Wincompatible-pointer-types]
else r_strbuf_setf (&r_op->buf_asm, "%s %s", op, vbuf);
^
In file included from /usr/include/libr/r_util.h:57:0,
from asm_bpf.c:10:
/usr/include/libr/r_util/r_strbuf.h:18:12: note: expected 'RStrBuf * {aka struct <anonymous> *}' but argument is of type 'char (*)[256]'
R_API bool r_strbuf_setf(RStrBuf *sb, const char *fmt, ...);
^~~~~~~~~~~~~
asm_bpf.c: In function 'assemble_tok':
asm_bpf.c:251:2: warning: implicit declaration of function 'r_strbuf_setbin'; did you mean 'r_strbuf_setf'? [-Wimplicit-function-declaration]
r_strbuf_setbin (&a, (const ut8 *)b, sizeof (*b) + 1);\
^
asm_bpf.c:588:3: note: in expansion of macro 'COPY_AND_RET'
COPY_AND_RET (op->buf, &f);
^~~~~~~~~~~~
asm_bpf.c: In function 'assemble':
asm_bpf.c:700:16: warning: passing argument 1 of 'r_strbuf_set' from incompatible pointer type [-Wincompatible-pointer-types]
r_strbuf_set (&op->buf_asm, buf);
^
In file included from /usr/include/libr/r_util.h:57:0,
from asm_bpf.c:10:
/usr/include/libr/r_util/r_strbuf.h:17:12: note: expected 'RStrBuf * {aka struct <anonymous> *}' but argument is of type 'char (*)[256]'
R_API bool r_strbuf_set(RStrBuf *sb, const char *s);
^~~~~~~~~~~~
asm_bpf.c:701:13: warning: passing argument 1 of 'normalize' from incompatible pointer type [-Wincompatible-pointer-types]
normalize (&op->buf_asm);
^
asm_bpf.c:661:13: note: expected 'RStrBuf * {aka struct <anonymous> *}' but argument is of type 'char (*)[256]'
static void normalize(RStrBuf *buf) {
^~~~~~~~~
asm_bpf.c:705:20: warning: passing argument 1 of 'r_strbuf_get' from incompatible pointer type [-Wincompatible-pointer-types]
p = r_strbuf_get (&op->buf_asm);
^
In file included from /usr/include/libr/r_util.h:57:0,
from asm_bpf.c:10:
/usr/include/libr/r_util/r_strbuf.h:22:13: note: expected 'RStrBuf * {aka struct <anonymous> *}' but argument is of type 'char (*)[256]'
R_API char *r_strbuf_get(RStrBuf *sb);
^~~~~~~~~~~~
cc -g -fPIC -I/usr/include/libr -shared -L/usr/lib/x86_64-linux-gnu -lr_util -lr_parse -lr_syscall -lr_anal -lr_reg -lr_syscall -lr_search -lr_cons -lr_flag -lr_util -lz -lzip -ldl -o anal_bpf.so anal_bpf.c
anal_bpf.c:49:1: error: unknown type name 'RAnalEsilInterruptHandler'; did you mean 'RAnalEsilInterruptCB'?
RAnalEsilInterruptHandler ih = { 0, NULL, NULL, &bpf_int_exit, NULL };
^~~~~~~~~~~~~~~~~~~~~~~~~
RAnalEsilInterruptCB
anal_bpf.c:49:37: warning: excess elements in scalar initializer
RAnalEsilInterruptHandler ih = { 0, NULL, NULL, &bpf_int_exit, NULL };
^~~~
anal_bpf.c:49:37: note: (near initialization for 'ih')
anal_bpf.c:49:43: warning: excess elements in scalar initializer
RAnalEsilInterruptHandler ih = { 0, NULL, NULL, &bpf_int_exit, NULL };
^~~~
anal_bpf.c:49:43: note: (near initialization for 'ih')
anal_bpf.c:49:49: warning: excess elements in scalar initializer
RAnalEsilInterruptHandler ih = { 0, NULL, NULL, &bpf_int_exit, NULL };
^
anal_bpf.c:49:49: note: (near initialization for 'ih')
anal_bpf.c:49:64: warning: excess elements in scalar initializer
RAnalEsilInterruptHandler ih = { 0, NULL, NULL, &bpf_int_exit, NULL };
^~~~
anal_bpf.c:49:64: note: (near initialization for 'ih')
anal_bpf.c: In function 'bpf_anal':
anal_bpf.c:86:3: warning: implicit declaration of function 'esilprintf'; did you mean 'vswprintf'? [-Wimplicit-function-declaration]
esilprintf (op, "A,R0,=,0,$");
^~~~~~~~~~
vswprintf
anal_bpf.c: In function 'esil_bpf_init':
anal_bpf.c:482:2: error: unknown type name 'RAnalEsilInterrupt'; did you mean 'RAnalEsilInterruptCB'?
RAnalEsilInterrupt *intr = r_anal_esil_interrupt_new (esil, 0, &ih);
^~~~~~~~~~~~~~~~~~
RAnalEsilInterruptCB
anal_bpf.c:482:29: warning: implicit declaration of function 'r_anal_esil_interrupt_new'; did you mean 'r_anal_esil_set_interrupt'? [-Wimplicit-function-declaration]
RAnalEsilInterrupt *intr = r_anal_esil_interrupt_new (esil, 0, &ih);
^~~~~~~~~~~~~~~~~~~~~~~~~
r_anal_esil_set_interrupt
anal_bpf.c:482:29: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
anal_bpf.c:483:35: warning: passing argument 2 of 'r_anal_esil_set_interrupt' makes integer from pointer without a cast [-Wint-conversion]
r_anal_esil_set_interrupt (esil, intr);
^~~~
In file included from /usr/include/libr/r_parse.h:8:0,
from /usr/include/libr/r_asm.h:9,
from anal_bpf.c:10:
/usr/include/libr/r_anal.h:1302:11: note: expected 'int' but argument is of type 'int *'
R_API int r_anal_esil_set_interrupt (RAnalEsil *esil, int interrupt, RAnalEsilInterruptCB interruptcb);
^~~~~~~~~~~~~~~~~~~~~~~~~
anal_bpf.c:483:2: error: too few arguments to function 'r_anal_esil_set_interrupt'
r_anal_esil_set_interrupt (esil, intr);
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/libr/r_parse.h:8:0,
from /usr/include/libr/r_asm.h:9,
from anal_bpf.c:10:
/usr/include/libr/r_anal.h:1302:11: note: declared here
R_API int r_anal_esil_set_interrupt (RAnalEsil *esil, int interrupt, RAnalEsilInterruptCB interruptcb);
^~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:18: recipe for target 'all' failed
make: *** [all] Error 1
The r2 apis have changed and this plugin needs to be updated. Use an old r2 or fix this code in a pr.
On 20 Jul 2019, at 15:58, WGH notifications@github.com wrote:
There's a different error on Radare v2.3 (found on Ubuntu 18.04 LTS):
$ r2pm -i bpf Already up to date. Install Done For bpf rm -f .so rm -rf .so.dSYM cc -g -fPIC -I/usr/include/libr -shared -L/usr/lib/x86_64-linux-gnu -lr_util -lr_parse -lr_syscall -lr_asm -lr_lang -lr_parse -lr_syscall -lr_flag -lr_cons -lr_reg -lr_util -lz -lzip -ldl -o asm_bpf.so asm_bpf.c asm_bpf.c: In function 'disassemble': asm_bpf.c:239:18: warning: passing argument 1 of 'r_strbuf_setf' from incompatible pointer type [-Wincompatible-pointer-types] r_strbuf_setf (&r_op->buf_asm, "%s %s, 0x%08" PFMT64x ", 0x%08" PFMT64x "", op, vbuf, ^ In file included from /usr/include/libr/r_util.h:57:0, from asm_bpf.c:10: /usr/include/libr/r_util/r_strbuf.h:18:12: note: expected 'RStrBuf {aka struct
}' but argument is of type 'char ()[256]' R_API bool r_strbuf_setf(RStrBuf sb, const char fmt, ...); ^ ~~~~ asm_bpf.c:241:22: warning: passing argument 1 of 'r_strbuf_setf' from incompatible pointer type [-Wincompatible-pointer-types] else r_strbuf_setf (&r_op->buf_asm, "%s %s", op, vbuf); ^ In file included from /usr/include/libr/r_util.h:57:0, from asm_bpf.c:10: /usr/include/libr/r_util/r_strbuf.h:18:12: note: expected 'RStrBuf {aka struct}' but argument is of type 'char ()[256]' R_API bool r_strbuf_setf(RStrBuf sb, const char fmt, ...); ^ ~~~~ asm_bpf.c: In function 'assemble_tok': asm_bpf.c:251:2: warning: implicit declaration of function 'r_strbuf_setbin'; did you mean 'r_strbuf_setf'? [-Wimplicit-function-declaration] r_strbuf_setbin (&a, (const ut8 )b, sizeof (b) + 1);\ ^ asm_bpf.c:588:3: note: in expansion of macro 'COPY_AND_RET' COPY_AND_RET (op->buf, &f); ^~~~ asm_bpf.c: In function 'assemble': asm_bpf.c:700:16: warning: passing argument 1 of 'r_strbuf_set' from incompatible pointer type [-Wincompatible-pointer-types] r_strbuf_set (&op->buf_asm, buf); ^ In file included from /usr/include/libr/r_util.h:57:0, from asm_bpf.c:10: /usr/include/libr/r_util/r_strbuf.h:17:12: note: expected 'RStrBuf {aka struct}' but argument is of type 'char ()[256]' R_API bool r_strbuf_set(RStrBuf sb, const char s); ^ ~~~ asm_bpf.c:701:13: warning: passing argument 1 of 'normalize' from incompatible pointer type [-Wincompatible-pointer-types] normalize (&op->buf_asm); ^ asm_bpf.c:661:13: note: expected 'RStrBuf {aka struct}' but argument is of type 'char ()[256]' static void normalize(RStrBuf buf) { ^ ~~~~ asm_bpf.c:705:20: warning: passing argument 1 of 'r_strbuf_get' from incompatible pointer type [-Wincompatible-pointer-types] p = r_strbuf_get (&op->buf_asm); ^ In file included from /usr/include/libr/r_util.h:57:0, from asm_bpf.c:10: /usr/include/libr/r_util/r_strbuf.h:22:13: note: expected 'RStrBuf {aka struct}' but argument is of type 'char ()[256]' R_API char r_strbuf_get(RStrBuf sb); ^ ~~~ cc -g -fPIC -I/usr/include/libr -shared -L/usr/lib/x86_64-linux-gnu -lr_util -lr_parse -lr_syscall -lr_anal -lr_reg -lr_syscall -lr_search -lr_cons -lr_flag -lr_util -lz -lzip -ldl -o anal_bpf.so anal_bpf.c anal_bpf.c:49:1: error: unknown type name 'RAnalEsilInterruptHandler'; did you mean 'RAnalEsilInterruptCB'? RAnalEsilInterruptHandler ih = { 0, NULL, NULL, &bpf_int_exit, NULL }; ^~~~~~~~~ RAnalEsilInterruptCB anal_bpf.c:49:37: warning: excess elements in scalar initializer RAnalEsilInterruptHandler ih = { 0, NULL, NULL, &bpf_int_exit, NULL }; ^~~~ anal_bpf.c:49:37: note: (near initialization for 'ih') anal_bpf.c:49:43: warning: excess elements in scalar initializer RAnalEsilInterruptHandler ih = { 0, NULL, NULL, &bpf_int_exit, NULL }; ^~~~ anal_bpf.c:49:43: note: (near initialization for 'ih') anal_bpf.c:49:49: warning: excess elements in scalar initializer RAnalEsilInterruptHandler ih = { 0, NULL, NULL, &bpf_int_exit, NULL }; ^ anal_bpf.c:49:49: note: (near initialization for 'ih') anal_bpf.c:49:64: warning: excess elements in scalar initializer RAnalEsilInterruptHandler ih = { 0, NULL, NULL, &bpf_int_exit, NULL }; ^~~~ anal_bpf.c:49:64: note: (near initialization for 'ih') anal_bpf.c: In function 'bpf_anal': anal_bpf.c:86:3: warning: implicit declaration of function 'esilprintf'; did you mean 'vswprintf'? [-Wimplicit-function-declaration] esilprintf (op, "A,R0,=,0,$"); ^~~~~~ vswprintf anal_bpf.c: In function 'esil_bpf_init': anal_bpf.c:482:2: error: unknown type name 'RAnalEsilInterrupt'; did you mean 'RAnalEsilInterruptCB'? RAnalEsilInterrupt intr = r_anal_esil_interrupt_new (esil, 0, &ih); ^~~~~~ RAnalEsilInterruptCB anal_bpf.c:482:29: warning: implicit declaration of function 'r_anal_esil_interrupt_new'; did you mean 'r_anal_esil_set_interrupt'? [-Wimplicit-function-declaration] RAnalEsilInterrupt intr = r_anal_esil_interrupt_new (esil, 0, &ih); ^~~~~~~~~ r_anal_esil_set_interrupt anal_bpf.c:482:29: warning: initialization makes pointer from integer without a cast [-Wint-conversion] anal_bpf.c:483:35: warning: passing argument 2 of 'r_anal_esil_set_interrupt' makes integer from pointer without a cast [-Wint-conversion] r_anal_esil_set_interrupt (esil, intr); ^~~~ In file included from /usr/include/libr/r_parse.h:8:0, from /usr/include/libr/r_asm.h:9, from anal_bpf.c:10: /usr/include/libr/r_anal.h:1302:11: note: expected 'int' but argument is of type 'int ' R_API int r_anal_esil_set_interrupt (RAnalEsil esil, int interrupt, RAnalEsilInterruptCB interruptcb); ^~~~~~~~~ anal_bpf.c:483:2: error: too few arguments to function 'r_anal_esil_set_interrupt' r_anal_esil_set_interrupt (esil, intr); ^~~~~~~~~ In file included from /usr/include/libr/r_parse.h:8:0, from /usr/include/libr/r_asm.h:9, from anal_bpf.c:10: /usr/include/libr/r_anal.h:1302:11: note: declared here R_API int r_anal_esil_set_interrupt (RAnalEsil *esil, int interrupt, RAnalEsilInterruptCB interruptcb); ^~~~~~~~~ Makefile:18: recipe for target 'all' failed make: *** [all] Error 1 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
What r2 version?
I guess 3.4 or 3.5 should be fine
On 20 Jul 2019, at 16:47, WGH notifications@github.com wrote:
What r2 version?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.