Toolchain is build set to build Android Native code.

We decide version, architecture.

Toolchain is basically to build external library. If you prepare toolchain, you use this to build library easily.
And if you want to change build set(change version, architecture), change toolchain!


  1. Export NDK var(NDK path)
  2. Export SYSROOT var(Android ndk architecture dir)
  3. Create toolchain to use
  4. Add CC var
  5. Add toolchain path to PATH


My env is Linux Mint15. I already installed android NDK in /opt/android/
The version is android-ndk-r8e.

Export NDK var(NDK path)

export NDK=/opt/android/android-ndk-r8e

This is android ndk root path

Export SYSROOT var(Android ndk architecture dir)

export SYSROOT=$NDK/platforms/android-14/arch-arm

This is Android platform directory path(14 means Android4.0)

Create toolchain to use

$NDK/build/tools/ --platform=android-14 --install-dir=./ndk-toolchain

./ndk-toolchain is dst of toolchain.
If you succeed build, several files are created under ndk-toolchain(bin, arm-linux-androideabi, lib, include, etc…)

Linux x86

In my env, this error has occurred.
Host system ‘linux-86’ is not supported by the source NDK!

$NDK/build/tools/ --platform=android-14 --install-dir=./ndk-toolchain --system=linux-86_64

Please add –system=linux-86_64

Add CC(C), CXX(C++) var

export CC=arm-linux-androideabi-gcc
export CXX=arm-linux-androideabi-g++

This is name of gcc command

Add toolchain path to PATH

export PATH=$PATH:/home/toolchain./ndktoolchain/bin

Add toolchain bin directory path to PATH

Code Search
Android NDK Native Development Kit