LLVM-CONFIG(1)

πŸ’… llvm-config β€” like, your ✨personal LLVM hype squad✨

okay so bestie, this is llvm-config, and it lives in the LLVM manual, and honestly? it's the friend who always knows the answer and never makes you feel dumb for asking. 🫢


🌸 NAME 🌸

llvm-config β€” prints out LLVM compilation options, aka it tells you exactly what flags you need so you don't have to guess (and we do not guess, not on my watch πŸ’…).


πŸŽ€ SYNOPSIS πŸŽ€

llvm-config option [components...]

like, you give it an option, you optionally give it some components, and it gives you the info. that's the whole vibe. periodt.


✨ DESCRIPTION ✨

okay so llvm-config makes it so much easier to build applications that use LLVM, which is lowkey a lifesaver because LLVM does not come to play about flags. 😭

it can print the compiler flags, the linker flags, and the object libraries you need to link against LLVM. that's it, that's the job, and it does it flawlessly. πŸ‘‘


πŸ¦‹ EXAMPLES πŸ¦‹

say you wanna link against the JIT, bestie β€” here's the whole thing, and yes you can copy it:

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 those backticks doing their little command-substitution dance. iconic. 🌈


πŸ’œ OPTIONS πŸ’œ

here we go, the full lineup β€” every single one, no skips, no skimming, we don't do that here:

  • --assertion-mode β€” prints the assertion mode used when LLVM was built, which is either ON or OFF. simple as that.
  • --bindir β€” prints the installation directory for the LLVM binaries. πŸ“
  • --build-mode β€” prints the build mode used when LLVM was built (think Debug or Release, yk how it is).
  • --build-system β€” prints the build system used to build LLVM (like cmake or gn, no judgment on either).
  • --cflags β€” prints the C compiler flags you need to use LLVM headers. 🧚
  • --cmakedir β€” prints the installation directory for LLVM CMake modules.
  • --components β€” prints all the valid component names. the full roster, the whole cast. ✨
  • --cppflags β€” prints the C preprocessor flags needed to use LLVM headers.
  • --cxxflags β€” prints the C++ compiler flags needed to use LLVM headers. C++ girlies rise. πŸ’–
  • --has-rtti β€” prints whether or not LLVM was built with rtti β€” YES or NO, brutally honest.
  • --help β€” prints a summary of llvm-config arguments. when in doubt, ask for help, we love that here. 🫢
  • --host-target β€” prints the target triple used to configure LLVM.
  • --ignore-libllvm β€” ignore libLLVM and link component libraries instead. boundary-setting behavior, honestly.
  • --includedir β€” prints the installation directory for LLVM headers.
  • --ldflags β€” prints the flags needed to link against LLVM libraries.
  • --libdir β€” prints the installation directory for LLVM libraries.
  • --libfiles β€” similar to --libs, but it prints the full path to each library file. super useful when you're making makefile dependencies, because it makes sure a tool gets relinked if any library it uses changes. no stale builds, no cap. 🎯
  • --libnames β€” similar to --libs, but prints the bare filenames of the libraries, without -l or pathnames. great for linking against a not-yet-installed copy of LLVM. πŸ’…
  • --libs β€” prints all the libraries needed to link against the specified LLVM components, including any dependencies. the whole package.
  • --link-shared β€” links the components as shared libraries.
  • --link-static β€” links the component libraries statically.
  • --obj-root β€” prints the object root used to build LLVM.
  • --prefix β€” prints the installation prefix for LLVM.
  • --quote-paths β€” quotes and escapes paths when needed β€” most notably when a quote, space, backslash or dollar sign character is present in the path. those lil gremlin characters, handled. πŸ™ˆ
  • --shared-mode β€” prints how the provided components can be collectively linked, either shared or static.
  • --system-libs β€” prints all the system libraries needed to link against the specified LLVM components, including any dependencies.
  • --targets-built β€” prints the component names for all targets supported by this copy of LLVM. 🎯
  • --version β€” prints the version number of LLVM. the humble flex.

πŸ“ COMPONENTS πŸ“

wanna see the whole list of available components? run llvm-config --components and it'll spill everything. πŸ’–

in most cases, components correspond directly to LLVM libraries. and there are these extremely useful "virtual" components, which are giving main character energy:

  • all β€” includes all LLVM libraries. this is the default if you don't specify any components, so if you're lazy (same) it's got you.
  • 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, it exits with 0. slay.
  • otherwise, if an error occurs, it exits with a non-zero value. 😭 it happens to the best of us.

πŸ‘‘ AUTHOR πŸ‘‘

maintained by the LLVM Team (https://llvm.org/) β€” absolute legends, we stan. 🫢


2003-2026, LLVM Project


and that's the whole page bestie β€” page 23, dated 2026-10-06, straight from the LLVM source. go build something iconic with it πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from