Fix macOS guest address-space startup with Xcode 27 #2437

Open
github-bot wants to merge 1 commit from github-bot/gh-2437 into main AGit
Owner

@⁠igorbispo99 on GitHub · 2026-11-20 03:08 UTC · original
igorbispo99:codex/macos-guest-address-space → main · +15 −3 · 2 files · 1 commits · draft

Summary

  • Keep the three Mach-O zero-fill guest address segments in x86-64 macOS executables. Xcode 27 removed -ld_classic. Its linker discarded the unreferenced segments, and running even against an empty game directory stalled at the first fixed guest memory mapping under Rosetta.
  • Place the 2 MiB AGC driver block at the end of the macOS system-reserved range. The old hint fell outside the range, so the allocator placed it in the user area and AGC aborted on its address check.

Verification

On an M3 Max with macOS 27.2.1 and Xcode 27.2, I reproduced the mapping hang without any game data. After the fix, otool -l showed all three segments at their requested addresses, the guest address-space startup self-test passed, and AGC initialized once a compatible Vulkan device was selected.

The existing macos_sse4a and lru_cache tests passed. The host memory suite ran instead of hanging and reported a separate failure in AmmRemapIntoPrt (0x80020016).

This is part of testing macOS startup related to #1068. Booting a 3D title also depends on renderer and driver compatibility work. This patch was developed with AI assistance and tested on the hardware described above.

**@⁠igorbispo99** on GitHub · 2026-11-20 03:08 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2437) `igorbispo99:codex/macos-guest-address-space` → `main` · +15 −3 · 2 files · 1 commits · draft ## Summary - Keep the three Mach-O zero-fill guest address segments in x86-64 macOS executables. Xcode 27 removed `-ld_classic`. Its linker discarded the unreferenced segments, and running even against an empty game directory stalled at the first fixed guest memory mapping under Rosetta. - Place the 2 MiB AGC driver block at the end of the macOS system-reserved range. The old hint fell outside the range, so the allocator placed it in the user area and AGC aborted on its address check. ## Verification On an M3 Max with macOS 27.2.1 and Xcode 27.2, I reproduced the mapping hang without any game data. After the fix, `otool -l` showed all three segments at their requested addresses, the guest address-space startup self-test passed, and AGC initialized once a compatible Vulkan device was selected. The existing `macos_sse4a` and `lru_cache` tests passed. The host memory suite ran instead of hanging and reported a separate failure in `AmmRemapIntoPrt` (0x80020016). This is part of testing macOS startup related to #1068. Booting a 3D title also depends on renderer and driver compatibility work. This patch was developed with AI assistance and tested on the hardware described above.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:20:28 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2437/head:github-bot/gh-2437'
git switch 'github-bot/gh-2437'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2437'
git switch 'github-bot/gh-2437'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2437'
git switch 'github-bot/gh-2437'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2437'
git switch 'main'
git merge --squash 'github-bot/gh-2437'
git switch 'main'
git merge --ff-only 'github-bot/gh-2437'
git switch 'main'
git merge 'github-bot/gh-2437'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.