Skip to content

feat: ARM cross-compilation pipeline (--link flag, kiln-builtins stub, e2e test)#61

Merged
avrabe merged 1 commit intomainfrom
feat/cross-compilation-pipeline
Mar 21, 2026
Merged

feat: ARM cross-compilation pipeline (--link flag, kiln-builtins stub, e2e test)#61
avrabe merged 1 commit intomainfrom
feat/cross-compilation-pipeline

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Mar 21, 2026

Summary

Phase 1 of #27 — turns synth into an end-to-end firmware builder.

synth compile --link

  • New --link flag auto-invokes arm-none-eabi-gcc after compilation
  • Generates linker script with Meld integration sections (.meld_import_table, .wasm_linear_memory)
  • --builtins <path> specifies kiln-builtins object for linking
  • Produces firmware.elf ready for Renode/hardware

kiln-builtins stub

  • tests/integration/kiln_builtins_stub.c — minimal C ABI bridge
  • __meld_dispatch_import(uint32_t) — returns 0 (test stub)
  • __meld_get_memory_base() — returns __wasm_memory_start

End-to-end test

  • tests/integration/bare_metal_e2e.sh — full pipeline: WAT → .o → link → firmware.elf → validate
  • Checks ELF type, symbols (add/sub/mul/__meld_dispatch_import), sections
  • Skips if arm-none-eabi-gcc not available

Closes #27

Test plan

  • cargo test --workspace — 851 tests, 0 failures
  • cargo clippy — clean
  • cargo fmt --check — clean
  • Integration test (requires arm-none-eabi-gcc)

🤖 Generated with Claude Code

Phase 1 of #27 (ARM cross-compilation toolchain):

synth compile --link:
- New --link flag invokes arm-none-eabi-gcc after compilation
- Auto-detects arm-none-eabi-gcc/ld in PATH
- Generates linker script with Meld integration sections
- Produces firmware.elf from module.o + kiln-builtins.a
- --builtins <path> specifies the kiln-builtins object file

kiln-builtins stub:
- tests/integration/kiln_builtins_stub.c — minimal C implementation
- __meld_dispatch_import: returns 0 for all imports (test stub)
- __meld_get_memory_base: returns __wasm_memory_start linker symbol

End-to-end integration test:
- tests/integration/bare_metal_e2e.sh
- WAT → synth compile → module.o → link → firmware.elf → validate
- Skips gracefully if arm-none-eabi-gcc not in PATH

Closes #27

Implements: CC-003
Implements: XC-001
Trace: skip

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit 8d821ca into main Mar 21, 2026
6 checks passed
@avrabe avrabe deleted the feat/cross-compilation-pipeline branch March 21, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create ARM cross-compilation toolchain

1 participant