Search code examples
c++linuxgccarm

Difference between the GNU ARM Embedded Toolchain and normal gcc/g++ with bare metal ARM architecture


I have been using the GNU ARM Embedded Toolchain for a while and compiling my embedded C++ code using arm-none-eabi-g++, because it is what we did in my embedded systems university courses. For my computer science courses we used just g++ to compile C++ code. I have been poking around the GCC manual and found that there are ARM architecture compilation options for GCC. My question is what is the difference between using arm-none-eabi-g++binary provided by ARM and g++ with the -mcpu=cortex-m4 -march=armv7compile option for cross-compiling? It appears you can cross-compile for ARM using gcc (gcc that comes with Ubuntu).


Solution

  • I think I figured it out. So using GCC you can build a cross compiler and an associated toolchain. ARM built their own cross compiler and put it up for people to use as the "Official GNU ARM Embedded Toolchain". It's basically a meta "I used the compiler to build the compiler problem". The options -mcpu=cortex-m4 -march=armv7 I was seeing was for targeting architectures when building GCC, not to be when compiling.