blaise/docs
Graeme Geldenhuys 948cd4ed1b feat(rtl): FreeBSD freestanding _start + minimal syscall leaf (Step 3)
Add the FreeBSD entry stub for a static, libc-free ET_EXEC:

- runtime.start.static.freebsd.pas — the FreeBSD sibling of
  runtime.start.static.linux. _start captures %rsp, aligns the stack, and calls
  the Pascal _BlaiseStartC, which parses argc/argv/envp off the kernel's initial
  stack (same layout as Linux), captures environ, calls main(argc, argv), and
  exits via the FreeBSD exit syscall. Deliberately minimal: no TLS/auxv-walk
  (a trivial program does no threadvar access) — that lands with the threads
  work in Step 4, mirroring how the Linux static start gained TLS.

- runtime.syscall.freebsd.pas — the minimum kernel leaf _start needs: _exit
  (SYS_exit = 1), write (SYS_write = 4, aliased from _sys_write), and the
  environ global. The full file/process/thread leaf grows here in Step 4. ABI
  notes record the FreeBSD differences from Linux: different syscall numbers and
  the carry-flag error convention (only relevant for the error-translating
  wrappers that arrive in Step 4).

Both units are standalone — nothing in the default Linux build graph uses them,
so the Linux RTL and self-hosting are unaffected; the FreeBSD RTL composition
links them at Step 5.

TLinkerE2ETests.TestLink_FreeBSDStart_StaticExecShape links the _start fixture
with the FreeBSD target and asserts the Strategy-B shape: e_type = ET_EXEC,
entry == _start, no PT_INTERP. (Uses LinkToBytes, not ReadFile — the latter
truncates at the ELF header's first NUL byte.)

Step 3 of docs/freebsd-x86_64-backend-design.adoc. Full suite 3850 green;
FIXPOINT_OK.
2026-06-26 23:58:08 +01:00
..
benchmark.txt docs(benchmark): add QBE 1.3 measurement entry 2026-06-02 17:17:54 +01:00
bif-format.adoc docs: .bif file format reference 2026-06-03 19:40:08 +01:00
design.adoc refactor: rename uCodeGen/uCodeGenQBE to blaise.codegen/blaise.codegen.qbe 2026-06-10 12:12:14 +01:00
extending-ast.adoc refactor: rename uCodeGen/uCodeGenQBE to blaise.codegen/blaise.codegen.qbe 2026-06-10 12:12:14 +01:00
freebsd-x86_64-backend-design.adoc feat(rtl): FreeBSD freestanding _start + minimal syscall leaf (Step 3) 2026-06-26 23:58:08 +01:00
future-improvements.adoc feat(stdlib): add Numerics.Money — currency-aware TMoney 2026-06-20 10:33:35 +01:00
grammar.ebnf feat(parser): require parentheses on inherited calls; fix metaclass diagnostic 2026-06-25 13:36:27 +01:00
inline-asm-design.adoc feat(lang): inline assembler blocks (asm … end routine bodies) 2026-06-25 01:01:41 +01:00
internal-linker-design.adoc docs: mark internal linker Phases C and D as implemented 2026-06-19 10:51:09 +01:00
language-rationale.adoc feat(parser): require parentheses on inherited calls; fix metaclass diagnostic 2026-06-25 13:36:27 +01:00
name-mangling.adoc refactor: rename uCodeGen/uCodeGenQBE to blaise.codegen/blaise.codegen.qbe 2026-06-10 12:12:14 +01:00
native-const-arg-arc-port.adoc docs: native const-arg ARC port design — mark implemented 2026-06-11 07:36:13 +01:00
native-target-architecture.adoc docs: RTL unification plan — one binary, embedded source, no external .a 2026-06-25 23:08:30 +01:00
rtl-unification-plan.adoc docs: RTL-unification implementation plan 2026-06-25 23:08:30 +01:00
self-contained-start-design.adoc fix(linker): ship own _start; drop system CRT startup objects (#142) 2026-06-24 23:39:11 +01:00
testing-strategy.adoc refactor: rename uCodeGen/uCodeGenQBE to blaise.codegen/blaise.codegen.qbe 2026-06-10 12:12:14 +01:00