Repository navigation
Description
EMBED_P256_OVERLAY=1 is a documented Make flag with a documented two-step bootstrap (Makefile:214-216), and it cannot complete at HEAD.
Measured on master 0f3fa0c, from a clean tree, following the documented workflow exactly:
$ make clean
$ make BACKEND=uci EMBED_P256_OVERLAY=1 USE_OVERLAY_P256_EMBED=0
-> OK, build/labels.txt produced
$ make BACKEND=uci EMBED_P256_OVERLAY=1
ld65: Warning: cfg/p256-overlay-verify.cfg(26): Segment 'LIB_NISTCURVES_P256_CODE'
overflows memory area 'OVERLAY_REGION' by 644 bytes
ld65: Error: Cannot generate most of the files due to memory area overflow
make: *** [build/lib/nistcurves-p256-verify.bin] Error 1
The failure is in building the overlay image itself, so the flag's whole purpose is unreachable. Unrelated to the .incbin work in #116/#117 — it reproduces with those merged.
What changed recently, and what didn't
Worth recording because two lanes measured this differently on either side of #117:
- Before fix(build): .incbin escaped the checkout from a worktree — use --bin-include-dir (#116) #117, step 1 also failed, on
Unresolved external 'p256_overlay_verify_blob'(boot.s:974/976), solabels.txtnever appeared and the two defects stacked order-dependently. - After fix(build): .incbin escaped the checkout from a worktree — use --bin-include-dir (#116) #117, step 1 succeeds. Those overlay TUs used
.incbin "../../../build/lib/…", which from the primary checkout escapes above the repo root — so the cwd-escape fixed in fix(build): .incbin escaped the checkout from a worktree — use --bin-include-dir (#116) #117 was also breaking the bootstrap prelim link. That half is genuinely gone.
So this is now one defect, not two, and it is a region-fit problem: the verify archive's code no longer fits the overlay slot the cfg reserves.
Note on the sibling defect
USE_OVERLAY_P384_EMBED has the same shape and is separately blocked by the SHA-384 table overflowing OVERLAY_REGION by 1,536 B — long-standing and already recorded in CLAUDE.md. Both flags occupy the same $4200 slot and are mutually exclusive, so whoever picks this up should size both against the current pins rather than fixing one and assuming the other.
Why file rather than fix
The region sizing is a memory-map decision, not a mechanical repair: OVERLAY_REGION is 7,680 B and the archive that has to fit it grew across the v0.9.x/v0.10.x pins. Choosing between shrinking the staged archive, enlarging the slot, or splitting the image is a design call worth making deliberately.
Filed from the #112/#116 sequence, where both overlay paths were verified in isolation precisely because a real build cannot reach them.
Activity
JC-000 commentedon Aug 15, 2026
Correction to my own issue body — the "two stacked defects" history is wrong. There is one defect, and #117 did not fix a bootstrap step.
I wrote that before #117 the bootstrap's step 1 also failed with
Unresolved external 'p256_overlay_verify_blob', and that #117's cwd-escape fix repaired it. A colleague re-ran the exact command at the exact commit rather than taking my account, and it does not reproduce:Identical to the behaviour on master. I verified the mechanism they identified:
src/boot.s:971gates the reference behind.ifdef USE_OVERLAY_P256_EMBED, so with the define off nothing references the symbol at all. The only way to produce that unresolved-external is a mixed object set —boot.obuilt with the define againstp256_overlay_blobs.obuilt without — which is precisely the "alwaysmake cleanbetween flag changes" trap this repo documents, becausemakecannot see a-Dchange.So, corrected:
OVERLAY_REGIONoverflow, present identically before and after fix(build): .incbin escaped the checkout from a worktree — use --bin-include-dir (#116) #117..incbincwd-escape and nothing more. My claim that it incidentally repaired the bootstrap was a causal story built on an unreproduced observation.Everything else in the issue stands: the flag is unusable at HEAD, the failure is a region-fit problem, and
USE_OVERLAY_P384_EMBEDcontends for the same$4200slot with its own 1,536 B overflow, so both want sizing together.Worth recording why this happened, since the issue is about build-state confusion in the first place: a peer reported the error, I reproduced step 2's failure, and then attached their step-1 report to my own result without running step 1 at the earlier commit. The observation was real for whoever hit it — a dirty object set will produce it — but it was never a property of that commit.
JC-000 commentedon Aug 15, 2026
Addendum — how to produce the spurious
Unresolved external, since anyone working this issue is likely to hit it.The colleague who originally reported that error traced it precisely, and it is worth recording next to the real defect:
makecannot see a-Dchange, so the second invocation silently reuses the first's objects. The unresolved external is a mixed object set, not a defect in the bootstrap.This matters here specifically because the natural way to investigate this issue — try the flag, watch it fail, then try the bootstrap — walks straight into it, and the resulting error points at
boot.srather than at the region overflow that is actually blocking you.make cleanbetween every flag change, including between the two bootstrap steps.So the full picture on this issue is: one real defect (the 644 B
OVERLAY_REGIONoverflow at step 2), plus one easy-to-hit build-state artifact that masquerades as a second, earlier one.JC-000 commentedon Aug 16, 2026
Re-checked at
master39a43eb,libs/nistcurvesv0.11.2 — still open, unchanged in substance, but the reproduction has two stages and the title only names the second.From a clean tree you get a different error first
The overlay rules take an order-only
| build/labels.txt, but that file is only a side effect of the main link — whose bootstrap rule is gated off under this flag. So the build dies before it can reach the overflow this issue is named for. That is the same ordering defect CLAUDE.md already records forUSE_OVERLAY_P384_EMBED, so it is one defect affecting both embed flags, not two.The recorded failure is still exactly right, once you get past that
644 B, unchanged — worth stating explicitly because it is not obviously stable:
LIB_NISTCURVES_P256_CODEgrew +208 B at v0.7.0's validation gate and_RODATAshrank 288 B at v0.9.0, and the pin has since moved v0.10.1 → v0.11.2 across the whole wave. The figure surviving all of that means the overflow is structural (the region is simply too small for this segment), not a drifting margin that a future bump might close on its own.Why this matters for whoever picks it up
Anyone reproducing from a clean checkout will hit the
labels.txterror and reasonably conclude this issue is misfiled. Both failures need fixing and they are independent:USE_OVERLAY_P384_EMBEDOVERLAY_REGIONshortfall — needs a cfg change, not a flag changeNothing in the §6.1/§8.0 alignment work (#119, PR #122) touched either.
EMBED_P256_OVERLAYremains unreachable, and per CLAUDE.md its exclusions are not$(error)-guarded — it silently wins overUSE_OVERLAY_P384_EMBEDand is untested againstUSE_X25519_SIBLING. Contract v0.10.5's §6.3 "a knob naming an axis MUST select it or fail loudly" is the rule this violates, consumer-side.JC-000 commentedon Aug 24, 2026
Validated at HEAD (
libs/nistcurvesv0.11.2): both stages reproduce exactly as described above — the clean-treebuild/labels.txterror, then the 644 BOVERLAY_REGIONoverflow (LIB_NISTCURVES_P256_CODE= 8,324 B vs 7,680 B).One finding the thread did not have, and it settles the design call:
CRYPTO_OVERLAYis no longer a free paging slot. Every default UCI build keepsTLS_DEFRAME_CODE(1,379 B),CERT_BUF_BSS(2,048 B),X509_NAME_CODE(491 B) andHTTPS_TARGET_RODATAresident in $4389-$578B, so even a fitting image would be DMA'd over the deframer and the leaf certificate bycrypto_swap_to_p256_verify— the P-384 hazard class fixed in v0.4.1. Shrink/enlarge/split all presuppose a free slot, and nothing ships or calls the overlay verify.Fix in #139: the flag fails at Makefile parse naming both reasons (contract §6.3), for
EMBED_P256_OVERLAY=1andUSE_OVERLAY_P256_EMBED=1. Plainmake BACKEND=uciis byte-identical across it. Plumbing stays in tree; thelabels.txtordering defect is left as documented since it now only affectsUSE_OVERLAY_P384_EMBED, which cannot complete regardless.Merge pull request #139 from JC-000/fix/118-retire-p256-overlay-embed