LLVM-CONFIG(1)
β¨ 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 (ONorOFF).--bindirβ prints the installation directory where the LLVM binaries live.--build-modeβ prints the build mode LLVM was built with (thinkDebugorRelease).--build-systemβ prints the build system that built LLVM (likecmakeorgn).--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 (YESorNO).--helpβ prints a lil summary of all thellvm-configarguments.--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--libsbut 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 (sharedorstatic).--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.
π COPYRIGHT π
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
- ubuntu noble: llvm-16 1:16.0.6-23ubuntu4 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms