Files
ww/bootstrap
Hojun-Cho edfc4273f6 nocc: stage-0 bootstrap path (binaries gitignored)
Sets up the cc-free fresh-checkout flow without yet committing the
stage-0 binaries. The pieces are in place; flipping the switch is
one `git add -f` away when the compiler is judged stable.

  bootstrap/<arch>/{ww,6c,6a,6l}   stage-0 binaries (gitignored)
  bootstrap/README.md              layout + workflow

Two new targets:

  make bootstrap-snapshot   populates bootstrap/$(ARCH)/ from the
                            currently-built wwstage
  make nocc                 starts from bootstrap/$(ARCH)/, rebuilds
                            the wwstage from source, gates on
                            stage-0 == rebuilt byte-for-byte. Lands
                            in $(OUT)/nocc/ so $(OUT)/ stays
                            untouched. cc is never invoked.

The fixed-point gate has the same shape as `make bootstrap`, just
the entry point flipped: that target trusts cstage; nocc trusts
the checked-in (or local-snapshot) stage-0 binaries.

Implementation notes:

- libwwrt.a is assembled with stage-0 6a, members ordered to match
  $(RT_OBJ) so the embedded symbol table reproduces the cstage
  build byte-for-byte.
- The driver's default lib path is $self_dir/../../lib, which under
  $(NOCC_BIN) resolves to $(NOCC_OUT)/lib (libwwrt only). Each
  ww-build invocation passes -I $(CURDIR)/lib so `use os` etc.
  resolve to source.
- Stage-0 binaries are duplicated under both natural names (ww/6c/
  6a/6l) and _ww-suffixed names so the wwstage driver's
  hard-coded join_path_lit(self_dir, "6c_ww") still finds them.
  When cmd/wwc/ gets deleted at v1.0, that duplication and the
  _ww suffix in the driver both go away.
2026-05-11 11:51:34 +09:00
..

bootstrap/

Stage-0 binaries for cold-start builds without cc. One subdirectory per supported architecture; each holds four statically-linked ELF executables that match the wwstage layout:

bootstrap/amd64/
    ww      driver, equivalent to out/bin/ww_ww
    6c      compiler,    out/bin/6c_ww
    6a      assembler,   out/bin/6a_ww
    6l      linker,      out/bin/6l_ww

The binaries are intentionally gitignored until the compiler stops churning enough to make the trust surface stable — see PLAN.md and the v1.0 plan in BOOTSTRAP.md. To put them under your local working copy, run make bootstrap-snapshot after a green make wwstage; to ship them, git add -f bootstrap/amd64/{ww,6c,6a,6l} explicitly.

Workflow

A fresh-checkout flow that never invokes cc:

make nocc            # uses bootstrap/<arch>/* as the stage-0 entry
                     # and proves it reproduces itself byte-for-byte

The non-nocc default (make) still drives cc → cstage → wwstage. Both paths coexist — make nocc lands in out/nocc/ so the cstage build under out/ is undisturbed.

When to refresh the snapshot

The stage-0 binaries are frozen at the cgen state they were built with. A make nocc failure usually means the live selfhost/cmd/wwc cgen has drifted from the snapshot — regenerate with make bootstrap-snapshot and re-verify.