Why does the NDK create a shared library for x86 with text movement even after setting the -fPIC flag?

I am using PJSIP / PJSUA2 with an Android project. I created the libpjsua2.so library for armeabi, armeabi-v7 and x86 with the -fPIC flag. Libraries are also linked statically with OpenSSL 1.0.2h, which were built with the -fPIC flag. All libs load correctly on the device from Android 4.4 to 6.0, with the exception of x86, which displays a text move error. Build script creates two versions of lib -

android-9 (for API level up to 15 and without x86) android-16 (for API level + 16 +)

Why on x86 does text move even with the -fPIC flag?

+4
source share
1 answer

Today I got the same error messages when testing my application with Android 7.0 on the Nexus 5 emulator. I solved the problem by changing targetSDKVersion to 22.

This is just a short-term solution.

0
source

Source: https://habr.com/ru/post/1257968/


All Articles