LLVM-CONFIG(1)

🌸 NAME 🌸

llvm-config β€” print LLVM compilation options. Bestie, welcome to the LLVM-CONFIG(1) page from the LLVM manual; this tool is lowkey the build-info queen. πŸ’…

✨ SYNOPSIS ✨

llvm-config option [components...]

πŸ’– DESCRIPTION πŸ’–

llvm-config makes it easier to build applications that use LLVM. It can print the compiler flags, linker flags and object libraries needed to link against LLVM. It’s giving β€œpersonal assistant for your build system,” no cap. 🫢

🫢 EXAMPLES 🫢

Wanna link against the JIT? Periodt, 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`

πŸ‘‘ OPTIONS πŸ‘‘

  • --assertion-mode β€” prints the assertion mode used when LLVM was built (ON or OFF). A literal vibe check for assertions. ✨
  • --bindir β€” prints the installation directory for LLVM binaries.
  • --build-mode β€” prints the build mode used when LLVM was built (e.g. Debug or Release).
  • --build-system β€” prints the build system used to build LLVM (e.g. cmake or gn).
  • --cflags β€” prints the C compiler flags needed to use LLVM headers.
  • --cmakedir β€” prints the installation directory for LLVM CMake modules.
  • --components β€” prints all valid component names. It’s the full menu, bestie. πŸ“
  • --cppflags β€” prints the C preprocessor flags needed to use LLVM headers.
  • --cxxflags β€” prints the C++ compiler flags needed to use LLVM headers.
  • --has-rtti β€” prints whether or not LLVM was built with rtti (YES or NO).
  • --help β€” prints a summary of llvm-config arguments. When in doubt, ask for help, queen. πŸ‘‘
  • --host-target β€” prints the target triple used to configure LLVM.
  • --ignore-libllvm β€” ignore libLLVM and link component libraries instead.
  • --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 prints the full path to each library file. This is useful when creating makefile dependencies, to ensure that a tool is relinked if any library it uses changes. Very β€œkeep it fresh” of it. πŸ”₯
  • --libnames β€” similar to --libs, but prints the bare filenames of the libraries without -l or pathnames. Useful 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.
  • --link-shared β€” link the components as shared libraries.
  • --link-static β€” link the component libraries statically.
  • --obj-root β€” prints the object root used to build LLVM.
  • --prefix β€” prints the installation prefix for LLVM.
  • --shared-mode β€” prints how the provided components can be collectively linked (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.

🧚 COMPONENTS 🧚

To print a list of all available components, run llvm-config --components. In most cases, components correspond directly to LLVM libraries. Useful β€œvirtual” components include:

  • all β€” includes all LLVM libraries. The default if no components are specified.
  • 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 will exit with 0. Otherwise, if an error occurs, it will exit with a non-zero value. So 0 is the slay, and non-zero is the β€œsomething’s off, bestie” moment. 😭

πŸ’œ Author πŸ’œ

Maintained by the LLVM Team (https://llvm.org/). They’re the main characters behind this whole thing. πŸ‘‘

2003-2026, LLVM Project β€” iconic run, honestly. πŸŽ€

Cute sign-off: this page is from LLVM 15, dated 2026-09-09, and it’s the LLVM-CONFIG(1) manual. Byeee πŸ’…

πŸ“¦ where this page comes from