All Projects → grailbio → Bazel Toolchain

grailbio / Bazel Toolchain

Licence: apache-2.0
LLVM toolchain for bazel

Projects that are alternatives of or similar to Bazel Toolchain

Termux Ndk
android-ndk for termux
Stars: ✭ 91 (-2.15%)
Mutual labels:  toolchain, clang
xcross
"Zero Setup" cross-compilation for C/C++. Supports numerous architectures, build systems, C standard libraries, vcpkg, and Conan.
Stars: ✭ 29 (-68.82%)
Mutual labels:  toolchain, clang
Polymcu
An open framework for micro-controller software
Stars: ✭ 173 (+86.02%)
Mutual labels:  toolchain, clang
bazel-compile-commands-extractor
Goal: Enable awesome tooling for Bazel users of the C language family.
Stars: ✭ 295 (+217.2%)
Mutual labels:  bazel, clang
Bazel Compilation Database
Tool to generate compile_commands.json from the Bazel build system
Stars: ✭ 236 (+153.76%)
Mutual labels:  bazel, clang
rebuild
Zero-dependency, reproducible build environments
Stars: ✭ 48 (-48.39%)
Mutual labels:  toolchain, clang
Seriouscode
This header file enforces Clang warnings to bu turned-on for specific flags (almost everyone, at least each one I was able to find).
Stars: ✭ 68 (-26.88%)
Mutual labels:  clang
Clang Wasm
How to build webassembly files with nothing other than standard Clang/llvm.
Stars: ✭ 81 (-12.9%)
Mutual labels:  clang
Clang Callgraph
A tool based on clang which generates a call graph from a given C++ codebase
Stars: ✭ 65 (-30.11%)
Mutual labels:  clang
Optviewer Demo
Demonstration of LLVM's opt-viewer tool
Stars: ✭ 63 (-32.26%)
Mutual labels:  clang
Yavide
Modern C/C++ integrated development environment
Stars: ✭ 1,306 (+1304.3%)
Mutual labels:  clang
Ip2region
Ip2region is a offline IP location library with accuracy rate of 99.9% and 0.0x millseconds searching performance. DB file is ONLY a few megabytes with all IP address stored. binding for Java,PHP,C,Python,Nodejs,Golang,C#,lua. Binary,B-tree,Memory searching algorithm
Stars: ✭ 9,836 (+10476.34%)
Mutual labels:  clang
Cuda Design Patterns
Some CUDA design patterns and a bit of template magic for CUDA
Stars: ✭ 78 (-16.13%)
Mutual labels:  bazel
Seeless
C IDE for iOS
Stars: ✭ 71 (-23.66%)
Mutual labels:  clang
Llvm Vs2017 Integration
MSBuild 15.0 Toolset integration for multiple LLVM (From v5 to v8)
Stars: ✭ 84 (-9.68%)
Mutual labels:  clang
Ccache
ccache – a fast compiler cache
Stars: ✭ 1,128 (+1112.9%)
Mutual labels:  clang
Distroless
🥑 Language focused docker images, minus the operating system.
Stars: ✭ 11,484 (+12248.39%)
Mutual labels:  bazel
Avalonstudio
Cross platform IDE and Shell
Stars: ✭ 1,132 (+1117.2%)
Mutual labels:  clang
Codechecker
CodeChecker is an analyzer tooling, defect database and viewer extension for the Clang Static Analyzer and Clang Tidy
Stars: ✭ 1,209 (+1200%)
Mutual labels:  clang
Constantine
A plugin for Clang compiler
Stars: ✭ 89 (-4.3%)
Mutual labels:  clang

LLVM toolchain for Bazel Tests Migration

NOTE: As of 2200d53, this project requires bazel 1.0 or up.

To use this toolchain, include this section in your WORKSPACE:

# Change master to the git tag you want.
http_archive(
    name = "com_grail_bazel_toolchain",
    strip_prefix = "bazel-toolchain-master",
    urls = ["https://github.com/grailbio/bazel-toolchain/archive/master.tar.gz"],
)

load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies")

bazel_toolchain_dependencies()

load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")

llvm_toolchain(
    name = "llvm_toolchain",
    llvm_version = "8.0.0",
)

load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")

llvm_register_toolchains()

The toolchain can automatically detect your OS type, and use the right pre-built binary distribution from llvm.org. The detection is currently based on host OS and is not perfect, so some distributions, docker based sandboxed builds, and remote execution builds will need toolchains configured manually through the distribution attribute. We expect the detection logic to grow through community contributions. We welcome PRs! 😄

See in-code documentation in rules.bzl for available attributes to llvm_toolchain.

For making changes to default settings for these toolchains, edit the cc_toolchain_config template. See tutorial.

For overriding toolchains on the command line, please use the --extra_toolchains flag in lieu of the deprecated --crosstool_top flag. For example, [email protected]_toolchain//:cc-toolchain-linux.

If you would like to use the older method of selecting toolchains, you can continue to do so with [email protected]_toolchain//:toolchain.

Notes:

  • The LLVM toolchain archive is downloaded and extracted in the named repository. People elsewhere have used wrapper scripts to avoid symlinking and get better control of the environment in which the toolchain binaries are run.

  • A sysroot can be specified through the sysroot attribute. This can be either a path on the user's system, or a bazel filegroup like label. One way to create a sysroot is to use docker export to get a single archive of the entire filesystem for the image you want. Another way is to use the build scripts provided by the Chromium project.

  • Sandboxing the toolchain introduces a significant overhead (100ms per action, as of mid 2018). To overcome this, one can use --experimental_sandbox_base=/dev/shm. However, not all environments might have enough shared memory available to load all the files in memory. If this is a concern, you may set the attribute for using absolute paths, which will substitute templated paths to the toolchain as absolute paths. When running bazel actions, these paths will be available from inside the sandbox as part of the / read-only mount. Note that this will make your builds non-hermetic.

  • The toolchain is known to also work with rules_go.

  • The LLVM toolchain also provides several tools like clang-format. You can depend on these tools directly in the bin directory of the toolchain. For example, @llvm_toolchain//:bin/clang-format is a valid and visible target.

Other examples of toolchain configuration:

https://github.com/bazelbuild/bazel/wiki/Building-with-a-custom-toolchain

https://github.com/vsco/bazel-toolchains

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].