问题
I'm using PJSIP/PJSUA2 with Android project. I've built libpjsua2.so shared library for armeabi, armeabi-v7 and x86 with -fPIC flag. The libs are also linked with OpenSSL 1.0.2h statically which were built with -fPIC flag. All libs loads properly on device with Android 4.4 to 6.0 except x86 in which it shows text relocation error. Build script builds two versions of the lib-
android-9 (for API level upto 15 and no x86) android-16 (for API level 16+)
Why on x86, text relocation is occurring even with -fPIC flag?
回答1:
Today, I got the same error messages when testing my app with Android 7.0 on a Nexus 5 Emulator. I solved my issue by changing the targetSDKVersion to 22.
This is just a short term workaround..
来源:https://stackoverflow.com/questions/38434510/why-is-ndk-generating-shared-library-for-x86-with-text-relocation-even-after-set