nowsecure / r2frida

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

Undefined symbol: __atomic_is_lock_free #510

Open black8855 opened 1 year ago

black8855 commented 1 year ago

I'm trying to use r2frida natively on Android via Termux, and I'm getting the following error:

ld.lld: error: undefined symbol: __atomic_is_lock_free

referenced by threads_pthread.c:231 (../../../deps/openssl/crypto/threads_pthread.c:231) crypto_threads_pthread.c.o:(_frida_CRYPTO_atomic_or) in archive ext/frida/libfrida-core.a referenced by threads_pthread.c:256 (../../../deps/openssl/crypto/threads_pthread.c:256) crypto_threads_pthread.c.o:(_frida_CRYPTO_atomic_load) in archive ext/frida/libfrida-core.a

ld.lld: error: undefined symbol: __atomic_fetch_or_8

referenced by threads_pthread.c:232 (../../../deps/openssl/crypto/threads_pthread.c:232) crypto_threads_pthread.c.o:(_frida_CRYPTO_atomic_or) in archive ext/frida/libfrida-core.a

ld.lld: error: undefined symbol: __atomic_load

referenced by threads_pthread.c:257 (../../../deps/openssl/crypto/threads_pthread.c:257) crypto_threads_pthread.c.o:(_frida_CRYPTO_atomic_load) in archive ext/frida/libfrida-core.a clang-16: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: [Makefile:359: src/r2frida-compile] Error 1 make[1]: Leaving directory '/data/data/com.termux/files/home/.local/share/radare2/r2pm/git/r2frida' make: [Makefile:164: all] Error 2 Build failed mkdir -p /"/data/data/com.termux/files/home/.local/share/radare2/plugins" mkdir -p /"/data/data/com.termux/files/home/.local/share/radare2/prefix/bin" rm -f "//data/data/com.termux/files/home/.local/share/radare2/plugins/io_frida.so" cp -f io_frida.so /"/data/data/com.termux/files/home/.local/share/radare2/plugins" cp: cannot stat 'io_frida.so': No such file or directory make: *** [Makefile:320: user-install] Error 1 Install fail

I have Samsung Galaxy Tab3 10.1 with Lineage OS 14.1. It's x86 system.

trufae commented 1 year ago

Maybe -mno-outline-atomics clang flag can fix this but could be an issue on the frida devkit for android-x86. I dont think anybody tried to build r2f for this target before

black8855 commented 1 year ago

Ok. Thank you. I'll try this.

black8855 commented 1 year ago

This didn't work unfortunately.

romanovj commented 1 year ago

@black8855 try pkg install ndk-sysroot

LDFLAGS="-latomic"

black8855 commented 1 year ago

Thank you.This hasn't help either. Still have the same error.

trufae commented 9 months ago

looks like an issue in the frida-sdk, did you tried again with the latest code from git because the version has changed since then and im aware Ole fixed some bugs in there

trufae commented 7 months ago

Can you try again? lot of people is using r2frida on android without these issues