Commit 968377c
committed
docs: a bare-metal chapter, and the diagnostic promise it found broken
Bare-metal support landed across #455-#459 but had no user-facing page. What
existed was docs/05 §2.7.2 — the manifest reference for `[target.*]` — and an
outlook section in docs/08 written before the work.
Adds docs/13 (en + zh): the two commands that produce a booting image, what a
freestanding target changes, the engine/target/board layering, worked examples
(ISA width, the freestanding std subset, `mcpp test` on the target, the flashing
artifact set, runner override), the two diagnostics, and how to write a board
support package.
## The measurements are re-taken, not copied
Every transcript was measured on 2026-08-20 with mcpp 2026.8.20.1 built from
this tree, on x86_64-linux-gnu. That mattered: the recorded scenario notes say
`text 8844` and this build measures `text 8572`, so a copied number would have
been wrong on arrival. The chapter says so, and gives its component versions.
Two claims that could have been repeated on trust were checked instead:
* 103 of 110 headers — counted in both trees (`103` distinct `.inc` in the
package, `110` `std/*.inc` in the llvm 22.1.8 payload);
* five host targets for `xim:qemu-riscv` — read out of the descriptor
(linux x64/arm64, darwin x64/arm64, win32 x64), which also carries the
comment explaining why win32-arm64 is absent.
The one claim not verified here is labelled as such: the 7 omitted headers are
reported by the package to fail on a hosted x86_64 too.
## The defect writing it exposed
The freestanding `import std` diagnostic ends in a copy-pasteable dependency
line, and prepare.cppm carries a comment saying that line is a PROMISE which
has to resolve today — because it once named a package that did not exist.
It was broken again, in a second form. The line said `"0.1.0"` after `0.2.0`
superseded it in the index, and 0.1.0 is not published:
E_NOT_FOUND: package 'compat.std-freestanding@0.1.0' not found in the
synced index
So the version is part of the promise, not decoration. Fixed to `"0.2.0"` and
verified end to end: trigger the diagnostic, paste its line, `mcpp run` prints
`value 42`. The comment now records this recurrence, since the first note was
not enough to prevent it.
## Adjacent documents
* README target table gained `riscv64-none-elf` / `riscv32-none-elf` — both
tier `verified` in triple.cppm, both executed under qemu by the `baremetal`
CI job, and neither was listed.
* docs/08 §7.3 stops being an outlook. Three of its predictions held; one was
wrong in the way that matters — the C library is NOT inside the toolchain
payload, it is a separate payload named by the target's own row, and that
is what keeps a bare-metal package from having to name a libc.
* docs/05 §2.7.2 stays as the manifest reference and now points at docs/13.
`bash .github/tools/check_docs_style.sh` passes; the bilingual heading
structure is identical by construction. `mcpp build` succeeds with the
prepare.cppm change.1 parent d98e972 commit 968377c
10 files changed
Lines changed: 1041 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| 383 | + | |
| 384 | + | |
383 | 385 | | |
384 | 386 | | |
385 | 387 | | |
| |||
400 | 402 | | |
401 | 403 | | |
402 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
403 | 411 | | |
404 | 412 | | |
405 | 413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
904 | 904 | | |
905 | 905 | | |
906 | 906 | | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
907 | 912 | | |
908 | 913 | | |
909 | 914 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
552 | 563 | | |
553 | 564 | | |
554 | 565 | | |
| |||
0 commit comments