Does LLVM (Clang) ever use GCC?

Viewed 1031

There are "sayings" on the web that LLVM (Clang) is built with GCC compatibility in mind and that it uses many of GCC's tools to compile code. However that does not make sense; isn't Clang a more advanced replacement for GCC? So straight to the point, does Clang use GCC at all? Are they related?

1 Answers

Depending on how it is configured, clang can use gcc components, e.g: to retain compatibility. Clang, just like gcc, is a compiler, and a compiler frontend. Strictly speaking, a C++ compiler does not link code, the linker does it. Clang can use either gnu ld, gold, lld or others. Those are all linkers, some part of the gcc toolchain. A compiler also needs a standard library, clang can use libstdc++, libc++ or others. libstdc++ is part of the gcc toolchain, and a popular option to remain compatible with other system wide components.

Related