Skip to content

AArch64 DWARF unwind + macOS os_signpost integration - #176

Open
angerman wants to merge 2 commits into
stable-ghc-9.14from
feat/aarch64-dwarf-signpost
Open

angerman wants to merge 2 commits into
stable-ghc-9.14from
feat/aarch64-dwarf-signpost

Conversation

@angerman

@angerman angerman commented Mar 10, 2026 •

Copy link
Copy Markdown

Add AArch64 DWARF unwind support and macOS RTS signposts in two separate commits.

The unwind commit retains Cmm unwind points through register allocation, encodes machine-SP and floating-point register rules correctly, and describes the full C-to-STG boundary in assembly. The boundary uses restored machine SP rather than a frame pointer that an unsafe foreign call can overwrite. The signpost commit emits GC intervals with their actual generation, thread events, and user events, including vanilla RTS ways; it avoids shared interval-ID arrays and guards macOS API availability.

Validation: independent Astra review is clear. Real Mach-O/ELF assembly and DWARF decoding, runner ABI/callback tests, signpost concurrency/disabled-path tests, and focused emitter/type checks pass. All 15 affected NCG modules also typecheck verbatim against the freshly built current-stable API, with no compatibility adapters. A live Apple libunwind regression fails before the boundary correction by 16,560 bytes and passes after it. Fresh integrated compiler/NCG CI and a complete Haskell debugger walk remain outstanding; no profiler-overhead claim is made.

Rebased on current stable-ghc-9.14, retaining #197 CPU metadata. Historical CI edits, test stderr suppression, timeout/fragile changes, and JavaScript coverage reductions are excluded.

@angerman
angerman force-pushed the feat/aarch64-dwarf-signpost branch from b203c9e to eeb6c01 Compare March 12, 2026 05:27
@angerman
angerman force-pushed the feat/aarch64-dwarf-signpost branch from 108cdd1 to 4521a53 Compare August 31, 2026 04:28
@angerman
angerman force-pushed the feat/aarch64-dwarf-signpost branch from 4521a53 to a23fb26 Compare September 15, 2026 02:11
@angerman

Copy link
Copy Markdown
Author

Rebased onto #188 tip and fixed the FreeBSD cabal failure:

Tip: a23fb265d6. Watching CI.

@angerman

Copy link
Copy Markdown
Author

Fix push cdb0836415: previous change keyed off USE_SYSTEM_CABAL, but CI uses that flag for stage2 with the already-built stable-haskell cabal — which still needs --with-build-compiler. Now the Makefile probes the cabal binary instead. Re-running CI.

@angerman

Copy link
Copy Markdown
Author

Another fix — FreeBSD failed again, but this time at actions/checkout@v5 with Cannot find: node in PATH (runner env, not the Makefile). Added a pre-checkout pkg install node step on FreeBSD build+test jobs.

Tip now includes:

  1. ci: fix release.yml — Cabal pin + Windows/RockyLinux/FreeBSD platform builds #188 platform stack
  2. cabal --with-build-compiler capability probe (fixes stage2 CI)
  3. FreeBSD node bootstrap for act runner

Track Cmm unwind nodes and machine stack adjustments, use AArch64 DWARF register numbers and extended encodings, and emit procedure range labels on ELF and Mach-O. Preserve the C stack separately from the Haskell CFA.

Move the Linux/Darwin AArch64 STG runner into StgCRunAsm.S so its CFI describes a complete frame rather than guessing the C compiler frame around inline assembly. Describe save/restore transitions and connect the bottom STG frame to StgRunJmp. Add assembler and nested callback ABI regressions.
Create a process-lifetime log once, gate emission and runtime availability, and keep each GC interval ID on the initiating collector stack. This avoids capability-array resizing and stale or orphan interval IDs when instrumentation is toggled.

Forward user events directly from Darwin PrimOps in vanilla, tracing, and DTrace ways. Add observable mock-backend concurrency and pairing checks, and verify disabled non-Darwin macros do not evaluate arguments.
@angerman
angerman force-pushed the feat/aarch64-dwarf-signpost branch from db9e027 to 2256029 Compare October 17, 2026 01:01

This branch has not been deployed

No deployments
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