An open API service indexing awesome lists of open source software.

https://github.com/marvin-hansen/buildbuddy-clang

Clang distribution optimized for buildbuddy CI
https://github.com/marvin-hansen/buildbuddy-clang

Last synced: about 1 month ago
JSON representation

Clang distribution optimized for buildbuddy CI

Awesome Lists containing this project

README

        

# buildbuddy-clang

Minified Clang toolchain distribution

### About

This repository contains Github Actions to build and package the clang C toolchains for consumption with Bazel and
optimized for buildbuddy CI.

#### C (Clang)

We build a Clang toolchain from the upstream source [`llvm-project`](https://github.com/llvm/llvm-project) with CMake and Ninja.
Generally following the instructions from:

* [Clang - Getting Started](https://clang.llvm.org/get_started.html)
* [Building LLVM with CMake](https://llvm.org/docs/CMake.html)
* [Assembling a Complete Toolchain](https://clang.llvm.org/docs/Toolchain.html)

The resulting toolchain is designed for consumption with [`toolchains_llvm`](https://github.com/bazel-contrib/toolchains_llvm)
and to be a drop-in replacement for the toolchains provided by the upstream `llvm-project`. Similar to Rust, we also compress
the package with `zstd`.

#### Setup (Bazelmod)

Just add the following to your MODULE.bazel file.

```text
bazel_dep(name = "toolchains_llvm", version = "1.2.0", dev_dependency = True)

LLVM_VERSIONS = {
"": "19.1.6",
}

llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
llvm.toolchain(
name = "llvm_toolchain",
llvm_versions = LLVM_VERSIONS,
sha256 = {
"linux-x86_64": "a23d498699b22944be3a5a0470c0cfb229f801bbc1e460432617f8d08d0d57ea",
"linux-aarch64": "",
},
stdlib = {
"linux-x86_64": "stdc++",
"linux-aarch64": "stdc++",
},
urls = {
"linux-x86_64": ["https://github.com/marvin-hansen/buildbuddy-clang/releases/download/clang-19.1.6-x86-64/linux_x86_64.tar.zst"],
"linux-aarch64": ["https://github.com/marvin-hansen/buildbuddy-clang/releases/download/clang-19.1.6-arm64/linux_aarch64.tar.zst"],
},
)
use_repo(llvm, "llvm_toolchain", "llvm_toolchain_llvm")

register_toolchains("@llvm_toolchain//:all")
```

# Sysroot

We also build a sysroot for the toolchain for intel and Arm.

## Acknowledgements

This repo started out as a fork from https://github.com/MaterializeInc/toolchains

Special thanks to [@ParkMyCar](https://github.com/ParkMyCar) for open sourcing and maintaining the said repo.

Also, special thanks to [@scasagrande ](https://github.com/scasagrande)for his work on [sysroot building for llvm toolchain.](https://github.com/scasagrande/toolchains_llvm_sysroot)

## License

Apache-2.0, as the original repo.