From 135588502de336eb99195471470ada7b164342b6 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Wed, 1 Jul 2026 10:30:51 +0100 Subject: [PATCH] docs(freebsd): mark Step 5 (per-target RTL) done Record that BuildRTLUnitList drives the per-target RTL unit selection off AOpts.Static + AOpts.Target.OS, with the FreeBSD adapter set selected and no Linux RTL unit present; Linux link path unchanged. --- docs/freebsd-x86_64-backend-design.adoc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/freebsd-x86_64-backend-design.adoc b/docs/freebsd-x86_64-backend-design.adoc index 08a937b..c1f10f2 100644 --- a/docs/freebsd-x86_64-backend-design.adoc +++ b/docs/freebsd-x86_64-backend-design.adoc @@ -426,6 +426,18 @@ Step 8. === Step 5 — Per-target RTL +NOTE: Done. `BuildRTLUnitList(AStatic, AOS)` (`blaise.codegen.driver`) is the +pure, unit-tested selection helper `EnsureRTLObjects` drives off `AOpts.Static` +and `AOpts.Target.OS`. The platform-layout adapter follows the target +(`rtl.platform.layout.`); a `--static` link swaps in the freestanding per-OS +kernel leaf (`runtime.start.static.`, `runtime.syscall.`, +`runtime.libc.`, `runtime.libc2.`, `runtime.thread.static.`) plus the +OS-invariant `runtime.cstub`, replacing libc. FreeBSD selects its full adapter +set with no Linux/libc RTL unit present. Tests: +`TBackendDriverContractTests.TestRTLUnits_*` in `cp.test.driver`. The Linux link +path is behaviourally unchanged (verified: `--static` Linux hello-world still +runs; all four fixpoints + QBE & native TestRunner green). + * The compiler must link a FreeBSD-built RTL (the FreeBSD `TPlatformLayout` and kernel-stub) into a `--target freebsd-x86_64` program, not the host RTL. * The RTL-unification track (`docs/native-target-architecture.adoc`) has already