llvm-config1
Print llvm compilation options
Usage
llvm-config option
[components ...]
Overview
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.
Examples
To link against the JIT:
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 -
Print the assertion mode used when LLVM was built (ON or OFF).
-
--bindir -
Print the installation directory for LLVM binaries.
-
--build-mode -
Print the build mode used when LLVM was built (e.g. Debug or Release).
-
--build-system -
Print the build system used to build LLVM (e.g. cmake or gn).
-
--cflags -
Print the C compiler flags needed to use LLVM headers.
-
--cmakedir -
Print the installation directory for LLVM CMake modules.
-
--components -
Print all valid component names.
-
--cppflags -
Print the C preprocessor flags needed to use LLVM headers.
-
--cxxflags -
Print the C++ compiler flags needed to use LLVM headers.
-
--has-rtti -
Print whether or not LLVM was built with rtti (YES or NO).
-
--help -
Print a summary of
llvm-configarguments.
-
--host-target -
Print the target triple used to configure LLVM.
-
--ignore-libllvm -
Ignore libLLVM and link component libraries instead.
-
--includedir -
Print the installation directory for LLVM headers.
-
--ldflags -
Print the flags needed to link against LLVM libraries.
-
--libdir -
Print the installation directory for LLVM libraries.
-
--libfiles -
Similar to
--libs, but print 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.
-
--libnames -
Similar to
--libs, but prints the bare filenames of the libraries without-lor pathnames. Useful for linking against a not-yet-installed copy of LLVM.
-
--libs -
Print all the libraries needed to link against the specified LLVM components, including any dependencies.
-
--link-static -
Link the component libraries statically.
-
--obj-root -
Print the object root used to build LLVM.
-
--prefix -
Print the installation prefix for LLVM.
-
--quote-paths -
Quote and escape paths when needed, most notably when a quote, space, backslash or dollar sign characters are present in the path.
-
--system-libs -
Print all the system libraries needed to link against the specified LLVM components, including any dependencies.
-
--targets-built -
Print the component names for all targets supported by this copy of LLVM.
-
--version -
Print 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.
Releases
9 releases since Debian 5.0 (Lenny); the text changed 8 times.
--assertion-mode since Debian 13 (Trixie);
--bindir since Debian 13 (Trixie);
--build-mode since Debian 13 (Trixie);
--build-system since Debian 13 (Trixie);
--cflags since Debian 13 (Trixie);
--cmakedir since Debian 13 (Trixie);
--components since Debian 13 (Trixie);
--cppflags since Debian 13 (Trixie);
--cxxflags since Debian 13 (Trixie);
--has-rtti since Debian 13 (Trixie);
--help since Debian 13 (Trixie);
--host-target since Debian 13 (Trixie);
--ignore-libllvm since Debian 13 (Trixie);
--includedir since Debian 13 (Trixie);
--ldflags since Debian 13 (Trixie);
--libdir since Debian 13 (Trixie);
--libfiles since Debian 13 (Trixie);
--libnames since Debian 13 (Trixie);
--libs since Debian 13 (Trixie);
--link-shared since Debian 13 (Trixie);
--link-static since Debian 13 (Trixie);
--obj-root since Debian 13 (Trixie);
--prefix since Debian 13 (Trixie);
--quote-paths since Arch Linux 2026-11-01;
--shared-mode since Debian 13 (Trixie);
--system-libs since Debian 13 (Trixie);
--targets-built since Debian 13 (Trixie);
--version since Debian 13 (Trixie).
--src-root until Debian 9 (Stretch);
-help until Debian 12 (Bookworm).