Android ndk 8b Cannot load library

前端 未结 3 2026
滥情空心
滥情空心 2021-01-03 01:32

Upgrading to ndk 8b I receiving some crash report (most of them are Galaxy SII with Android 4.03)

java.lang.UnsatisfiedLinkError: Cannot load library: reloc_         


        
相关标签:
3条回答
  • 2021-01-03 01:53

    Producing optimised NDK code for multiple architectures?

    read about 'arm' vs 'thumb' in the accepted answer in the above link.

    then, remove your config instructions to build for thumb and verify that you are building for arm...

    OR...

    ill make a wild guess ... its the library order you have in the linker statement in your 'Android.mk'

    try the google forum for ndk ... searching for 'cannot locate symbol'...

    Really desperate?

    see 'Runtime errors' section here

    0 讨论(0)
  • 2021-01-03 02:05

    Are you compiling for armv7? If you're not, try compiling for armv7.

    0 讨论(0)
  • 2021-01-03 02:08

    The __gnu_thumb1_case_uqi is a helper which does an indexed jump on a densely packed switch table; quickly implements the switch. You have two options: avoid it or link with it.

    If you increase an optimization level (by using -O3) you might not need this symbol. Also, changing the CPU may help as well as using thumb2 instructions. Compiling with the -ffreestanding option may also avoid this symbol. If you have control over the switch statement, you can replace it with an array of function pointers.

    This routine is inside libgcc. You can statically link libgcc. Somewhere in the Android SDK/compiler, there must be a libgcc.a. Link with libgcc.a, using -L and -l or use -static-libgcc linker option to get the code (see http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html).

    Edit: If you aren't compiling anything, then you can find libgcc.so on your system. It might be in /lib or /usr/lib or perhaps some place weird for Android devices. Adding the directory where the libgcc.so is located to the environment variable LD_LIBRARY_PATH could also fix the problem. It maybe unfortunate that Samsung released incompatible binaries and you have no way to fix the issue if you aren't compiling your own code. The correct libgcc.so maybe inside something like /usr/lib/thumb for multi-lib distributions. I don't know much about the Davlik stuff, but the Android JVM might not pointing to the right set of libraries when it runs.

    0 讨论(0)
提交回复
热议问题