问题
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