Original URL: http://blog.csdn.net/hxdanya/article/details/39371759
Since the NDK-compiled executables are called in the app, there has been no problem with versions 4.4 and earlier. Recently due to the test run on Android L found that when running the executable file, the following error is reported:
Error:only position independent executables (PIE) is supported.
The security mechanism for PIE was introduced from 4.1, but the system version before Android L did not verify that the executable was compiled based on PIE. So there is no error. However, Android L has turned on authentication and cannot run if the calling executable is not compiled based on pie. The solution is very simple, add the following flag to the ANDROID.MK.
LOCAL_CFLAGS += -pie -fPIELOCAL_LDFLAGS += -pie -fPIE
The
Go "ndk compiles the executable file in Android L to display error:only position independent executables (PIE) is supported. The solution to the failure problem.