LLVM-CONFIG(1)
π NAME π
llvm-config β it prints LLVM compilation options, and honestly? It's the little helper that makes linking against LLVM not a whole nightmare. Welcome to the LLVM-CONFIG(1) era, bestie. π«Ά
π¦ SYNOPSIS π¦
llvm-config option [componentsβ¦]
β¨ DESCRIPTION β¨
okay so, llvm-config exists to make building applications that use LLVM so much easier. Like, it's giving personal assistant energy. π
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 job. And it ate. π₯
π EXAMPLES π
Say you wanna link against the JIT. Bestie, 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 those backticks doing their little shell substitution dance. Iconic. β¨
π OPTIONS π
okay so here's the full menu, no skips, no skimming, we're listing everything:
--versionβ prints the version number of LLVM.-helpβ prints a lil summary of thellvm-configarguments, for when you forgot what you were doing (real).--prefixβ prints the installation prefix for LLVM.--src-rootβ prints the source root that LLVM was built from.--obj-rootβ prints the object root that was 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 you need to use LLVM headers.--ldflagsβ prints the flags you need to link against LLVM libraries.--libsβ prints all the libraries you need to link against the LLVM components you specified, dependencies included. It does the whole dependency tree for you, no cap. π--libnamesβ basically--libs's sibling, but it prints the bare filenames of the libraries, with no-land no pathnames. Perfect when you're linking against a not-yet-installed copy of LLVM.--libfilesβ again like--libs, but it prints the full path to each library file. This one's your bestie when you're writing makefile dependencies, because it makes sure a tool gets relinked if any library it uses changes. Obsessed. π--componentsβ prints all valid component names.--targets-builtβ prints the component names for every target this copy of LLVM supports.--build-modeβ prints the build mode that was used when LLVM was built (like Debug or Release).
π§ COMPONENTS π§
Wanna see every available component? Just run llvm-config --components and let it spill. In most cases, components line up directly with LLVM libraries.
But there are also some useful βvirtualβ components, and these ones are lowkey the main characters:
allβ includes all LLVM libraries. This is the default if you don't specify 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, it exits with 0. Slay.
Otherwise, if an error happens, it exits with a non-zero value. Not slay. π
πΈ AUTHOR πΈ
Maintained by the LLVM Team (https://llvm.org/). They're the parents fr fr.
π COPYRIGHT π
2003-2025, LLVM Project
okay that's the whole page, bestie π that was the LLVM-CONFIG(1) manual, page 14, dated 2025-05-22, straight from LLVM. go forth and link things. periodt. π
β¨π¦
π¦ where this page comes from
- ubuntu questing: llvm-14 1:14.0.6-20ubuntu3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms