Skip to content

WIP: Add 2-pass release build for Dynamic Dispatch table#118

Closed
bdero wants to merge 3 commits intoshorebirdtech:shorebird/devfrom
bdero:bdero/cascade-limiter
Closed

WIP: Add 2-pass release build for Dynamic Dispatch table#118
bdero wants to merge 3 commits intoshorebirdtech:shorebird/devfrom
bdero:bdero/cascade-limiter

Conversation

@bdero
Copy link
Copy Markdown
Member

@bdero bdero commented Mar 31, 2026

Summary

  • Adds a 2-pass release build for arm64 Apple platforms when the Shorebird linker is enabled.
  • Pass 1 produces a temporary ELF snapshot, which is analyzed to compute the DD table manifest (App.dd.link) and caller links (App.dd_callers.link).
  • The DD slot mapping (App.dd_slots.link) is then computed and fed into the final gen_snapshot pass via --dd_slot_mapping.
  • LinkSupplement copies App.dd.link and App.dd_callers.link to the supplement directory for use during patch builds.

Test plan

  • Verify 2-pass build produces DD table artifacts
  • Verify patch builds consume DD table files correctly
  • Run link percentage tests with DD enabled

bdero added 3 commits March 30, 2026 10:24
When building for arm64 Apple platforms with the linker enabled, run
gen_snapshot twice: first in ELF mode to produce a temporary snapshot
for analyze_snapshot to compute the DD table manifest, caller links,
and slot mapping, then in assembly mode with --dd_slot_mapping to
produce the final snapshot with indirect calls wired up.

The DD table files (App.dd.link, App.dd_callers.link) are copied into
the shorebird supplement directory alongside the existing link files
so they can be bundled with releases and used during patch builds.
The 2-pass DD table build runs gen_snapshot in ELF mode before the
main assembly pass. Update tests to expect this additional command.
The arm64 DD analysis pass delays the arm64 assembly, so x86_64
(which skips DD) completes its build first when both run concurrently
via Future.wait.
@bdero bdero closed this Mar 31, 2026
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.

1 participant