|
/proj/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: warning: hidden symbol '__sync_fetch_and_add_4' in /proj/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/libgcc.a(linux-atomic.o) is referenced by DSO I did some search and it is pretty well known issue with g++ linker. It is said to add -lgcc along with -lgcc_s to fix it because "sync_fetch_and_add_4" doesn't exist in libgcc_s which g++ will use instead of libgcc. But, there is no libgcc_s lib with android ndk. So it is not the same
case but with the same issue. http://gcc.gnu.org/ml/gcc-help/2010-11/msg00198.html I did a test with below code:
if TYPE is long long, no complain. If TYPE is int, gives warning similar as above. In my project, I do use a third part library which use sync_fetch_and_add in its atomic define head file. Will this warning cause problem if not fix it? How to fix it? Thanks! |
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/groups/opt_out.
--
--
You received this message because you are subscribed to a topic in the Google Groups "android-ndk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-ndk/7J8JUIXT_WQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-ndk...@googlegroups.com.
I found this is caused by the shared library which is reported as reference "__sync_fetch_and_add_4". When I built simple test file, I didn't change Android.mk and kept LOCAL_LDLIBS as before. So if I remove this shared library (mybuild.so showing above), everything is fine even though I reference "__sync_fetch_and_add" directly. I don't know what difference with "-4" suffix.This shared library doesn't use this function directly, it depend boost library which use it as atomic incline. For some reason, they are conflict.