Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

arm-linux-gnueabi toolchain vs arm-linux-androideabi toolchain.

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?

like image 233
bolzano Avatar asked Mar 29 '14 15:03

bolzano


People also ask

What is arm linux Gnueabi?

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.

What is arm none linux Gnueabi?

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.

What is standalone toolchain?

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.

What is NDK toolchain?

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.


1 Answers

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.

like image 177
auselen Avatar answered Oct 13 '22 00:10

auselen