Skip to content

EMBED_P256_OVERLAY=1 cannot build: LIB_NISTCURVES_P256_CODE overflows OVERLAY_REGION by 644 B #118

Description

@JC-000

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions