llvm@22

Install command:
brew install llvm@22

Next-gen compiler infrastructure

https://llvm.org/

License: Apache-2.0 WITH LLVM-exception

Development: Pull requests

Formula JSON API: /api/formula/llvm@22.json

Formula code: llvm@22.rb on GitHub

Bottle (binary package) installation support provided for:

macOS on
Apple Silicon
golden gate ✅
tahoe ✅
sequoia ✅
Linux ARM64 ✅
x86_64 ✅

Current versions:

stable ✅ 22.1.8

Other versions:

llvm@21 21.1.8 Next-gen compiler infrastructure
llvm@20 20.1.8 Next-gen compiler infrastructure
llvm@19 19.1.7 Next-gen compiler infrastructure
llvm@18 18.1.8 Next-gen compiler infrastructure
llvm@17 17.0.6 Next-gen compiler infrastructure
llvm@16 16.0.6 Next-gen compiler infrastructure
llvm@15 15.0.7 Next-gen compiler infrastructure
llvm@14 14.0.6 Next-gen compiler infrastructure

Patches:

https://github.com/Homebrew/homebrew-core/blob/main/Patches/llvm/pull-111397.diff
https://github.com/llvm/llvm-project/commit/18c1cbce6874a7341f357014befb66d4c11a04a9
https://github.com/llvm/llvm-project/commit/6e562169fd026e26124fe4e2e435d3a4c522ffe2
https://github.com/llvm/llvm-project/commit/b8007a8e4020b8bca2b12e941660e10bf5bf6716

Keg-only because this is an alternate version of another formula.

Depends on:

zstd 1.5.7 Zstandard is a real-time compression algorithm

Depends on when building from source:

cmake 4.4.5 Cross-platform make
ninja 1.13.2 Small build system for use with gyp or CMake
python@3.15 3.15.2 Interpreted, interactive, object-oriented programming language

Uses from macOS: libedit, libffi

Binaries: FileCheck, UnicodeNameMappingGenerator, amdgpu-arch, analyze-build, bugpoint, clang, clang++, clang-22, clang-apply-replacements, clang-change-namespace, clang-check, clang-cl, clang-cpp, clang-doc, clang-extdef-mapping, clang-format, clang-include-cleaner, clang-include-fixer, clang-installapi, clang-linker-wrapper, clang-move, clang-nvlink-wrapper, clang-offload-bundler, clang-offload-packager, clang-query, clang-refactor, clang-reorder-fields, clang-repl, clang-scan-deps, clang-sycl-linker, clang-tblgen, clang-tidy, clangd, count, diagtool, dsymutil, find-all-symbols, git-clang-format, hmaptool, intercept-build, llc, lli, lli-child-target, llvm-PerfectShuffle, llvm-addr2line, llvm-ar, llvm-as, llvm-bcanalyzer, llvm-bitcode-strip, llvm-c-test, llvm-cas, llvm-cat, llvm-cfi-verify, llvm-cgdata, llvm-config, llvm-cov, llvm-ctxprof-util, llvm-cvtres, llvm-cxxdump, llvm-cxxfilt, llvm-cxxmap, llvm-debuginfo-analyzer, llvm-debuginfod, llvm-debuginfod-find, llvm-diff, llvm-dis, llvm-dlltool, llvm-dwarfdump, llvm-dwarfutil, llvm-dwp, llvm-exegesis, llvm-extract, llvm-gsymutil, llvm-ifs, llvm-install-name-tool, llvm-ir2vec, llvm-jitlink, llvm-jitlink-executor, llvm-lib, llvm-libtool-darwin, llvm-link, llvm-lipo, llvm-lto, llvm-lto2, llvm-mc, llvm-mca, llvm-ml, llvm-ml64, llvm-modextract, llvm-nm, llvm-objcopy, llvm-objdump, llvm-offload-binary, llvm-offload-wrapper, llvm-opt-report, llvm-otool, llvm-pdbutil, llvm-profdata, llvm-profgen, llvm-ranlib, llvm-rc, llvm-readelf, llvm-readobj, llvm-readtapi, llvm-reduce, llvm-remarkutil, llvm-rtdyld, llvm-sim, llvm-size, llvm-split, llvm-stress, llvm-strings, llvm-strip, llvm-symbolizer, llvm-tblgen, llvm-test-mustache-spec, llvm-tli-checker, llvm-undname, llvm-windres, llvm-xray, mlir-cat, mlir-linalg-ods-yaml-gen, mlir-lsp-server, mlir-minimal-opt, mlir-minimal-opt-canonicalize, mlir-opt, mlir-pdll, mlir-pdll-lsp-server, mlir-query, mlir-reduce, mlir-rewrite, mlir-runner, mlir-tblgen, mlir-transform-opt, mlir-translate, modularize, not, nvptx-arch, obj2yaml, offload-arch, opt, pp-trace, reduce-chunk-list, run-clang-tidy, sancov, sanstats, scan-build, scan-build-py, scan-view, split-file, tblgen-lsp-server, tblgen-to-irdl, verify-uselistorder, yaml-bench, yaml2obj

CLANG_CONFIG_FILE_SYSTEM_DIR: $HOMEBREW_PREFIX/etc/clang
CLANG_CONFIG_FILE_USER_DIR: ~/.config/clang

LLD is now provided in a separate formula:
    brew install lld@22

Using `clang`, `clang++`, etc., requires a CLT installation at `/Library/Developer/CommandLineTools`.
If you don't want to install the CLT, you can write appropriate configuration files pointing to your
SDK at ~/.config/clang.

To use the bundled libunwind please use the following LDFLAGS:
    LDFLAGS="-L$HOMEBREW_PREFIX/opt/llvm@22/lib/unwind -lunwind"

To use the bundled libc++ please use the following LDFLAGS:
    LDFLAGS="-L$HOMEBREW_PREFIX/opt/llvm@22/lib/c++ -L$HOMEBREW_PREFIX/opt/llvm@22/lib/unwind -lunwind"
Features newer than system libc++ will require the following define to enable:
    CPPFLAGS="-D_LIBCPP_DISABLE_AVAILABILITY"

NOTE: You probably want to use the libunwind and libc++ provided by macOS unless you know what you're doing.

GitHub Packages downloads:

Last 30 days172,099
Downloads650,063
Analytics install events (30 days)8,035
Downloads / install events (30 days)21.4×

Source: GitHub Packages, fetched 2026-11-03T00:39:48Z. Analytics dates: 2026-10-04 to 2026-11-03. Totals exclude downloads from Bintray before the migration to GitHub Packages. Downloads and install attempts measure different things; the difference does not count analytics opt-outs. Definitions and limitations.

Analytics:

30 days90 days365 days
Installs8,03562,72462,723
Installs (--HEAD)033
Installs on Request1,4984,8414,841
Installs on Request (--HEAD)011
Build Errors24