Can I compile files (e.g. C or C++ source code) using for my android device using the arm-linux-gnueabi-*
toolchain?
My question might seem a bit silly, but will I get the same result as compiling with the arm-linux-androideabi-*
toolchain?
gcc-arm-linux-gnueabi is the cross-toolchain package for the armel architecture. This toolchain implies the EABI generated by gcc's -mfloat-abi=soft or -mfloat-abi=softfp options. gcc-arm-linux-gnueabihf is the cross-toolchain package for the armhf architecture.
arm-none-linux-gnueabi - This toolchain targets the ARM architecture, has no vendor, creates binaries that run on the Linux operating system, and uses the GNU EABI. It is used to target ARM-based Linux systems.
A toolchain which is ready to use with all the configuration that is the system headers and libraries in the correct path . For Android it will also have the API headers in the path where the toolchain can look it up.
The NDK provides the make_standalone_toolchain.py script to allow you to perform a customized toolchain installation from the command line. This is a new tool that replaces the old make-standalone-toolchain.sh . It has been reimplented in Python so that Windows users will not need to install Cygwin or MSYS to run it.
A compilation might mean more than just converting source code to binary. A compiler like GCC also provides certain libraries, in this case libgcc for handling what hardware can't handle. When a compiler becomes a toolchain, it also provides runtime libraries standardised by the programming language similar to ones provided in target system. In arm-linux-gnueabi-
's case that might be libc and for arm-linux-androideabi-
that's bionic.
You can produce compatible object files to be used by different compilers, that's what elf is for.
You can produce static executable which can be mighty in size and they should work on any matching hardware/kernel, because in that case toolchains aim for that.
But if you produce dynamic executables, those ones can only run on systems that's supporting their dependencies. Because of that a simple "hello world" application that's not static build by arm-linux-gnueabi-
won't work on an Android system since it provides bionic, not libc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With