ww: rename toolchain to w-prefix + hare-style build/run/test driver
Plan 9-style w-prefix on the per-arch tools, disambiguating from the
real Plan 9 6c/6a/6l in ref/plan9front/:
cmd/wwc/ → cmd/wcc/ libwwc.a → libwcc.a
cmd/6{c,a,l} → cmd/w6{c,a,l} binary names too
test/wwc/ → test/wcc/ 6 test files w/ w6 prefix
selfhost/cmd mirror in lockstep
bootstrap/amd64/{w6c,w6a,w6l} snapshot binaries (gitignored)
WW_6{C,A,L} → WW_W6{C,A,L} env-var overrides
Plan 9 source-tree refs ("Plan 9 6c shape", ref/plan9front/, etc.)
preserved. Hare-style driver, both C and ww sides:
ww test [path] discover *_test.ww in a directory module, run
each; single-file mode for `ww test foo.ww`
Module-by-name `ww build foo` resolves to foo.ww or foo/foo.ww
via search path (cwd : -I dirs : $WW_LIB)
Default-to-cwd `ww build` / `ww test` build the cwd module
Run pass-through `ww run path arg1 arg2` reaches the program
lib/os: getcwd (79) and getdents64 (217) syscalls power `.` resolution
and directory enumeration on the ww side.
Makefile: wwstage tool deps now include lib/os/os.ww (+ lib/strconv
for wwdump_ww) so lib/* edits force their rebuild instead of leaving
stale binaries — surfaced when test 995 first failed against a stale
w6c_ww built before the lib/os additions.
Test 993 byte-identical parity gate (C-side ww vs ww-side ww_ww on a
build corpus) stays green; all 19 tests pass.
This commit is contained in:
28
BOOTSTRAP.md
28
BOOTSTRAP.md
@@ -8,11 +8,11 @@ under `selfhost/cmd/` and reach a byte-identical fixed point under
|
||||
come from somewhere. Today, that "somewhere" is a small C bootstrap
|
||||
toolchain — the **Cstage**:
|
||||
|
||||
cmd/wwc/ frontend library (lex, parse, check) → libwwc.a
|
||||
cmd/6c/ amd64 compiler .ww → .s
|
||||
cmd/6a/ amd64 assembler .s → .o
|
||||
cmd/6l/ amd64 linker .o → static ELF
|
||||
cmd/ww/ user-facing driver (orchestrates 6c → 6a → 6l)
|
||||
cmd/wcc/ frontend library (lex, parse, check) → libwcc.a
|
||||
cmd/w6c/ amd64 compiler .ww → .s
|
||||
cmd/w6a/ amd64 assembler .s → .o
|
||||
cmd/w6l/ amd64 linker .o → static ELF
|
||||
cmd/ww/ user-facing driver (orchestrates w6c → w6a → w6l)
|
||||
|
||||
Cstage is built with `cc`. Once it exists, it compiles the
|
||||
ww-rewritten tools (the **wwstage**) under `selfhost/cmd/`, which then
|
||||
@@ -37,7 +37,7 @@ involved.
|
||||
## Make targets
|
||||
|
||||
make builds cstage + wwstage + libs
|
||||
make cstage Cstage only (cc → ww, 6c, 6a, 6l, wwdump, libs)
|
||||
make cstage Cstage only (cc → ww, w6c, w6a, w6l, wwdump, libs)
|
||||
make wwstage wwstage only (assumes cstage)
|
||||
make bootstrap three-stage build; gates on cmp ww2 == ww3
|
||||
make test runs all tests, including 990–995 (ww-side
|
||||
@@ -57,12 +57,12 @@ Without cc:
|
||||
## Status
|
||||
|
||||
Phase 10 of `PLAN.md` is at its first exit criterion: the bootstrap is
|
||||
green and `selfhost/cmd/{wwc,6c,6a,6l,ww}` are byte-identical to their
|
||||
green and `selfhost/cmd/{wcc,w6c,w6a,w6l,ww}` are byte-identical to their
|
||||
Cstage counterparts. Test 995 pins the stronger property — the
|
||||
wwstage rebuilds every one of its own tools through `ww_ww + 6c_ww +
|
||||
6a_ww + 6l_ww`, byte-for-byte. Test 996 pins the equivalent for the
|
||||
dynamic linker: `6l_ww` with `-L`/`-l` produces a byte-identical
|
||||
PT_INTERP+PT_DYNAMIC binary to C-side `6l` on snake.
|
||||
wwstage rebuilds every one of its own tools through `ww_ww + w6c_ww +
|
||||
w6a_ww + w6l_ww`, byte-for-byte. Test 996 pins the equivalent for the
|
||||
dynamic linker: `w6l_ww` with `-L`/`-l` produces a byte-identical
|
||||
PT_INTERP+PT_DYNAMIC binary to C-side `w6l` on snake.
|
||||
|
||||
`make nocc` is wired and verifies stage-0 self-reproduction locally;
|
||||
the stage-0 binaries under `bootstrap/$(ARCH)/` are gitignored until
|
||||
@@ -79,12 +79,12 @@ The pieces are already wired; only the binary commit is held back.
|
||||
When the compiler stabilises:
|
||||
|
||||
1. On each supported arch, run `make wwstage && make bootstrap-snapshot`
|
||||
to populate `bootstrap/<arch>/{ww,6c,6a,6l}` from the current
|
||||
to populate `bootstrap/<arch>/{ww,w6c,w6a,w6l}` from the current
|
||||
wwstage. Verify with `make nocc`.
|
||||
2. `git add -f bootstrap/<arch>/{ww,6c,6a,6l}` — explicit because
|
||||
2. `git add -f bootstrap/<arch>/{ww,w6c,w6a,w6l}` — explicit because
|
||||
the dir is gitignored. The binary SHAs become the new trust
|
||||
surface.
|
||||
3. Delete `cmd/wwc/`, `cmd/6c/`, `cmd/6a/`, `cmd/6l/`, `cmd/ww/`.
|
||||
3. Delete `cmd/wcc/`, `cmd/w6c/`, `cmd/w6a/`, `cmd/w6l/`, `cmd/ww/`.
|
||||
Drop `CC`/`AR` C-tool dependencies from the top-level Makefile.
|
||||
4. Move `selfhost/cmd/*` to `cmd/*` and `make nocc` becomes the
|
||||
default `make`.
|
||||
|
||||
Reference in New Issue
Block a user