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.
This commit is contained in:
2026-05-11 11:51:34 +09:00
parent 37bffa5284
commit edfc4273f6
4 changed files with 157 additions and 17 deletions

7
.gitignore vendored
View File

@@ -21,3 +21,10 @@ examples/**/*.o
examples/**/*.s
examples/**/*.combined.ww
examples/snake/snake
# Stage-0 binaries under bootstrap/<arch>/. Untracked by default —
# committing them is the v1.0 lock per PLAN.md (the new trust
# surface). `make bootstrap-snapshot` populates the dir from the
# current wwstage; `make nocc` verifies they self-reproduce.
# To ship, `git add -f bootstrap/amd64/{ww,6c,6a,6l}` explicitly.
bootstrap/*/*