Issue including executable with Android application when using Jelly Bean

吃可爱长大的小学妹 提交于 2019-12-13 02:26:31

问题


I have ported a few useful free/open source tools to Android. One is Octave and the other is gnuplot. They work together in unison to provide Matlab like capability for free (as in speech) and free (as in beer). I have packed them inside apps in an interesting way. Specifically,

1) I include the executable and shared libraries inside the libs/armeabi directory. Have to give them funny name because of android naming conventions.

2) I create directories bin/ and mylib/. I give them full permissions.

3) I create links from bin/ to the executable in the unpacked lib/ directory. I give them the correct names and full permissions.

4) I create links from mylib/ to the shared libaries in the unpacked lib/ directory. I give them the correct names and full permissions.

5) I then use ld-linux.so.3 which is one of the libraries now in the mylib/ directory and the--library-path option to point at the mylib/ directory to launch the executable from the Android Terminal Emulator.

Octave works perfectly in all version of Android doing this, but gnuplot gives this error when I attempt to launch it when running Jelly Bean only:

error while loading shared libraries: gnuplot: failed to map segment 
from shared object: Operation not permitted.

So, why would I have this error for one of these two executables made the same way? Why only in Jelly Bean? Also, on JB, if I make myself the super user, it all works again.

Any thoughts on how to debug? I have confirmed that all files are there and have the permissions that I intended they have.

Please help. You would be helping a free, open source, educational and useful app if you do.


回答1:


The issue was with how the executables were compiled. They needed to be compiled with a cross compiler that properly supported newer arm devices. The compiler I used generated executables that would only work on a subset of arm devices. The issue was not with the different versions of android.



来源:https://stackoverflow.com/questions/13467951/issue-including-executable-with-android-application-when-using-jelly-bean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!