Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,8 +16,11 @@ Dependencies:
- VICE (`x64sc`) only for `make run` / the test harness

Targets:
- `make` — default, produces `build/c64-https.prg`
and `build/labels.txt` (VICE label format)
- `make` — default, produces `build/c64-https.prg`,
`build/labels.txt` (VICE label format), and
`build/c64-https.dbg` (cc65 debug info,
consumable by VICE's monitor + diagnostic
agents; P-384 overlay gets a `.dbg` sidecar too)
- `make clean` — remove build artifacts
- `make run` — autostart the PRG in VICE
- `make ip65-libs` — rebuild ip65 object libraries from the submodule
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,7 @@ IP65_BUILD := ip65-build
IP65_BIN := $(IP65_BUILD)/ip65-c64.bin

CA65FLAGS := -I src -I src/inc -I src/crypto/shared -I src/net/$(BACKEND) --debug-info
LD65FLAGS := -C $(CFG) -Ln build/labels.txt -m build/c64-https.map
LD65FLAGS := -C $(CFG) -Ln build/labels.txt -m build/c64-https.map --dbgfile build/c64-https.dbg

# Source inventory.
TOP_SRCS := $(wildcard src/*.s)
Expand Down
5 changes: 5 additions & 0 deletions tools/integration/build_nistcurves_p256.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -342,14 +342,19 @@ mkdir -p "$OBJ_DIR" "$OUT_DIR"

# zp_config.s is the single point of truth for ZP equates; we apply -D
# overrides so sibling defaults get replaced with c64-https's canonical map.
# `-g` embeds cc65 debug info into the .o files so the final ld65 --dbgfile
# (driven from the top-level Makefile) can merge per-source line/symbol
# records into build/c64-https.dbg. Does not change emitted code bytes.
"$CA65" \
-g \
-I "$STAGING" \
-I "$PROJECT_ROOT/src/crypto/shared" \
"${ZP_DEFINES[@]}" \
-o "$OBJ_DIR/zp_config.o" "$STAGING/zp_config.s"

for src in fp256_raw mod256_raw points256_raw ecdsa256_raw curve256_raw data_p256_raw reu_equates_raw; do
"$CA65" \
-g \
-I "$STAGING" \
-I "$PROJECT_ROOT/src/crypto/shared" \
-o "$OBJ_DIR/$src.o" "$STAGING/$src.s"
Expand Down
5 changes: 5 additions & 0 deletions tools/integration/build_nistcurves_p384.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -258,7 +258,11 @@ mkdir -p "$OBJ_DIR" "$OUT_DIR"
# We assemble it with `-D` overrides so the sibling's defaults are
# replaced by c64-https's canonical ZP map. The other source files use
# `.importzp` to pull these equates from the linker-resolved zp_config.o.
# `-g` embeds cc65 debug info into each .o; the overlay ld65 invocation
# in build_nistcurves_p384_bin.sh merges it into build/lib/overlay-p384.dbg.
# Does not change emitted code bytes.
"$CA65" \
-g \
-I "$STAGING" \
-I "$PROJECT_ROOT/src/crypto/shared" \
"${ZP_DEFINES[@]}" \
Expand All@@ -270,6 +274,7 @@ mkdir -p "$OBJ_DIR" "$OUT_DIR"
# conflict with the .importzp declaration.
for src in fp384_raw mod384_raw points384_raw data_raw; do
"$CA65" \
-g \
-I "$STAGING" \
-I "$PROJECT_ROOT/src/crypto/shared" \
-o "$OBJ_DIR/$src.o" "$STAGING/$src.s"
Expand Down
7 changes: 7 additions & 0 deletions tools/integration/build_nistcurves_p384_bin.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -101,11 +101,18 @@ mkdir -p "$OUT_DIR"

# Link. ld65 -Ln emits labels in the old ca65 format; the main Makefile
# rewrites `al 00XXXX .name` to `al C:XXXX .name` via sed. Mirror that.
# Sidecar .dbg path derived from the .bin path (build/lib/overlay-p384.dbg).
# Pairs with the `-g` ca65 flag added in build_nistcurves_p384.sh so ld65
# can merge per-source line/symbol records. Does not affect the padded
# .bin image bytes.
DBG_OUT="${BIN_OUT%.bin}.dbg"

"$LD65" \
-C "$CFG" \
-o "$BIN_OUT" \
-Ln "$LABELS_OUT" \
-m "$MAP_OUT" \
--dbgfile "$DBG_OUT" \
--define reu_status=\$df00 \
--define reu_command=\$df01 \
--define reu_c64_lo=\$df02 \
Expand Down
4 changes: 4 additions & 0 deletions tools/integration/build_x25519.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -326,7 +326,11 @@ rm -rf "$OBJ_DIR"
mkdir -p "$OBJ_DIR" "$OUT_DIR"

for src in fe25519_raw x25519_raw x25519_init_raw data_x25519_bss_raw data_x25519_rodata_raw; do
# `-g` embeds cc65 debug info; ld65 --dbgfile (top-level Makefile)
# merges per-source line/symbol records into build/c64-https.dbg.
# Does not change emitted code bytes.
"$CA65" \
-g \
-I "$STAGING" \
"${ZP_DEFINES[@]}" \
-o "$OBJ_DIR/$src.o" "$STAGING/$src.s"
Expand Down