fix(build): register relinker tests with CTest #2

Merged
SamG-Coder merged 3 commits from upstream-pr/2 into main 2026-09-25 04:07:05 +00:00
SamG-Coder commented 2026-09-24 19:27:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SamG-Coder on 2026-09-24T19:27:37Z.


With BUILD_TESTING=ON, the existing relinker tests build, but ctest --test-dir build discovers zero tests because testing is not enabled at the project root. The Windows dependency diagnostics executable also has no CTest registration.

This change:

  • Defines BUILD_TESTING with a default of OFF and enables testing at the root when requested.
  • Registers the Windows dependency diagnostics test and includes its executable in normal builds when testing is enabled.
  • Allows CTest to discover the existing strict NID filter test.
  • Adds reproducible homebrew investigation notes, including public input sources, archive hashes, commands, and current conversion failures. No game binaries or assets are included.

Validation on Windows with CMake/Ninja and MSYS2 UCRT64 GCC 16.2.0:

  • Built relinker, strict_nid_filter_tests, and windows_dependency_diagnostics_tests.
  • Before: CTest discovered 0 tests.
  • After: CTest discovered and passed 2/2 tests.
  • git diff --check passed before committing.

The homebrew notes document that the PS5 Omnispeak and Crispy Doom payloads both fail relinking with missing DT_PLTGOT metadata (exit code 2). This PR does not add homebrew compatibility or claim successful game execution. The compatibility libraries and shader pipeline were not built or validated; the relinker compiler result does not establish support for replacing the documented Windows libc toolchain.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4630144582 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2). Originally posted by [SamG-Coder](https://github.com/SamG-Coder) on 2026-09-24T19:27:37Z. --- With `BUILD_TESTING=ON`, the existing relinker tests build, but `ctest --test-dir build` discovers zero tests because testing is not enabled at the project root. The Windows dependency diagnostics executable also has no CTest registration. This change: - Defines `BUILD_TESTING` with a default of OFF and enables testing at the root when requested. - Registers the Windows dependency diagnostics test and includes its executable in normal builds when testing is enabled. - Allows CTest to discover the existing strict NID filter test. - Adds reproducible homebrew investigation notes, including public input sources, archive hashes, commands, and current conversion failures. No game binaries or assets are included. Validation on Windows with CMake/Ninja and MSYS2 UCRT64 GCC 16.2.0: - Built `relinker`, `strict_nid_filter_tests`, and `windows_dependency_diagnostics_tests`. - Before: CTest discovered 0 tests. - After: CTest discovered and passed 2/2 tests. - `git diff --check` passed before committing. The homebrew notes document that the PS5 Omnispeak and Crispy Doom payloads both fail relinking with missing `DT_PLTGOT` metadata (exit code 2). This PR does not add homebrew compatibility or claim successful game execution. The compatibility libraries and shader pipeline were not built or validated; the relinker compiler result does not establish support for replacing the documented Windows libc toolchain.
boykopovar commented 2026-09-24 21:12:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by boykopovar on 2026-09-24T21:12:18Z.


Thanks for the fixes for CTest and for the Homebrew compatibility research (I'll work on compatibility support).

I'd gladly merge it. But I'm confused by HOMEBREW_TESTING.md investigation - I think it's more suitable as part of a PR discussion, not as documentation. I want any text in the git repository to be as dry, strict, and concise as possible.

Could you move (preferably with a force push) this file under this PR to preserve it, or leave it in docs but only include instructions and links to Homebrew projects (which is very important)?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5822324621 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2#issuecomment-5822324621). Originally posted by [boykopovar](https://github.com/boykopovar) on 2026-09-24T21:12:18Z. --- Thanks for the fixes for CTest and for the Homebrew compatibility research (I'll work on compatibility support). I'd gladly merge it. But I'm confused by [HOMEBREW_TESTING.md](https://github.com/SamG-Coder/AnyPS5/blob/0968c32b7241005eca23ba2dd485d0cdc22393a8/docs/HOMEBREW_TESTING.md) investigation - I think it's more suitable as part of a PR discussion, not as documentation. I want any text in the git repository to be as dry, strict, and concise as possible. Could you move (preferably with a force push) this file under this PR to preserve it, or leave it in docs but only include instructions and links to Homebrew projects (which is very important)?
SamG-Coder commented 2026-09-25 02:06:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SamG-Coder on 2026-09-25T02:06:54Z.


Moved the original homebrew investigation here to preserve it, including the project links and reproduction commands. HOMEBREW_TESTING.md has been removed from the proposed tree; this PR now changes only the two CMake files.

The notes below are a historical snapshot from commit 0968c32, not a statement of current compatibility or the current development plan.


Homebrew investigation, 2026-09-25

Baseline: SamG-Coder/AnyPS5, commit 2778c1e.

Verified locally

  • Cloned the fork and initialized all seven submodules at their pinned revisions.
  • Configured on Windows with CMake/Ninja and MSYS2 UCRT64 GCC 16.2.0.
  • Built relinker, strict_nid_filter_tests, and windows_dependency_diagnostics_tests.
  • Both existing test executables passed. Initially CTest discovered zero tests.
  • Enabled root CTest registration when BUILD_TESTING=ON and registered the Windows diagnostics test. The latter is included in normal builds only when testing is enabled.
  • After the CMake changes, CTest discovered and passed both tests.
  • Tried relinking two real PS5 homebrew binaries to Windows. Both failed with exit code 2; neither produced a game executable.

This verifies the relinker build and these two test suites only. The compatibility libraries, shader pipeline, and game execution have not been built or validated in this investigation. Upstream documents a specific WinLibs GCC 15.2.0 toolchain requirement for its Windows libc implementation; the compiler used here does not establish compatibility with that requirement.

Reproduce the build

Run from the repository root in PowerShell. These paths match this workstation:

$env:PATH = 'C:\msys64\ucrt64\bin;' + $env:PATH
cmake -S . -B build -G Ninja `
  -DCMAKE_MAKE_PROGRAM=C:/msys64/ucrt64/bin/ninja.exe `
  -DCMAKE_C_COMPILER=C:/msys64/ucrt64/bin/gcc.exe `
  -DCMAKE_CXX_COMPILER=C:/msys64/ucrt64/bin/g++.exe `
  -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON
cmake --build build --target relinker strict_nid_filter_tests windows_dependency_diagnostics_tests -j 8
ctest --test-dir build --output-on-failure

Public PS5 homebrew inputs

Downloaded directly from ps5-payload-dev/websrv v0.34. Downloads remain in the ignored downloads/ directory; no game binaries or data are added to Git.

Archive SHA-256
Omnispeak.zip 7A4D82BF58EF7406A4C9050EC298195C548D387FEBC28FD814C3BF9026BB231B
CrispyDoom.zip C0C37713703E109F43B1B598CF5790D969097A2BAF961693A0FD0E03956A3C59

Omnispeak is an open-source Commander Keen engine. Its upstream README links Keen 4 shareware data, and the PS5 package includes CK4 data. The PS5 build recipe identifies how that package is assembled.

Crispy Doom's PS5 recipe builds the engine and packages shareware data. Freedoom is a separate free-content candidate for later compatibility testing; it has not been downloaded or tested here.

These PS5 builds are ELF payloads, not ISO disc images. An engine's open-source license does not automatically apply to original commercial game data.

.\build\core\relinker\relinker.exe --windows `
  downloads\Omnispeak\omnispeak.elf downloads\omnispeak.exe
.\build\core\relinker\relinker.exe --windows `
  downloads\CrispyDoom\CrispyDoom\crispy-doom.elf downloads\crispy-doom.exe

Both currently report:

System: Windows; unused-filter=0
FAIL: Neither DT_OS_ nor DT_ variant present for DT_PLTGOT

Why this is more than a missing table

RelinkerPipeline.cpp unconditionally requires PLTGOT, PLTRELSZ, PLTREL, and JMPREL metadata. Inspection of Omnispeak with objdump shows ordinary RELA relocations but no PLTGOT/PLT relocation tags. Supporting ELF files without PLT relocations is a candidate improvement, but simply bypassing the requirement does not establish a runnable conversion.

The PS5 payload SDK startup takes a payload_args_t pointer and initializes console-specific kernel and dynamic-linker facilities. Its entry assembly calls that startup. Homebrew payload startup therefore needs separate compatibility analysis and likely an adapter.

Omnispeak imports libkernel_web.sprx and libSceLibcInternal.sprx, among other libraries. In this AnyPS5 revision, the former contains only APS5_DUMMY_FUN, while the latter exposes only a heap tracing stub. File presence is not evidence of implemented compatibility.

Suggested next milestones

  1. Create a tiny source-owned executable fixture with a documented entry ABI, one imported function, and a verifiable exit value. Relink it and execute the result on Windows.
  2. Add regression coverage for ELF files without PLT relocations before changing their handling.
  3. Report unsupported payload startup and missing imports explicitly, then implement the minimum required compatibility path.
  4. Advance to a framebuffer demo, input, and audio before retrying a complete homebrew game.

Keep conversion, loader startup, first rendered frame, and playable gameplay as distinct results. A native Windows build of the same open-source engine is useful as a reference but is not evidence that PS5 binary conversion works.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5825500366 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2#issuecomment-5825500366). Originally posted by [SamG-Coder](https://github.com/SamG-Coder) on 2026-09-25T02:06:54Z. --- Moved the original homebrew investigation here to preserve it, including the project links and reproduction commands. HOMEBREW_TESTING.md has been removed from the proposed tree; this PR now changes only the two CMake files. The notes below are a historical snapshot from commit 0968c32, not a statement of current compatibility or the current development plan. --- # Homebrew investigation, 2026-09-25 Baseline: SamG-Coder/AnyPS5, commit `2778c1e`. ## Verified locally - Cloned the fork and initialized all seven submodules at their pinned revisions. - Configured on Windows with CMake/Ninja and MSYS2 UCRT64 GCC 16.2.0. - Built `relinker`, `strict_nid_filter_tests`, and `windows_dependency_diagnostics_tests`. - Both existing test executables passed. Initially CTest discovered zero tests. - Enabled root CTest registration when `BUILD_TESTING=ON` and registered the Windows diagnostics test. The latter is included in normal builds only when testing is enabled. - After the CMake changes, CTest discovered and passed both tests. - Tried relinking two real PS5 homebrew binaries to Windows. Both failed with exit code 2; neither produced a game executable. This verifies the relinker build and these two test suites only. The compatibility libraries, shader pipeline, and game execution have not been built or validated in this investigation. Upstream documents a specific WinLibs GCC 15.2.0 toolchain requirement for its Windows libc implementation; the compiler used here does not establish compatibility with that requirement. ## Reproduce the build Run from the repository root in PowerShell. These paths match this workstation: ```powershell $env:PATH = 'C:\msys64\ucrt64\bin;' + $env:PATH cmake -S . -B build -G Ninja ` -DCMAKE_MAKE_PROGRAM=C:/msys64/ucrt64/bin/ninja.exe ` -DCMAKE_C_COMPILER=C:/msys64/ucrt64/bin/gcc.exe ` -DCMAKE_CXX_COMPILER=C:/msys64/ucrt64/bin/g++.exe ` -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON cmake --build build --target relinker strict_nid_filter_tests windows_dependency_diagnostics_tests -j 8 ctest --test-dir build --output-on-failure ``` ## Public PS5 homebrew inputs Downloaded directly from [ps5-payload-dev/websrv v0.34](https://github.com/ps5-payload-dev/websrv/releases/tag/v0.34). Downloads remain in the ignored `downloads/` directory; no game binaries or data are added to Git. | Archive | SHA-256 | | --- | --- | | Omnispeak.zip | 7A4D82BF58EF7406A4C9050EC298195C548D387FEBC28FD814C3BF9026BB231B | | CrispyDoom.zip | C0C37713703E109F43B1B598CF5790D969097A2BAF961693A0FD0E03956A3C59 | [Omnispeak](https://github.com/sulix/omnispeak) is an open-source Commander Keen engine. Its upstream README links Keen 4 shareware data, and the PS5 package includes CK4 data. The [PS5 build recipe](https://github.com/ps5-payload-dev/websrv/blob/master/homebrew/Omnispeak/build.sh) identifies how that package is assembled. [Crispy Doom's PS5 recipe](https://github.com/ps5-payload-dev/websrv/blob/master/homebrew/CrispyDoom/build.sh) builds the engine and packages shareware data. [Freedoom](https://freedoom.github.io/) is a separate free-content candidate for later compatibility testing; it has not been downloaded or tested here. These PS5 builds are ELF payloads, not ISO disc images. An engine's open-source license does not automatically apply to original commercial game data. ```powershell .\build\core\relinker\relinker.exe --windows ` downloads\Omnispeak\omnispeak.elf downloads\omnispeak.exe .\build\core\relinker\relinker.exe --windows ` downloads\CrispyDoom\CrispyDoom\crispy-doom.elf downloads\crispy-doom.exe ``` Both currently report: ```text System: Windows; unused-filter=0 FAIL: Neither DT_OS_ nor DT_ variant present for DT_PLTGOT ``` ## Why this is more than a missing table `RelinkerPipeline.cpp` unconditionally requires PLTGOT, PLTRELSZ, PLTREL, and JMPREL metadata. Inspection of Omnispeak with objdump shows ordinary RELA relocations but no PLTGOT/PLT relocation tags. Supporting ELF files without PLT relocations is a candidate improvement, but simply bypassing the requirement does not establish a runnable conversion. The [PS5 payload SDK startup](https://github.com/ps5-payload-dev/sdk/blob/master/crt/crt.c) takes a `payload_args_t` pointer and initializes console-specific kernel and dynamic-linker facilities. Its [entry assembly](https://github.com/ps5-payload-dev/sdk/blob/master/crt/_start.S) calls that startup. Homebrew payload startup therefore needs separate compatibility analysis and likely an adapter. Omnispeak imports `libkernel_web.sprx` and `libSceLibcInternal.sprx`, among other libraries. In this AnyPS5 revision, the former contains only `APS5_DUMMY_FUN`, while the latter exposes only a heap tracing stub. File presence is not evidence of implemented compatibility. ## Suggested next milestones 1. Create a tiny source-owned executable fixture with a documented entry ABI, one imported function, and a verifiable exit value. Relink it and execute the result on Windows. 2. Add regression coverage for ELF files without PLT relocations before changing their handling. 3. Report unsupported payload startup and missing imports explicitly, then implement the minimum required compatibility path. 4. Advance to a framebuffer demo, input, and audio before retrying a complete homebrew game. Keep conversion, loader startup, first rendered frame, and playable gameplay as distinct results. A native Windows build of the same open-source engine is useful as a reference but is not evidence that PS5 binary conversion works.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!2
No description provided.