what is the purpose of different cross compilers in AOSP?

327 views
Skip to first unread message

Ramprakash Jelari

unread,
Mar 28, 2014, 5:23:45 AM3/28/14
to android-...@googlegroups.com

AOSP prebuilts directory contains the below.

./gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-gcc
./gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc
./gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/bin/x86_64-linux-gcc
./gcc/linux-x86/host/i686-linux-glibc2.7-4.6/bin/i686-linux-gcc

my understanding: Correct me if i m wrong?

 i686-linux-gcc    -> compiler that compiles for x86 - 32 bit target.
 86_64-linux-gcc   -> compiler that compiles for x86 - 64 bit target.
 arm-linux-androideabi-gcc  -> ?
 arm-eabi-gcc               ->  ?  

Dave Turvene

unread,
Mar 28, 2014, 3:04:09 PM3/28/14
to android-...@googlegroups.com
On Friday, March 28, 2014 5:23:45 AM UTC-4, Ramprakash Jelari wrote:

my understanding: Correct me if i m wrong?

 i686-linux-gcc    -> compiler that compiles for x86 - 32 bit target.
 86_64-linux-gcc   -> compiler that compiles for x86 - 64 bit target.
 arm-linux-androideabi-gcc  -> ?
 arm-eabi-gcc               ->  ?  

You're sort of right.  The linux host compilers are native: building on linux x86 and running on linux x86.  So target and host are the same architecture.  The ARM compilers are cross-compilers: building on linux x86 and running on ARM processors.  So the target is ARM architecture (of which there are 7+ distinctive processor families) and the host is, again, linux x86.

On top of that the AOSP also uses LLVM/Clang to build libraries to run the renderscript code on the target.  Effectively, one is cross-compiling a set of compiler libraries to run natively on ARM, if that makes any sense.

Ramprakash Jelari

unread,
Apr 1, 2014, 4:02:37 AM4/1/14
to android-...@googlegroups.com
Thanks for the reply. I understood the below is for arm target building on x86 host.  What is the difference then between these two below compilers?

arm-linux-androideabi-gcc  and  arm-eabi-gcc 

Jean-Baptiste Queru

unread,
Apr 1, 2014, 12:32:42 PM4/1/14
to android-...@googlegroups.com
IIRC, one is for the kernel and the other for user-space, since those use slightly different ABIs. I might be wrong.

JBQ

--

Jean-Baptiste M. "JBQ" Quéru
Architect, Mobile, Yahoo
--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Dave Turvene

unread,
Apr 1, 2014, 3:53:30 PM4/1/14
to android-...@googlegroups.com
On Tuesday, April 1, 2014 12:32:42 PM UTC-4, JBQ wrote:
IIRC, one is for the kernel and the other for user-space, since those use slightly different ABIs. I might be wrong.

JBQ


JBQ would know from his google days.  

I never thought about the different toolchains to tell you the truth.  I build the grouper kernel (I need DLKM support) and the AOSP using the arm-linux-androideabi-4.7 toolchain and everything runs fine.  BUT! http://source.android.com/source/building-kernels.html shows cloning an arm-eabi-4.6 toolchain.  

Still, it seems a little counter-intuitive to put the kernel tree in a different repo with instructions on how to clone the necessary toolchain but then include the kernel toolchain in the AOSP repo.

I just did a dumpspec on the two compilers.  There androideabi one has mno-android and tno-android variables.  The arm-eabi builds for more ARM architectures.  So maybe I was just lucky to have a google product. 
Reply all
Reply to author
Forward
0 new messages