Looking for some kind soul to explain some stuff to me.
I know that
This leads me to the following questions:
- LLVM / Clang does not offer a C standard library. Does that mean that in a standard Linux distribution with glibc, Clang defaults to building and linking software against glibc? And there is no option around this?
- When compiling most known FOSS software with cc=clang, cxx=clang++ and CXXFLAGS='-stdlib=libc++', am I right to say that Clang will use both glibc and libc++? (assuming that the source is able to build against libc++)
- Glibc supposedly supports both c and c++. What makes glibc so critical to a Linux distribution while libstdc++ isn't? And if glibc has both C and C++ functions, why do most software written in c++ build and link against libstdc++, and not glibc?
I know that
- GCC is the GNU compiler collection. Its most widely used components are gcc and g++.
- LLVM is a collection of compiler and toolchain technologies. It has Clang / Clang++ as drop-in replacements for gcc and g++.
- Glibc is the GNU C standard library that comes standard in Linux.
- Libstdc++ is the GNU standard C++ library that comes standard in Linux
- Libc++ is LLVM/Clang's standard C++ library
- Glibc is a basic component for any Linux distribution and cannot be simply upgraded at whim or it breaks the entire distribution.
This leads me to the following questions:
- LLVM / Clang does not offer a C standard library. Does that mean that in a standard Linux distribution with glibc, Clang defaults to building and linking software against glibc? And there is no option around this?
- When compiling most known FOSS software with cc=clang, cxx=clang++ and CXXFLAGS='-stdlib=libc++', am I right to say that Clang will use both glibc and libc++? (assuming that the source is able to build against libc++)
- Glibc supposedly supports both c and c++. What makes glibc so critical to a Linux distribution while libstdc++ isn't? And if glibc has both C and C++ functions, why do most software written in c++ build and link against libstdc++, and not glibc?
Last edited:

