Clone this repo:
  1. 0c5a656 Disable linker PIE support with copy reloc. by Rahul Chaudhry · 9 days ago master
  2. fe94879 Add an OWNERS file for GCC. by Caroline Tice · 11 days ago
  3. 32c89c1 Fix GCC bug PR 46639, for kernel security by Caroline Tice · 6 months ago ndk-r15-release ndk-r15-beta1 ndk-r15-beta2
  4. c82a251 [GCC] Add '--disable-multilib' to gcc configuration. by Caroline Tice · 6 months ago
  5. 41f3e25 fix errors in gcc compiler wrapper. by Yunlian Jiang · 10 months ago ndk-r14-release ndk-r14 ndk-r14-beta1 ndk-r14-beta2

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