I'd like to cross-compile Clang for run on ARM devices and compile for ARM mcu (Cortex M3) or ATmega AVR mcus. Is Clang able to do it?
UPDATE: i've found llvm-avr backend for LLVM 3.5: https://github.com/sushihangover/llvm-avr
Is anyone except me interested?
Arm® Compiler for Embedded is based on Clang and LLVM compiler technology. The Arm Compiler for Embedded documentation describes features that are specific to, and supported by, Arm Compiler for Embedded.
Clang C++ can parse GCC 4.2 libstdc++ and generate working code for non-trivial programs, and can compile itself.
To compile a C++ program on the command line, run the clang++ compiler as follows: $ scl enable llvm-toolset-6.0 'clang++ -o output_file source_file ...' This creates a binary file named output_file in the current working directory. If the -o option is omitted, the clang++ compiler creates a file named a.
The Open-source LLVM toolchain for Arm processors supports the following features: LLVM core. Clang compiler. LLD linker.
For those interested, there is a currently active fork over here: https://github.com/dylanmckay/avr-llvm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With