You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When import mars-xlog and other library with libc++_shared.so, it encountered with the crash on launch that:
dlopen failed: cannot locate symbol "__emutls_get_address" referenced by
"/data/app/~~9F9bkWmsoCf0Zx7jUEQu2A==/com.tencent.xriver.debug-I19tY0VOUbMwJzdk9fuJKw==/lib/arm64/libotherlib.so"...
Search the problem, noticed that it's because the mars-xlog use the ndk r20 to build and include the libc++_shared.so with r20 toolchain, which is different with other lib with r25c toolchain.
1. Info
1.1 With the help of parse_elfnote.py
mars-xlog: libc++_shared.so
So, the problem is the libc++_shared.so on r25c has __emutls_get_address weak symbol, but libc++_shared.so on r20 doesn't.
2. Try To Resolve
Choose libc++_shared.so on r25c will solve this problem, it can be compatitable with the so created by r20 toolchain.
Try to use pickFirst **/libc++_shared.so on gradle packagingOptions. Unfortunately, not working
Not working, becasause it can not be sure choose which so, sometimes choose r25c, it's OK, but sometimes not.
3. Hope
the MARS TEAM
can update the toolchain with r25c or above
or SEPARATED libc++_shared.so on a independent project as mars dependence, apply different version to choose, like
com.tencent.mars:mars-xlog:1.2.5
- com.tencent.mars:mars-c++_shared:20.0.5594570
then can offer diffrent version of c++shared to choose
- com.tencent.mars:mars-c++_shared:25.2.9519653
or provide another STL way of c++_static (embed std in so), using the static version, and not export any symbol of c++_static. the maven project name can be different
com.tencent.mars:mars-xlog-stdembed:1.2.5
The text was updated successfully, but these errors were encountered:
@wenideveloper have you tried adding pickFirst **/libc++_shared.so in the Gradle packagingOptions?
If your libc++_shared.so is the same NDK version, pickFirst will work.
zhlinh
changed the title
Conflict with other library JNI libc++_shared.so
Conflict with other library JNI libc++_shared.so export from different NDK version
Jun 21, 2024
zhlinh
changed the title
Conflict with other library JNI libc++_shared.so export from different NDK version
Conflict with other library JNI libc++_shared.so which is from different NDK version
Jun 21, 2024
When import mars-xlog and other library with libc++_shared.so, it encountered with the crash on launch that:
Search the problem, noticed that it's because the mars-xlog use the ndk r20 to build and include the libc++_shared.so with r20 toolchain, which is different with other lib with r25c toolchain.
1. Info
1.1 With the help of parse_elfnote.py
mars-xlog: libc++_shared.so
other-lib: libc++_shared.so
1.2 See the __emutls_get_address symbol with readelf
mars-xlog: libc++_shared.so
other-lib: libc++_shared.so
So, the problem is the libc++_shared.so on r25c has __emutls_get_address weak symbol, but libc++_shared.so on r20 doesn't.
2. Try To Resolve
Choose libc++_shared.so on r25c will solve this problem, it can be compatitable with the so created by r20 toolchain.
pickFirst **/libc++_shared.so
on gradle packagingOptions. Unfortunately, not workingNot working, becasause it can not be sure choose which so, sometimes choose r25c, it's OK, but sometimes not.
3. Hope
the MARS TEAM
The text was updated successfully, but these errors were encountered: