nowsecure / r2frida

Radare2 and Frida better together.
MIT License
1.18k stars 121 forks source link

clang: error, build io_frida.dylib failed #216

Closed KaithyRookie closed 4 years ago

KaithyRookie commented 4 years ago

Hi,I get some trouble when using r2pm install r2frida, i hava searched in Issues and all i found is r2pm is old, but i check my r2pm version is 4.3.1,so I do't know what i can do next. below is some print message and my r2pm version, thank you for helping!

xxd -i < src/_agent.js > src/_agent.h
cc -c -fPIC -g -I/usr/local/include/libr -DWITH_CYLANG=0 -Iext/frida src/io_frida.c -o src/io_frida.o
src/io_frida.c:685:26: warning: implicit declaration of function 'r_str_trim_ro' is invalid in C99 [-Wimplicit-function-declaration]
                        gchar *path = strdup (r_str_trim_ro (command + 3));
                                              ^
src/io_frida.c:685:26: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]
                        gchar *path = strdup (r_str_trim_ro (command + 3));
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/string.h:117:26: note: passing argument to parameter '__s1' here
char    *strdup(const char *__s1);
                            ^
2 warnings generated.
pkg-config --cflags r_core
-I/usr/local/include/libr
c++ src/io_frida.o -o io_frida.dylib -shared -fPIC -g -L/usr/local/lib -lr_core -lssl -lr_config -lr_debug -lr_bin -lr_anal -lr_bp -lr_egg -lr_asm -lr_lang -lr_parse -lr_flag -lr_cons -lr_reg -lr_search -lr_syscall -lr_fs -lr_magic -lr_crypto -lr_hash -lr_io -lr_socket -lr_util -ldl -Wl,-exported_symbol,_radare_plugin -Wl,-dead_strip -Wl,-no_compact_unwind ext/frida/libfrida-core.a -lresolv -framework Foundation -lbsm -framework AppKit
Undefined symbols for architecture x86_64:
  "_r_str_trim_ro", referenced from:
      ___system in io_frida.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [io_frida.dylib] Error 1
make: *** [all] Error 2
ERROR: Build failed

~ » r2pm -v                                                                                                                
r2pm 4.3.1
radare commented 4 years ago

Fixed now

Thanks

On 10 Mar 2020, at 15:22, KaithyRookie notifications@github.com wrote:  Hi,I get some trouble when using r2pm install r2frida, i hava searched in Issues and all i found is r2pm is old, but i check my r2pm version is 4.3.1,so I do't know what i can do next. below is some print message and my r2pm version, thank you for helping!

xxd -i < src/_agent.js > src/_agent.h cc -c -fPIC -g -I/usr/local/include/libr -DWITH_CYLANG=0 -Iext/frida src/io_frida.c -o src/io_frida.o src/io_frida.c:685:26: warning: implicit declaration of function 'r_str_trim_ro' is invalid in C99 [-Wimplicit-function-declaration] gchar path = strdup (r_str_trim_ro (command + 3)); ^ src/io_frida.c:685:26: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char ' [-Wint-conversion] gchar path = strdup (r_str_trim_ro (command + 3)); ^~~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/string.h:117:26: note: passing argument to parameter '__s1' here char strdup(const char *__s1); ^ 2 warnings generated. pkg-config --cflags r_core -I/usr/local/include/libr c++ src/io_frida.o -o io_frida.dylib -shared -fPIC -g -L/usr/local/lib -lr_core -lssl -lr_config -lr_debug -lr_bin -lr_anal -lr_bp -lr_egg -lr_asm -lr_lang -lr_parse -lr_flag -lr_cons -lr_reg -lr_search -lr_syscall -lr_fs -lr_magic -lr_crypto -lr_hash -lr_io -lr_socket -lr_util -ldl -Wl,-exported_symbol,_radare_plugin -Wl,-dead_strip -Wl,-no_compact_unwind ext/frida/libfrida-core.a -lresolv -framework Foundation -lbsm -framework AppKit Undefined symbols for architecture x86_64: "_r_str_trim_ro", referenced from: ___system in io_frida.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: [io_frida.dylib] Error 1 make: [all] Error 2 ERROR: Build failed

~ » r2pm -v
r2pm 4.3.1 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.