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?

  • 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, 2013 at 20:57

1 Answer 1


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.


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".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .