Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/f0rmiga/gcc-toolchain

A fully-hermetic Bazel GCC toolchain for Linux.
https://github.com/f0rmiga/gcc-toolchain

aarch64 armv7 bazel bazel-rules c cpp fortran gcc linux rbe x86-64

Last synced: 12 days ago
JSON representation

A fully-hermetic Bazel GCC toolchain for Linux.

Awesome Lists containing this project

README

        

# Bazel GCC toolchain

This is a fully-hermetic Bazel GCC toolchain for Linux. It supports the glibc variants of
https://toolchains.bootlin.com. You can find the documentation under [docs](./docs/).

## Why would someone want or need a hermetic toolchain?

Reproducibility and portability.

Developers want their code to compile correctly, be reproducible on CI systems and other developers
machines. The way C++ toolchains function usually rely on the system libraries to work.

### Reproducibility

If you don't have the exact same headers and libraries, the output produced by Bazel will differ
from systems. This is particularly expensive with C++ as caches cannot be shared between machines.
More importantly, bugs may exist in one machine but not in others, making the development lifecycle
and build system unreliable.

### Portability

When it comes to building portable ELF binaries, the libc plays an important role. The linker will
try to link against new symbols, and since the GNU libc has symbol versioning, linking against a
newer glibc will prevent that program from running on a system using an older glibc. To solve this,
we ship glibc 2.26 with the sysroots, which should be old enough by now to make all programs
compiled with this toolchain portable.

### Use cases

* Your repository contains first-party C/C++/Fortran code; or
* You need to run sanitizers (asan, lsan, tsan, ubsan) on your code; or
* You need to cross-compile from Linux x86_64 to Linux armv7 or aarch64; or
* You want to make your program portable to other Linux distros (our default sysroot ships with
glibc 2.26); or
* You want reproducibility.