Stack Exchange
How and where does clang use llvm?
When using command like this:
clang -### -O3 -a.c

And then, it will output the followings:
clang version 1.1 (branches/release_27)
Target: x86_64-unknown-linux-gnu
Thread model: posix
 "/tensorflow/bin/llvm+clang-2.7/bin/clang" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-S" "-disable-free" "-main-file-name" "a.c" "-mrelocation-model" "static" "-mdisable-fp-elim" "-mconstructor-aliases" "-munwind-tables" "-target-cpu" "x86-64" "-resource-dir" "/tensorflow/bin/llvm+clang-2.7/lib/clang/1.1" "-O3" "-fmessage-length" "141" "-fgnu-runtime" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-o" "/tmp/cc-w9Hpfd.s" "-x" "c" "a.c"
 "/usr/bin/gcc" "-O3" "-c" "-m64" "-o" "/tmp/cc-8haDzc.o" "-x" "assembler" "/tmp/cc-w9Hpfd.s"
 "/usr/bin/gcc" "-O3" "-m64" "-o" "a.out" "/tmp/cc-8haDzc.o"

So, we can see that the early version of llvm(llvm-2.7) uses gcc's assembler and linker.
But how, when and where, clang uses llvm?
Does clang use llvm in clang -cc1?
How to prove it? (Either documentation or command line output can be the evidence. But I can not find it.)
I think llvm+clang is a flexible toochain, I can find many ways to generate an executable from a C program.
Thanks in advance.

Clang uses LLVM as a library, i.e. the LLVM is part of the clang executable.

@AlexDenisov Out of curiosity, is it literally statically linked?

FYI: You can use either nm and/or ldd to answer this type of question foa almost any tool.

@JoseFernandoLopezFernandez It depends on the build: it can either be linked statically or dynamically.

Use:
clang -v -o demo a.c

-v gives you a lot information, including the llvm version used in /usr/lib
