Minimum bazel version: 7.0.0
If you're using bzlmod
, add the following to MODULE.bazel
:
bazel_dep(name = "toolchains_llvm", version = "1.5.0")
# Configure and register the toolchain.
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
llvm.toolchain(
llvm_version = "16.0.0",
)
use_repo(llvm, "llvm_toolchain")
# use_repo(llvm, "llvm_toolchain_llvm") # if you depend on specific tools in scripts
register_toolchains("@llvm_toolchain//:all")
To directly use a commit from GitHub, add this block and replace commit with the commit you want.
git_override(
module_name = "toolchains_llvm",
commit = "0bdeae25025aeb6f914db2a02cb2efeb302743b5",
remote = "https://github.com/bazel-contrib/toolchains_llvm",
)
If not using bzlmod
, include this section in your WORKSPACE
:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "toolchains_llvm",
sha256 = "49e69c011bcaa4c9a7246a287ab1fb4f7ed3fde7cbd7300374c1030f40d2bb95",
strip_prefix = "toolchains_llvm-v1.5.0",
canonical_id = "v1.5.0",
url = "https://github.com/bazel-contrib/toolchains_llvm/releases/download/v1.5.0/toolchains_llvm-v1.5.0.tar.gz",
)
load("@toolchains_llvm//toolchain:deps.bzl", "bazel_toolchain_dependencies")
bazel_toolchain_dependencies()
load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()
load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo")
compatibility_proxy_repo()
load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")
llvm_toolchain(
name = "llvm_toolchain",
llvm_version = "16.0.0",
)
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
llvm_register_toolchains()
What's Changed
- Add 20.1.3 by @helly25 in #482
- Simplify url generation by @helly25 in #484
- Add missing distributions and check for omissions by @helly25 in #486
- Print the checksum strings as needed. by @helly25 in #487
- Tweaks by @helly25 in #489
- Expand glob of toolchain /lib and /include by @mbeards in #491
- Add 20.1.4 by @helly25 in #492
- Verify the current resolution by @helly25 in #490
- Find LLVM distributions automatically. by @helly25 in #471
- Improve the distribution finding and comment on some of the unexpected support. by @helly25 in #493
- Improve error messages. by @helly25 in #494
- Add extra_llvm_distributions attribute by @helly25 in #495
- Platform i686 is of course still 32bit... by @helly25 in #496
- toolchain config: use "-l:libc++.a" and "-l:libc++abi.a" in sysroot by @malt3 in #498
- Add LLVM distributions. by @helly25 in #499
- Add more 20.1.5 llvm_distributions by @helly25 in #500
- Add support for x86_64-unknown-none targets by @jblebrun in #502
- Add first 20.1.6 distributions. by @helly25 in #504
- More 20.1.6 distributions. by @helly25 in #505
- Allow urls in llvm_extra_distributions by @helly25 in #501
- Reduce golden test output. by @helly25 in #506
- Add 20.1.7 by @helly25 in #509
- Update dependency rules_foreign_cc by @renovate[bot] in #513
- Mark repository as reproducible by @mering in #515
- support runtime/test-time compiler invokations by @TroyKomodo in #518
- Fix a
_strip_prefix
call site by @fmeum in #520 - Add 20.1.8 by @helly25 in #526
- Additional 20.1.7 distributions by @helly25 in #527
- Add support for
parse_headers
by @fmeum in #524 - Make
wasm-ld
optional by @fmeum in #529 - Add support for riscv32-unknown-none-elf targets by @kitterion in #530
- Mark downloaded repository as reproducible by @trevorgray in #531
- Use debian bookworm by @helly25 in #541
- Add LLVM release 21.1.0. by @helly25 in #539
- Add fastbuild_compile_flags by @mering in #536
New Contributors
- @mbeards made their first contribution in #491
- @malt3 made their first contribution in #498
- @jblebrun made their first contribution in #502
- @TroyKomodo made their first contribution in #518
- @kitterion made their first contribution in #530
- @trevorgray made their first contribution in #531
Full Changelog: v1.4.0...v1.5.0