Android NDK Standalone GCC 4.6

Not entirely sure when Google started to include the GCC 4.6 sources.  I have first noticed it at the current NDK r8 when running the

You have to compile it yourself.  There are instructions out there but now that google is including it things have gotten easier.  These instructions only apply to Linux.  Specifically tested in Ubuntu 12.04.

  • sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl
  • Download NDK
  • Untar NDK to [SOME_LOCATION], using /opt/ndk/
  • Set NDK_ROOT=/opt/ndk/
  •  ./build/tools/ src/
  • Download MPC 0.9
  • Move mpc tar to ./src/mpc/
  • ./build/tools/ --gmp-version=4.3.2 --mpc-version=0.9 --mpfr-version=2.4.2 --binutils-version=2.21 $(pwd)/src $(pwd) arm-linux-androideabi-4.6
  • ./build/tools/ --gmp-version=4.3.2 --mpc-version=0.9 --mpfr-version=2.4.2 --binutils-version=2.21 $(pwd)/src $(pwd) x86-4.6
  • ./build/tools/ --gmp-version=4.3.2 --mpc-version=0.9 --mpfr-version=2.4.2 --binutils-version=2.21 $(pwd)/src $(pwd) mipsel-linux-android-4.6
  • (Patience)

Now you can generate a standalone toolchain for distribution:

  • ./build/tools/ --toolchain=arm-linux-androideabi-4.6 --platform=android-9 --install-dir=/opt/android-9_arm/
  • ./build/tools/ --toolchain=x86-4.6 --platform=android-9 --install-dir=/opt/android-9_x86/
  • ./build/tools/ --toolchain=mipsel-linux-android-4.6 --platform=android-9 --install-dir=/opt/android-9_mips/


Similar steps can be applied to MAC OS X however setting up the development environment is far more annoying.  I have a feeling this might be near impossible to pull off in Windows without jumping through major hoops.

0 comments on “Android NDK Standalone GCC 4.6

1 Pings/Trackbacks for "Android NDK Standalone GCC 4.6"

Leave a Reply