LLVM-CONFIG(1)

πŸ“¦
version 12.0.1 Β· 4 versions
, in fedora 43, fedora 44

πŸ’– LLVM-CONFIG πŸ’–

okay bestie, sit down, hydrate, because this is the llvm-config page from the LLVM manual (yes, section 1, the good section) and it's literally your new best friend for building stuff against LLVM. 🫢


✨ NAME ✨

llvm-config β€” it prints LLVM compilation options for you. that's the whole job. it's giving personal assistant but for compiler flags. πŸ’…


🌸 SYNOPSIS 🌸

llvm-config option [components...]

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: llvm-config makes building applications that use LLVM so much easier, no cap. it can print out the compiler flags, the linker flags, and the object libraries you need to link against LLVM. that's it. that's the whole girl. πŸ‘‘


🌈 EXAMPLES 🌈

say you wanna link against the JIT (iconic choice btw), you'd do:

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 that backtick action. we love a command substitution moment. ✨


πŸŽ€ OPTIONS πŸŽ€

one bullet per flag, as the universe intended:

  • --version β€” prints the version number of LLVM. the "who even am i" flag. πŸͺž
  • -help β€” prints a summary of llvm-config arguments. your lil cheat sheet. πŸ’–
  • --prefix β€” prints the installation prefix for LLVM.
  • --src-root β€” prints the source root from which LLVM was built.
  • --obj-root β€” prints the object root used to build LLVM.
  • --bindir β€” prints the installation directory for LLVM binaries.
  • --includedir β€” prints the installation directory for LLVM headers.
  • --libdir β€” prints the installation directory for LLVM libraries.
  • --cxxflags β€” prints the C++ compiler flags needed to use LLVM headers. these are the "please find my includes" flags. 🧚
  • --ldflags β€” prints the flags needed to link against LLVM libraries.
  • --libs β€” prints all the libraries needed to link against the specified LLVM components, including any dependencies. she's thorough. she does the homework. πŸ“š
  • --libnames β€” similar to --libs, but prints the bare filenames of the libraries, without -l or pathnames. super useful for linking against a not-yet-installed copy of LLVM. πŸ“
  • --libfiles β€” similar to --libs, but prints the full path to each library file. this is the one you want when making makefile dependencies, so a tool gets relinked if any library it uses changes. highkey essential. πŸ”₯
  • --components β€” prints all valid component names.
  • --targets-built β€” prints the component names for all targets supported by this copy of LLVM.
  • --build-mode β€” prints the build mode used when LLVM was built (e.g. Debug or Release). πŸ‘€

🧚 COMPONENTS 🧚

to print a list of all available components, just run llvm-config --components. easy.

in most cases, components correspond directly to LLVM libraries. but there are some useful "virtual" components too, and they're lowkey the main characters:

  • all β€” includes all LLVM libraries. this is the default if you don't specify any components. (she does everything, no notes. πŸ’…)
  • 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. πŸŽ‰

otherwise, if an error occurs, it exits with a non-zero value. 😭

heads up bestie: a non-zero exit means something went wrong β€” check it in your scripts, fr fr.

πŸ’œ AUTHOR πŸ’œ

maintained by the LLVM Team (https://llvm.org/). they're the parents of this whole situation. 🫢


2003-2024, LLVM Project


and that's the page!! ok bye, this was LLVM llvm-config, manual page version 12, dated 2024-07-18 β€” slay, periodt, go compile something gorgeous. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from