Thursday, May 14, 2015

WARNING: linker: could not load library "libsigchain.so" from LD_PRELOAD for "sh"; caused by "libsigchain.so" is 32-bit instead of 64-bit CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "sh"; caused by "libc.so" is 32-bit instead of 64-bit


I have been trying to fix my app to support Samsung S6. It seems Samsung S6 Android 5.0.2 runs in 64 bit. If you are seeing this error it is likely "libsigchain.so" is loaded from wrong location.

If you execute this command in shell,
root@zerolte:/ # printenv "LD_PRELOAD"
printenv "LD_PRELOAD"
libsigchain.so

you libsigchain.so likely being loaded from /system/lib. To fix

export LD_PRELOAD = /system/lib64/libsigchain.so

Or you can try something like this:

final String extStoreApkPath = ""
final String libPath = (is64bit() ? "/vendor/lib:/system/lib64" : "/vendor/lib:/system/lib");
final String cmd = String.format("LD_LIBRARY_PATH=%s pm install -r -d %s", libPath, extStoreApkPath);
                      




1 comment:

  1. Export? What you mean by «export» -- copy and paste? libsigchain.so from system/lib64 to system/lib ???
    Sorry to declare: your «explanation» needs to be explained...Good grief!

    ReplyDelete