Skip to content

Bazel toolchain configuration that supports cross compilation

License

Notifications You must be signed in to change notification settings

J-Pai/bazel_xcompile_toolchain

Repository files navigation

Bazel Toolchain

Personal Bazel based toolchain for cross-compiling.

Toolchain utilizes Clang/LLVM 13.0.0 as the primary compiler.

Below are the supported targets (other than linux x86_64).

Ubuntu 20.04 x86_64

Build Dependencies:

sudo apt install libc++-dev libc++abi-dev

Example invocation:

bazel run @toolchain//bazel_demo:hello_world

Ubuntu 20.04 AArch64

Meant to target Ubuntu 20.04 running on a Raspberry Pi 4.

Based on https://github.com/mjbots/rpi_bazel, but modified to use Bazel Platforms instead of --crosstool_top.

Install Aarch64 sysroot and libraries with the following command prior to starting the build.

sudo apt install gcc-aarch64-linux-gnu
sudo apt install g++-aarch64-linux-gnu

Example invocation:

bazel build --config=arm64 @toolchain//bazel_demo:hello_world

Sources/Inspiration

About

Bazel toolchain configuration that supports cross compilation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published