bazel-contrib / musl-toolchain

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

musl-toolchain

musl_toolchain provides a cc_toolchain implementation for Bazel.

This toolchain allows cross-compiling binaries for Linux from various platforms. It can be used to produce binaries which don't dynamically link libc, by statically linking musl's libc implementation.

Comparison with other cc_toolchain implementations

gcc-toolchain supports building against a known glibc version, rather than building static binaries linking the musl libc implementation.

It also isn't set up for cross-compiling from macOS.

If you're aiming to only compile from Linux, and don't need statically linked binaries, the gcc-toolchain is worth considering.

llvm-toolchain supports cross-compiling, but requires bringing along a sysroot containing a libc to link against.

In contrast, the musl toolchain is designed for building static binaries linking the musl libc implementation.

The musl toolchain's C/C++ compiler is gcc-based rather than llvm-based.

If you don't need to produce statically linked binaries, this toolchain is worth considering.

These toolchains have similar aims.

From having tried out the Zig toolchain, the authors of this toolchain have run into stability/reliability issues due to the relatively early stage of development that Zig is currently at. We look forward to the Zig toolchain maturing beyond these issues in the future!

About

License:Apache License 2.0


Languages

Language:Python 53.6%Language:Starlark 37.1%Language:Shell 9.3%