Clone this repo:
  1. e46354e Fix gcc 4.8.3 makeinfo build failure by Ryan Prichard · 3 weeks ago master
  2. 2cdcfd3 [GCC] Fix #endif problem in libgcc/emutls.c by Caroline Tice · 6 weeks ago
  3. d64d815 [GCC] Update with latest retpoline fixes from Intel. by Caroline Tice · 7 weeks ago
  4. 430f438 Merge "[libgcc] Fix emutls.c to not leak pthread keys." by Caroline Tice · 8 weeks ago ndk-release-r17
  5. 4693620 [libgcc] Fix emutls.c to not leak pthread keys. by Caroline Tice · 8 weeks ago

Building GCC for Android

The following process is used to build the GCC that is used by both the Android platfrom and the NDK.

Both Linux and Windows toolchains are built on Linux machines. Windows host binaries are built with mingw. Building binaries for Mac OS X should be built using 10.8 to ensure compatibility with Android's minimum supported hosts.


  • Android GCC Repository

    • Check out the branch gcc

      repo init -u -b gcc
      # Googlers, use
      repo init -u \
          persistent- \
          -b gcc
  • Additional Linux Dependencies (available from apt):

    • texinfo
    • gcc-mingw32
    • bison
    • flex
    • libtool
  • Mac OS X also requires Xcode.

Host/Target prebuilts

For Linux or Darwin:

# Additional options and toolchain names will be show with --help.
$ python --toolchain TOOLCHAIN_NAME

For Windows, from Linux:

$ python --system windows TOOLCHAIN_NAME