Right now the Parity binary depends on libc++_shared.so, which means that it fails to start on an Android device. After investigation, this is caused by these lines. The correct fix is to remove them, but doing so breaks non-Android platforms for a reason that should be investigated.
The other action item that should be done is verify in CI that we don't depend on libc++_shared.so. This is done by running arm-linux-androideabi-objdump -x ./target/armv7-linux-androideabi/parity | grep libc++_shared and making sure that there's no result.
I don't get it, shouldn't those lines cause it to link against libstdc++? What should we do for Android then? I don't know much about it but the NDK docs seem to suggest that the provided C++ library is actually libc++. Does it work if you just remove the linking lines?
For Android to work properly, we should explicitly not link to anything.
The cc-rs crate handles linking to the C++ standard library if necessary, and that can be overridden with an environment variable, which we do in Parity's Android build.
It is unclear why building snappy-sys doesn't work on Linux/Mac without these lines. This needs investigating the code of cmake-rs.
Got it. In the meantime I can patch snappy-sys and rocksdb-sys to not explicitly link on Android. Does iOS have any restrictions as well?
Does iOS have any restrictions as well?
I don't know but I don't think so.