Building a cross-native toolchain to build on ARM-Android for ARM-Android

Rein Loopalu
Sun Dec 14 12:58:00 GMT 2014

So far I have managed to build a cross-compiler (builds on x86_64
Linux, targets ARM) with crosstool-ng, and if I compile a binary with
it while adding the -mandroid option (enables Bionic libc among other
things upon compilation, see and
giving --sysroot the location of an "usr" directory which contains
headers and libraries provided by Android NDK, the binary will indeed
work on Android.

I have also done the cross-native implementation steps for
scripts/ listed in here:

Now since Android uses Bionic libc I am figuring I will need to add
the -mandroid option somewhere. If I put it into the Extra build
compiler flags then the toolchain build will fail at 'Installing GMP
for build' with error 'could not find a working compiler'. If I put it
into Extra host compiler flags then it will fail at installing GMP for
host with same error. So I am thinking that perhaps hard-coding it
into the scripts somewhere might do the trick, or is it a lot more
complicated than that?

For unsubscribe information see

More information about the crossgcc mailing list