How to compile clang for use as a compiler for avr?

I would like to cross-compile clang for use as a compiler for avr (arduino to be more verbose). I feel like I should be doing something like the following:

  • create standalone toolchain from android ndk
  • compile with the correct CC and CXX parameters.

Smth yet? Does it support --target = avr or how can I compile? Does it make sense since it will be used as an IDE autocomplete tool for source analysis using the clang-c API?

UPDATE: configuration with the -host and -target options:

export CROSS_COMPILE=arm-linux-androideabi
export CC=${CROSS_COMPILE}-gcc
export CXX=${CROSS_COMPILE}-g++
export NDK=/softdev/android-ndk-r8e
export ANDROID_NDK_ROOT=/softdev/android-ndk-r8e
export SYSROOT=$NDK/platforms/android-8/arch-arm
export PATH=/softdev/arm-toolchain/bin:$PATH:/softdev/android-ndk-r8e/platforms/android-8/arch-arm

./configure --host=arm-linux-androideabi --target=arm-linux-androideabi --prefix=/softdev/arduinodroid_clang/arm
 make

... results in an error (Makefile exists):

llvm asmirnov$ sudo make
llvm[0]: Constructing LLVMBuild project information.
configure: error: Already configured in /Users/asmirnov/Documents/dev/src/llvm
make[1]: *** No targets specified and no makefile found.  Stop.
make: *** [cross-compile-build-tools] Error 1
+1
source share
2

LLVM AVR. , AVR, , .

backend LLVM .

+2

LLVM AVR- (. http://llvm.org/svn/llvm-project/llvm/trunk/lib/Target/AVR/). 2015 , - 2016 .

(2017-09-05) README.md , 8- Atmel AVR.

+1

Source: https://habr.com/ru/post/1544091/


All Articles