When I initially created rpi_bazel, I set it up to use a host provided clang. I decided to update that so that the rpi_bazel rules themselves download a binary version of an arbitrary clang. This lets you decouple the version of clang from what is available in any given Linux distribution and improves the reproducibility of builds, since you are no longer dependent on whatever PPA you used to grab clang from.
To make that work in a cross compilation environment, the rules also cross compile libcxx and libcxxapi. However, since bazel’s support for C++ toolchains is still in flux, for now binaries must explicitly depend upon the C++ standard library if they want it. On the plus side, that now makes it trivial to fully support C++17 on the raspberry pi. It should also be easy to update this to clang 8, although I haven’t gotten around to doing so yet.
- Clone/Download/Use: https://github.com/mjbots/rpi_bazel/