How to build avr-gcc using android NDK

698 views Asked by At

I want to build a IDE on android tablet that can compile c++ for AVR mcus like arduino uno. So I need to build a gcc that run on android and can cross compile AVR executable. Can any one give me some idea about how to do it? Thanks a lot.

Update:

I compile the toolchain using script from CC Tools with android NDK r9d source code on Linux and get the following error:

libtool: compile: /home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/build/host-gcc/./gcc/xgcc -shared-libgcc -B/home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/build/host-gcc/./gcc -nostdinc++ -L/home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/build/host-gcc/arm-linux-androideabi/libstdc++-v3/src -L/home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/build/host-gcc/arm-linux-androideabi/libstdc++-v3/src/.libs -B/home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/cctools-host/arm-linux-androideabi/bin/ -B/home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/cctools-host/arm-linux-androideabi/lib/ -isystem /home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/cctools-host/arm-linux-androideabi/include -isystem /home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/cctools-host/arm-linux-androideabi/sys-include -I/home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/src/gcc-4.8/libstdc++-v3/../libgcc -I/home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/build/host-gcc/arm-linux-androideabi/libstdc++-v3/include/arm-linux-androideabi -I/home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/build/host-gcc/arm-linux-androideabi/libstdc++-v3/include -I/home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/src/gcc-4.8/libstdc++-v3/libsupc++ -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=eh_arm.lo -g -Os -c /home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/src/gcc-4.8/libstdc++-v3/libsupc++/eh_arm.cc -o eh_arm.o /home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/src/gcc-4.8/libstdc++-v3/libsupc++/eh_arm.cc: In function '__cxxabiv1::__cxa_type_match_result __cxa_type_match(_Unwind_Control_Block*, const std::type_info*, bool, void**)':

/home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/src/gcc-4.8/libstdc++-v3/libsupc++/eh_arm.cc:67:46: error: cannot use typeid with -fno-rtti throw_type = &typeid(abi::__forced_unwind); ^

/home/jacx/cctools/cctools-read-only/cctools-repo/tmp/arm-repo/src/gcc-4.8/libstdc++-v3/libsupc++/eh_arm.cc:69:50: error: cannot use typeid with -fno-rtti throw_type = &typeid(abi::__foreign_exception);

Does any one knows how to resolve this issue?

1

There are 1 answers

0
UnanymousCoward On BEST ANSWER

You may want to look into CCTools, which offers an AVR cross compiler, instead of rolling out your own. Cheers.