feat(libc): support x86-64 unwind register contexts on macOS #1499
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1499"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-08T09:39:37Z.
What
On macOS x86-64,
LibcCaptureRegistersandLibcRestoreRegisterscurrently take the unsupported-platform branch and callabort(). This prevents the guest unwinder from capturing its starting frame or installing a landing-pad context once the macOS unwind path is enabled.Reuse the existing System V x86-64 instruction sequence on Apple hosts, with Mach-O symbol spelling and private visibility instead of ELF assembler directives. The Linux instruction sequence and the Windows implementation are unchanged.
Add behavioral tests for all captured general registers, the caller's stack and return address, and a restore that abandons a nested stack frame and transfers the exception/selector registers and callee-saved registers to a landing pad. The probes also run concurrently on four threads. They build independently of the prx libraries, are registered in the full Linux test suite, and get Debug/Release CI on Linux and Intel macOS.
This is a register-transfer prerequisite for the macOS work in #1 and complements #927. It does not implement frame discovery, Mach-O relinking, or the complete exception runtime. No graphics changes.
Tested
Current head
fbce6710is rebased ontomainat745b775e, which includes #2099 and #2151. The previous SPIRV-Headers build blocker is resolved in this base.git range-diffconfirms the register-transfer source and probes are unchanged; only workflow integration context changed.9bdcc027passed all four Linux/Intel macOS register-context jobs and all three relinker jobs; its full builds failed on the now-resolved upstream header issue. These earlier results are not current-head full-build validation.workflow_dispatchwith a PR number. Please dispatch Build withpr=1499for this head. Automatic register-context/relinker checks may run separately; skipped full-build jobs do not count as passes.Standalone reproduction commands remain in
docs/dev/BUILD.md.amdgcn-amd-amdhsais therefore addressed by upstream, without a duplicate patch in this PR.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed indocs/dev/TechnicalDebt.md.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-08T11:29:23Z.
Review: APPROVED
Excellent addition of comprehensive register context capture and restore tests for x86-64 on both Linux and macOS. This is important for verifying the correctness of the unwinder's register transfer operations.
Strengths:
Technical notes:
This will improve confidence in the unwinder's correctness across platforms. Ready to merge.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-09T08:22:13Z.
@adriadam10 Could you review the updated register-context prerequisite? Head
9bdcc027is rebased onto6cc0503d; the register-transfer implementation and probes are unchanged. Debug/Release capture, restore and four-thread tests pass locally, each repeated three times, and conventions/test registration pass. #1603 is included in the base, so the old formatting-registration blocker is resolved. Fresh upstream validation: https://github.com/boykopovar/AnyPS5/actions/runs/37903526054.Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-09T10:16:35Z.
@adriadam10 Current head
fbce6710is rebased onto main745b775e, including merged #2099 and #2151. Both previous upstream CI blockers (SPIRV headers and Windows Clang without AMDGPU support) are addressed in this base. The unchanged register-context probes pass locally in Debug/Release, three repetitions per mode. Under the new policy, could you dispatch Build on main with inputpr=1499for full Linux/Windows validation, and review the current head? Skipped full-build jobs are not counted as passes.Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T19:43:34Z.
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
fbce6710, merged ontomain8b393b6ein one build with 31 other PRs that had no Windows run.guest_offline_imports, broken by #2359 (reported there).No title was run.
🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T01:04:51Z.
Checked on Linux x86-64: build and
register_context_{capture,restore,threads}pass; the register-context jobs (Linux and Intel macOS, Debug/Release) are green on this head, and popcoder565's Windows run shows the Windows build is unaffected. The production change is__APPLE__-only and the Linux sequence is unchanged. Merging.