Skip to content

Phase 0b-i (#491): emit firmware.map next to firmware.elf for ESP32 link #508

Closed

Description

@zackees

Part of #491 (firmware.map auto-emit), narrowed to ESP32 because that's the target for Phase 4 of #493. Other platforms missing the flag (Apollo3, NXP LPC, RP2040) can be addressed in follow-up sub-issues.

Background

crates/fbuild-build/src/esp32/esp32_linker.rs builds the ESP32 link command but does not pass -Wl,-Map=…/firmware.map. Every other platform that ships through fbuild's own linker layer (avr_linker.rs, teensy_linker.rs, generic_arm/arm_linker.rs covering STM32/NRF52, esp8266_linker.rs, ch32v_linker.rs, renesas_linker.rs, sam_linker.rs, silabs_linker.rs, nrf52_linker.rs) already does. ESP32 is the outlier.

This blocks fbuild bloat / fbuild symbols from filling the ARCHIVE / OBJECT / SECTION columns on ESP32 firmware (and therefore the "flash bytes by archive" rollup), which is a hard prerequisite for Phase 4 of #493 (the shrink integration that needs archive attribution to report "libc.a/lib_a-vfprintf.o" deltas).

Scope

  • crates/fbuild-build/src/esp32/esp32_linker.rs: after the existing -o firmware.elf argv push, also append -Wl,-Map=<output_dir>/firmware.map. Match the pattern used in teensy_linker.rs:94, avr_linker.rs:112, etc.
  • Regression test analogous to the existing teensy/AVR tests:
    • Build the link argv via the existing test fixture.
    • Assert the argv contains a -Wl,-Map= token that resolves to firmware.map in the same directory as firmware.elf.

Out of scope

Pass

  • cargo build --workspace --all-targets clean.
  • cargo clippy --workspace --all-targets -- -D warnings exits 0.
  • New unit test passes.
  • After a clean fbuild build tests/platform/esp32s3 -e esp32s3, firmware.map sits next to firmware.elf (smoke-verifiable manually; CI doesn't run full ESP32 builds).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions