I have two options to compile:
- Cross-compile using an
amd64
Ubuntu or Debian system forarmhf
package compilation. - Run an
armhf
image of Ubuntu or Debian in QEMU.
The problem I have is that when using cross compilation, the compilation fails because the source packages have been compiled using GCC 4.8 and the version that I have installed for cross compilation is GCC 4.9.
For this reason I opted to build directly from a Ubuntu or Debian armhf
image in QEMU.
Now, the final problem and the reason why I am asking the question here is the following:
I have seen and tested that some people has been build Python, modules and executable binaries for Android, I currently have Python 2 and Python 3 installed, I have root access on my tablet, I can run commands like
python -c 'print("hello world!")'
I can also run Python scripts just fine like
python myscript.py
They used the following flags to compile python:
./configure --build=arm --prefix="$PWD"/out LDFLAGS="-static -static-libgcc -Wl,--unresolved-symbols=ignore-all -Wl,--export-dynamic" CPPFLAGS=-static CXXFLAGS=-static CFLAGS="-Os -static" LDFLAGS=-static LD=ld.gold
Unfortunately I have not been successful, I tried to compile the Debian zip
package with the following commands and it did not work.
apt-get build-dep zip
apt-get source zip
cd zip-3.0
export CFLAGS=-static
export LDFLAGS=-static
export CPPFLAGS=-static
dpkg-buildpackage -rfakeroot -uc -b
After compiling the package, a .deb
package is generated, from which I extract all the binaries and executables to later install them manually on my tablet, preserving the directories correctly, granting the appropriate permissions using chmod
and chown
and creating the symbolic links so that they have a connection with their corresponding libraries, since Android uses a slightly different directory structure.
But it doesn't work. Everything is compiled and the package is generated, then when I do the installation process mentioned above, I restart the tablet and run the command in this case zip
to see if it is already working, the result is no, since I get an error saying "No such file or directory".
Running command -v zip
shows that the file exist, it is correctly installed and the permissions are correct. I should at least get an error, for example "error: somelib .so not found" if it had at least been compiled correctly, since some dependencies has not been compiled yet, but not.
uname -m
outputs me armv7l
.
Any solution?