macOS: anchor the guest address space in full-emulator test targets #143

Manually merged
github merged 1 commit from gh-pr/143/head into gh-pr/143/base 2026-11-26 09:12:12 +00:00
Owner

@⁠Stepz97 on GitHub · 2026-08-01 09:39 UTC · original
Stepz97:macos-test-address-space → main · +3 −1 · 1 files · 1 commits · merged 2026-08-02 00:27 UTC

What changed

Move the configure_macos_guest_address_space() call into add_kyty_full_emulator_test() itself, so every target that function creates gets the linker flags that anchor the guest address-space segments. Drop the now-redundant explicit call on virtual_memory_allocation_tests. The kyty_emulator target is untouched.

Why

Every target created by add_kyty_full_emulator_test compiles kernel/macosGuestAddressSpace.cpp, so it carries the ~620 GiB of .zerofill segments (SYSTEM_MANAGED, SYSTEM_RESERVED, USER_AREA). Only kyty_emulator and virtual_memory_allocation_tests also received the -segaddr/-no_pie/-pagezero_size flags that anchor those segments; every other full-emulator test binary got the segments at default placement, and macOS kills those binaries at load:

  • direct exec dies with SIGKILL (exit 137) before main() runs
  • posix_spawn fails with EIO
  • ctest reports Process not started [i/o error], so shader_recompiler_compute_tests and the 9 test entries that reuse that binary show up as BAD_COMMAND

CI does not catch this because the macOS job neither builds these test targets nor runs ctest.

How verified

On Apple Silicon (M3 Ultra, macOS 26, x86_64 build under Rosetta 2):

  • Before: shader_recompiler_compute_tests killed on exec; 10 ctest entries BAD_COMMAND.
  • After: ctest -R 'compute|scheduler|tiler|texture' passes 7/7 (with DYLD_LIBRARY_PATH pointing at the install dir for MoltenVK).
  • virtual_memory_allocation_tests still passes (19/19) after removing the duplicate call.
  • otool -l confirms the segments are unchanged and now anchored in every full-emulator test binary.
**@⁠Stepz97** on GitHub · 2026-08-01 09:39 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/143) `Stepz97:macos-test-address-space` → `main` · +3 −1 · 1 files · 1 commits · merged 2026-08-02 00:27 UTC ## What changed Move the `configure_macos_guest_address_space()` call into `add_kyty_full_emulator_test()` itself, so every target that function creates gets the linker flags that anchor the guest address-space segments. Drop the now-redundant explicit call on `virtual_memory_allocation_tests`. The `kyty_emulator` target is untouched. ## Why Every target created by `add_kyty_full_emulator_test` compiles `kernel/macosGuestAddressSpace.cpp`, so it carries the ~620 GiB of `.zerofill` segments (SYSTEM_MANAGED, SYSTEM_RESERVED, USER_AREA). Only `kyty_emulator` and `virtual_memory_allocation_tests` also received the `-segaddr`/`-no_pie`/`-pagezero_size` flags that anchor those segments; every other full-emulator test binary got the segments at default placement, and macOS kills those binaries at load: - direct exec dies with SIGKILL (exit 137) before `main()` runs - `posix_spawn` fails with EIO - ctest reports `Process not started [i/o error]`, so `shader_recompiler_compute_tests` and the 9 test entries that reuse that binary show up as BAD_COMMAND CI does not catch this because the macOS job neither builds these test targets nor runs ctest. ## How verified On Apple Silicon (M3 Ultra, macOS 26, x86_64 build under Rosetta 2): - Before: `shader_recompiler_compute_tests` killed on exec; 10 ctest entries BAD_COMMAND. - After: `ctest -R 'compute|scheduler|tiler|texture'` passes 7/7 (with `DYLD_LIBRARY_PATH` pointing at the install dir for MoltenVK). - `virtual_memory_allocation_tests` still passes (19/19) after removing the duplicate call. - `otool -l` confirms the segments are unchanged and now anchored in every full-emulator test binary.
Every target created by add_kyty_full_emulator_test links against the
full kyty_emulator sources, so it drags in the same 620 GiB .zerofill
guest address space segments as the emulator itself. Only the emulator
target and virtual_memory_allocation_tests had the linker flags that
anchor those segments; every other full-emulator test target got the
segments without the anchoring, and the kernel killed them on exec
(posix_spawn EIO / SIGKILL) before main() ever ran.

Move the configure_macos_guest_address_space() call into
add_kyty_full_emulator_test() itself so every target it creates gets
it automatically, and drop the now-redundant explicit call on
virtual_memory_allocation_tests.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:12:10 +00:00
github manually merged commit 9e63d5f8f6 into gh-pr/143/base 2026-11-26 09:12:12 +00:00
Author
Owner

@⁠Nmzik on GitHub · 2026-08-02 00:27 UTC · original

@⁠Stepz97 Thanks!

**@⁠Nmzik** on GitHub · 2026-08-02 00:27 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/143#issuecomment-5154182326) @⁠Stepz97 Thanks!
This discussion has been locked. Commenting is limited to contributors.
No description provided.