aslice Toolchain — One Compiler Bundle, Every Build

State, identity, privilege, and recovery contracts: STATE-AND-RECOVERY. Protected-volume patching: SYSTEM-VOLUMES. These specifications do not establish completed implementation or platform validation.

Contents - [1. What the toolchain is](#what-the-toolchain-is) - [2. Why self-hosted](#why-self-hosted) - [3. Components](#components) - [4. The SDK strategy](#the-sdk-strategy) - [5. Linkage rules](#linkage-rules) - [6. Flavors and the `-march` floor](#flavors-and-the--march-floor) - [7. Identity: `toolchain_id`](#identity-toolchain_id) - [8. How a build consumes the toolchain](#how-a-build-consumes-the-toolchain) - [9. Installing it yourself](#installing-it-yourself) - [10. Genesis](#genesis) - [11. Bumps](#bumps) - [12. Boundaries](#boundaries)

1. What the toolchain is

aslice brings its own toolchain. A user never installs Xcode or the Command Line Tools (MANUAL §2.1); every build — on the farm or on a laptop — runs with aslice-toolchain and nothing else.

The bundle: modern Clang, LLD where viable (ld64 from cctools-port otherwise), a modern libc++, CMake, Ninja, and pkgconf, plus thin compiler wrappers that carry the build contract into every invocation (§6). It is self-hosted: it builds itself (§10), it is the authoritative toolchain for every package including aslice itself, and it is consumed as a pinned slice like any other input — content-addressed, signed, mounted read-only into builds (§8).

It is also just a package. aslice-toolchain lives in the core orchard, and aslice install aslice-toolchain gives you the compiler bundle for your own work (§9).

2. Why self-hosted

The supported platform requires a self-hosted toolchain (DESIGN §4.3):

The platform is frozen, which is what makes this affordable: the toolchain is built and archived once per bump (§11), not chased.

3. Components

Component Role Notes
Clang C/C++ compiler Targets darwin15 through Monterey; accepts -mmacosx-version-min=10.11
libc++ C++ runtime Statically linked into every product (§5); the system libc++ is never used
LLD / ld64 Linker LLD where viable on this platform; ld64 from cctools-port otherwise. v2 moves LLD-first (§11)
CMake / Ninja / pkgconf Build tooling The harness's ctx.cmake / ctx.make / ctx.meson helpers wrap these with correct defaults (PACKAGE-FORMAT §6.3)
Compiler wrappers Contract enforcement What CC/CXX point at in a build; inject the flavor floor, the deployment target, and prefix-mapping (§6)

The table identifies the components and their roles. Exact versions and the per-OS workaround register live in the toolchain slice's manifest (§4), which is the authoritative inventory.

4. The SDK strategy

One SDK serves everything: the oldest archived Apple SDK, paired with the deployment-target mechanism. -mmacosx-version-min is mature — the deployment target establishes an intended floor, while availability guards and per-release execution tests establish whether the binary actually works (DESIGN §4.1). So a package builds once, against the oldest SDK, per flavor — not once per OS release.

The consequences are handled explicitly:

5. Linkage rules

6. Flavors and the -march floor

The flavor vocabulary is the x86-64 psABI microarchitecture levels (DESIGN §4.2): v1 (the SSE2 baseline every 64-bit Intel Mac meets), v2 (SSE4.2/POPCNT), v3 (AVX2/BMI2/FMA). There is no v4 flavor — no Intel Mac ever shipped AVX-512.

The mechanics:

The owned Mac Pro handles v1/v2; complete v3 jobs run on the on-demand 2015 MacBook Pro. Emitting instructions is only one part of a build: configure probes, generated tools, dependencies, and tests may execute them. Assignment therefore requires detected CPU and OS capabilities, including those exposed inside guests. Mac Pro VMs cannot provide v3 execution; jobs wait when no capable worker is available (BUILD-INFRA §6.1).

7. Identity: toolchain_id

The toolchain is an ingredient of each source-build compatibility key (DESIGN §7.2). The following pseudocode summarizes STATE-AND-RECOVERY §1; the result is the full 64 lowercase hexadecimal digits, never a truncated storage key:

build_id = hex_lower(sha256(rfc8785({
    repository, name, version, epoch, revision, abi_variants,  # normalized version
    runtime_abi_epoch, flavor, min_os, toolchain_id, vendor_digest,
})))

The toolchain_id names the compiler and the floor — clang-19-10.11 reads as Clang 19 targeting 10.11. Vendor packages set flavor and toolchain_id to null and bind the vendor artifact digest; source builds use null for the absent vendor digest. Other absent optional identity fields are explicit nulls, and ABI variant maps contain the complete resolved assignment (STATE-AND-RECOVERY §1).

ABI-neutral optimization choices, debug information, timestamps, and build host are absent from the compatibility key. Exact flags, payload hashes, dependency bindings, and CPU requirements enter the artifact manifest. Two builds may share a compatibility key while having different artifact identities; substitution requires ABI evidence, dependent tests, and a compatible target machine (STATE-AND-RECOVERY §1 and STATE-AND-RECOVERY §2). Short digests are display abbreviations only.

8. How a build consumes the toolchain

The toolchain is a pinned slice, consumed like every other input:

9. Installing it yourself

aslice-toolchain is an ordinary package: aslice install aslice-toolchain links the bundle into your profile like anything else, and you can compile your own software with it. It never touches /usr, and it coexists with Xcode or the CLT if you have them — doctor treats their presence as informational only (DESIGN §12.6).

The support boundary is the validated aslice build matrix; coverage is established by recorded runs as workers become available (BUILD-INFRA §8). As a general-purpose compiler it is yours to use, and bug reports about aslice builds outrank feature requests about other people's build systems.

10. Genesis

The toolchain is born twice (GENESIS §1, step 2):

  1. stage0 — proposed on the owned 2013 Mac Pro running Monterey, with compatible Apple host Clang and Command Line Tools, against the oldest archived SDK. Apple lists Monterey as this model's newest compatible OS. Validate the chosen compiler sources, CLT, SDK, and build tools together before accepting this baseline; record their exact versions and results. A bootstrap failure requires revisiting the toolchain recipe, not assuming a newer host OS is available.
  2. stage1 — stage0 rebuilds the toolchain with itself. stage1 is the toolchain anyone ever uses; stage0 exists so that "who compiled the compiler?" has a documented answer.

Both stages are archived as slices and in the repository tree, in the never-lose set (GENESIS §3). Recovery after total loss uses the archived stage0, avoiding an Apple host rebuild. The manager rebuilt with stage1 is compared against the archived unsigned canonical reference; the served signed/notarized binary is verified separately (STATE-AND-RECOVERY §10) (GENESIS §4). GENESIS.md specifies the ceremony, inventory rows, and drill; this section identifies only the toolchain stages and their recovery roles.

11. Bumps

A bump changes toolchain_id, and toolchain_id is part of every build identity — so one bump means an orchard-wide rebuild and fresh slices for everything. The policy follows from that cost:

The known roadmap item is aslice-toolchain v2: LLD-first linking and ccache integration (DESIGN §14).

12. Boundaries


History

Document revision history | Version | Date | Changes | |---|---|---| | v0.8 | September 2026 | Replace inline navigation with a collapsible Contents list; preserve section labels, links, and order. | | v0.7 | September 2026 | Documentation audit repairs: contract summaries aligned; owner-approved namespace, rollback, GC, naming, prefix, and graft decisions applied where relevant; semantic anchors and explicit citations added. Runtime implementation and platform acceptance remain pending. | | v0.6 | September 2026 | Consolidate revision notes into a collapsible history table; no specification changes. | | v0.5 | September 2026 | resolve compatibility-key and build-flag conflicts against STATE-AND-RECOVERY §1–§2: full hexadecimal keys, complete identity inputs, separate artifact identity, and conditional substitution. No runtime implementation is claimed. | | v0.4 | September 2026 | prose rewrite of the self-hosting rationale, component inventory, and recovery explanation; no content changes. | | v0.2 | September 2026 | owned-hardware bootstrap with proposed Monterey baseline subject to toolchain validation; capability requirements and pending VM coverage made explicit; companion versions refreshed. | | v0.1 | September 2026 | initial document, consolidating the toolchain story previously scattered across DESIGN §4.3, GENESIS §1–§4, BUILD-INFRA §2, and PACKAGE-FORMAT §6.3; adds two owner decisions: the toolchain is an ordinary, installable package (§9), and bumps are need-driven, batched, and announced (§11). | | Not recorded | September 2026 | corpus review corrections: artifact identity, protected execution, durable recovery, trust persistence, replay, platform limits, and examples aligned with STATE-AND-RECOVERY and SYSTEM-VOLUMES. These are specification changes; runtime acceptance remains pending. |

Source document