Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

As seen here, compiling the Android kernel requires a prebuilt GCC toolchain (or the equivalent from the Android NDK). Cross-compilation makes sense; we are compiling code for a device with a different platform.

However, the guide to compiling the Android source does not anywhere require that one download a toolchain or NDK, and my understanding is that none of the tools used (SDK, etc.) contain a toolchain, either.

But of course compiling the source from scratch also builds the kernel. What's going on -- why do we need a gcc toolchain when building the kernel one way, but not the other?

share|improve this question
    
I'd guess that the answer is that as part of building the full thing, you're building the toolchain. Check if gcc source is part of it. –  derobert Jun 18 '13 at 20:57

1 Answer 1

up vote 3 down vote accepted

You need the gcc toolchain for both.

The toolchain is part of the android source tree. Before you build the entire android source, you use the "lunch" tool, which sets the environment variables such that a prebuilt toolchain can be used.

http://source.android.com/source/building-running.html#choose-a-target

The page about compiling the android kernel has different instructions because it assumes you want to build only a kernel and may not even download the entire android source tree. That's why it explains how to get and choose a toolchain in a manner different than through "lunch".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.