LLVM-CONFIG(1)

πŸ’– LLVM-CONFIG(1) πŸ’–

okay bestie, welcome to the llvm-config page β€” that's the LLVM manual, section 1, and she's here to spill all the compiler tea β˜•βœ¨


✨ NAME ✨

llvm-config β€” prints out all your LLVM compilation options, no cap 🫢


🌸 SYNOPSIS 🌸

llvm-config option [components...]

πŸ¦‹ DESCRIPTION πŸ¦‹

So like, llvm-config is literally the bestie that makes building apps on top of LLVM so much easier πŸ’…. She will print you the compiler flags, the linker flags, and the object libraries you need to link against LLVM. That's it. That's the whole job. And she ate. πŸ”₯


πŸŽ€ EXAMPLES πŸŽ€

Say you wanna link against the JIT β€” here's the vibe:

g++ `llvm-config --cxxflags` -o HowToUseJIT.o -c HowToUseJIT.cpp
g++ `llvm-config --ldflags` -o HowToUseJIT HowToUseJIT.o \
    `llvm-config --libs engine bcreader scalaropts`

look at her go, backtick substitution queen πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • --assertion-mode β€” tells you the assertion mode LLVM was built with, either ON or OFF 🫑
  • --bindir β€” prints where the LLVM binaries live on your system 🏠
  • --build-mode β€” what build mode was LLVM built with? like Debug or Release and such 🌈
  • --build-system β€” prints the build system that built LLVM, e.g. cmake or gn πŸ› οΈ
  • --cflags β€” the C compiler flags you need to use LLVM's headers πŸ’–
  • --cmakedir β€” where the LLVM CMake modules got installed πŸ“
  • --components β€” prints every single valid component name, the whole roster πŸ‘‘
  • --cppflags β€” the C preprocessor flags you need for LLVM's headers 🧚
  • --cxxflags β€” the C++ compiler flags you need for LLVM's headers ✨
  • --has-rtti β€” was LLVM built with rtti or not? answers YES or NO, no in-between πŸ’€
  • --help β€” a lil summary of all the llvm-config arguments, your cheat sheet πŸ“
  • --host-target β€” the target triple that configured LLVM 🎯
  • --ignore-libllvm β€” skip libLLVM and link the component libraries instead πŸ™ˆ
  • --includedir β€” where the LLVM headers got installed πŸ“‚
  • --ldflags β€” the flags you need to link against LLVM libraries πŸ”—
  • --libdir β€” where the LLVM libraries got installed πŸ—‚οΈ
  • --libfiles β€” basically --libs but it prints the full path to every library file. super useful for makefile dependencies, so a tool gets relinked whenever any library it uses changes πŸ‘€
  • --libnames β€” also like --libs but it prints just the bare filenames, no -l and no pathnames. perfect when you're linking against a copy of LLVM that isn't installed yet 🐣
  • --libs β€” every library you need to link against the components you asked for, dependencies included 🎁
  • --link-shared β€” link those components as shared libraries 🌊
  • --link-static β€” link the component libraries statically 🧱
  • --obj-root β€” the object root used to build LLVM πŸ—οΈ
  • --prefix β€” the installation prefix for LLVM πŸ“
  • --shared-mode β€” prints how the components you gave her can be linked together as a group (shared or static) 🀝
  • --system-libs β€” all the system libraries needed to link against your components, dependencies included πŸ–₯️
  • --targets-built β€” the component names of every target this copy of LLVM supports 🌍
  • --version β€” the LLVM version number, obviously πŸ’œ

🌈 COMPONENTS 🌈

Wanna see every available component? just run llvm-config --components and she'll list them all for you 🫢

Most of the time components map directly onto LLVM libraries. But there are some "virtual" components that are lowkey iconic:

  • all β€” includes every LLVM library. this is the default if you don't name any components at all πŸ’«
  • backend β€” includes either a native backend or the C backend 🧠
  • engine β€” includes either a native JIT or the bitcode interpreter βš™οΈ

🚦 EXIT STATUS 🚦

If llvm-config succeeds, she exits with 0 β€” slay πŸ’–

Otherwise, if an error happens, she exits with a non-zero value 😭


πŸ‘‘ AUTHOR πŸ‘‘

Maintained by the LLVM Team (https://llvm.org/). icons only.


2003-2025, LLVM Project


and that's the whole page bestie!! this one's llvm-config from the LLVM manual, page 20, dated 2025-09-03 β€” mwah, go build something gorgeous πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from