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

https://github.com/strombetta/bugleos-make-toolchain

Build system for generating the BugleOS cross-toolchain for multiple architectures.
https://github.com/strombetta/bugleos-make-toolchain

bugleos cross-compiler cross-compiling cross-toolchain linux

Last synced: 5 months ago
JSON representation

Build system for generating the BugleOS cross-toolchain for multiple architectures.

Awesome Lists containing this project

README

          

# BugleOS Cross Toolchain
[![Release](https://github.com/strombetta/bugleos-make-toolchain/actions/workflows/release.yml/badge.svg)](https://github.com/strombetta/bugleos-make-toolchain/actions/workflows/release.yml)

## The Repository
BugleOS Cross Toolchain builds deterministic cross-compilers and system headers for BugleOS across multiple architectures. The repository automates fetching sources, verifying checksums, and orchestrating staged builds of binutils, GCC, and musl.

## Repository layout

- `Makefile`: entry point orchestrating staged builds per architecture.
- `config/`: central version and path definitions, plus per-architecture target triples.
- `make/`: stage-specific makefiles for binutils, GCC, and musl.
- `scripts/`: helper utilities for fetching sources, verifying checksums, loading the environment, and emitting metadata files.
- `patches/`: placeholder for local patches to upstream sources.
- `downloads/`, `builds/`, `out/`: storage for source archives, build trees, and installed toolchain/sysroot outputs.

## Prerequisites

- Standard POSIX build utilities (bash, tar, make)
- wget or curl for fetching sources
- gpg for signature verification
- A C/C++ build environment (C compiler, g++, binutils)

## Usage

Fetch sources along with signatures and verify both checksums and PGP signatures (recommended before building):

```
scripts/fetch-sources.sh
scripts/verify-checksums.sh
```

Build a toolchain for a specific architecture:

```
make x86_64
make aarch64
```

The umbrella target `toolchain` builds the current `TARGET` from `config/paths.mk` or an override passed on the command line. By default, `TARGET` matches the host architecture when it is supported:

```
make TARGET=aarch64-bugleos-linux-musl toolchain
```

To install Linux UAPI headers into the sysroot, set `WITH_LINUX_HEADERS=1` and update `LINUX_VERSION`/`LINUX_SHA256` in `config/versions.mk`:

```
make WITH_LINUX_HEADERS=1 x86_64
```

## Using the toolchain environment

After a successful build, load the environment helpers generated in `out/toolchain/` (where `TOOLCHAIN_ROOT` defaults to `out/toolchain`):

```
source out/toolchain/x86_64-bugleos-linux-musl/bugleos-toolchain.env
```

Bootstrap tools (binutils-stage1 and gcc-stage1) install into `out/toolchain-stage1/`, keeping temporary artifacts separate from the final cross-toolchain under `out/toolchain/`. Only the latter is required to build BugleOS userspace or kernels.

Stage1 sysroot contents live under `out/toolchain-stage1/sysroot`, while the final sysroot is located at `out/toolchain//sysroot`. Headers are exposed under `out/toolchain//sysroot/usr/include` for predictable `--print-sysroot` checks.

Alternatively, enter the environment manually:

```
TARGET=x86_64-bugleos-linux-musl . scripts/enter-env.sh
```

To validate an existing build and ensure the compiler never falls back to host headers, run:

```
make TARGET=aarch64-bugleos-linux-musl verify-toolchain
```

## Cleaning

- `make clean` removes `builds/` and `logs/` only.
- `make distclean` additionally removes `out/` while preserving downloads.

## Continuous Integration

## Feedback
## Related Projects
## Code of Conduct
## License
Copyright (C) Sebastiano Trombetta. All rights reserved.
This project is licensed under the MIT License. For the full text of the license, see the LICENSE file.