Comparing GCC and LLVM
Compilers such as GCC must be built with a special configuration to support cross compilation, requiring the installation of a different GCC for each target. A common practice, for example, is to prefix your gcc
command with the target name, such as arm-gcc
to denote a GCC cross-compiler for ARM. However, Clang/LLVM allows you to generate code for other targets by simply switching the command-line options of the same Clang driver between the desired target, paths to libraries, headers, the linker, and the assembler. One Clang driver, therefore, works for all targets. However, some LLVM distributions do not include all the targets owing to, for example, executable size concerns. On the other hand, if you build LLVM yourself, you get to choose which targets to support; see Chapter 1, Build and Install LLVM.
GCC is a much older, and subsequently, a more mature project than LLVM. It supports more than 50 backends and is widely utilized as a cross-compiler for these platforms...