LLVM-CONFIG(1)

πŸ“¦
version 16.0.6 Β· 3 versions
, in ubuntu noble

✨ LLVM-CONFIG ✨

okay bestie, welcome to the llvm-config page from the LLVM manual (section 1, for the record πŸ’…). it's the little tool that tells you exactly what flags you need so you can build stuff against LLVM. no cap. let's go πŸ¦‹


🌸 NAME 🌸

llvm-config β€” print LLVM compilation options


πŸŽ€ SYNOPSIS πŸŽ€

llvm-config option [components…]

πŸ’– DESCRIPTION πŸ’–

llvm-config makes it easier to build applications that use LLVM. like, so much easier. it can print the compiler flags, the linker flags and the object libraries you need to link against LLVM. that's the whole vibe. 🫢


🌈 EXAMPLES 🌈

say you wanna link against the JIT. iconic. here's the move:

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. beautiful. ate. πŸ’…


✨ OPTIONS ✨

  • --assertion-mode β€” prints the assertion mode that was used when LLVM got built (ON or OFF).
  • --bindir β€” prints the installation directory where the LLVM binaries live.
  • --build-mode β€” prints the build mode LLVM was built with (think Debug or Release).
  • --build-system β€” prints the build system that built LLVM (like cmake or gn).
  • --cflags β€” prints the C compiler flags you need to use the LLVM headers.
  • --cmakedir β€” prints the installation directory for the LLVM CMake modules.
  • --components β€” prints every valid component name. the full roster. πŸ‘‘
  • --cppflags β€” prints the C preprocessor flags you need for the LLVM headers.
  • --cxxflags β€” prints the C++ compiler flags you need for the LLVM headers.
  • --has-rtti β€” prints whether LLVM was built with rtti or not (YES or NO).
  • --help β€” prints a lil summary of all the llvm-config arguments.
  • --host-target β€” prints the target triple that was used to configure LLVM.
  • --ignore-libllvm β€” ignore libLLVM and link the component libraries instead.
  • --includedir β€” prints the installation directory for the LLVM headers.
  • --ldflags β€” prints the flags needed to link against the LLVM libraries.
  • --libdir β€” prints the installation directory for the LLVM libraries.
  • --libfiles β€” basically --libs but it prints the full path to each library file. this one is the moment when you're making makefile dependencies, so that a tool gets relinked if any library it uses changes. ✨
  • --libnames β€” again like --libs, but it prints the bare filenames of the libraries, no -l, no pathnames. lowkey perfect for linking against a not-yet-installed copy of LLVM.
  • --libs β€” prints all the libraries you need to link against the specified LLVM components, dependencies included. the whole squad. 🫢
  • --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 you need to link against the specified LLVM components, dependencies included.
  • --targets-built β€” prints the component names for every target this copy of LLVM supports.
  • --version β€” prints the version number of LLVM.

πŸ¦‹ COMPONENTS πŸ¦‹

wanna see the whole list of available components? just run llvm-config --components. in most cases, components correspond directly to LLVM libraries. but the "virtual" components? those are the useful ones, periodt:

  • all β€” includes all LLVM libraries. this is the default if you don't specify any components.
  • 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. if something goes wrong and an error happens, it exits with a non-zero value. so like, check that number, bestie. πŸ™ˆ


🧚 AUTHOR 🧚

maintained by the LLVM Team (https://llvm.org/). slay.


2003-2024, LLVM Project


and that's the whole page!! πŸ’– this was LLVM version 15, dated 2024-04-14, straight from the LLVM-CONFIG(1) manual. go forth and link something iconic. bye bestie πŸŽ€βœ¨
πŸ“¦ where this page comes from