[cfe-dev] Using clang for cross-compiling to Cortex M4

Olivier Martin via cfe-dev cfe-dev at lists.llvm.org
Fri Nov 20 05:09:25 PST 2015


I have just added C++ (see 
https://github.com/labapart/polymcu/blob/master/Application/Examples/BaremetalCpp/main.cpp) 
support to PolyMCU (https://github.com/labapart/polymcu).
PolyMCU is an Open Source firmware framework that is based on CMake that 
supports GCC and LLVM. It primarily targets ARM Cortex-M (even if I hope 
to add other architectures in the future). Because it is based on CMake 
you can build your firmware on Linux/Windows/MacOS.
It also uses Newlib and supports Baremetal/CMSIS RTOS (RTX)/FreeRTOS.

I also wrote a blog where I compared GCC and LLVM build size on ARM 
Cortex-M: 
http://labapart.com/blogs/3-the-importance-of-the-toolchain-version-in-embedded-space
Interesting results, Clang generated code is not much bigger than GCC on 
Cortex-M...



More information about the cfe-dev mailing list