feat(windows): support MSYS2 GCC runtime builds #8087
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8087"
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 harry-z-kang on 2026-10-19T20:53:14Z.
What
MSYS2 GCC could not build the full Windows runtime with its native SEH exception model. Support System V ABI SEH frames alongside the existing WinLibs DWARF path, identify project GCC personalities, and preserve guest/host cleanup, typed catches, rethrow and register restoration. Includes the required pthread startup, makecontext frame, thread-description lookup and ATRAC9 fixture fixes.
MSYS2 qualification runs in the separate Windows MSYS2 workflow nightly at 08:23 UTC and through
workflow_dispatch. The regular WinLibs Build workflow is unchanged. Full builds with testing enabled retain the configure-time error for missing runtime DLLs; MSYS2 supplies all three beside the compiler. Relinker-only static-runtime support from merged #8067 is preserved.Standalone Scoop GCC 15.2 remains unsupported for full runtime builds: disabling SEH selects SjLj, and its SEH backend cannot compile System V catch handlers. MSYS2 UCRT64 GCC 16.2.0-6 carries the compiler fix. Unmarked native handlers and SjLj remain in libc debt.
The SHA-1 relinker execution test now reports its instruction bytes, sample, RAX, RCX and RFLAGS when preservation fails. Its register, flag and result checks are unchanged.
Windows TLS coverage fixtures now use the existing bounded cleanup retry helper when a finished executable is temporarily locked. Fixture assertions and the 30-second test timeout are unchanged.
Tested
tls_function_coverage_displacement_r8: all fixture checks completed, butTemporaryDirectoryfailed to remove an executable withWinError 32. A deterministic local reproduction held a real Windows file handle after execution: the original cleanup failed after 12 successful fixture runs, and the fix waited for release and removed the directory. An injected TLS assertion failure still propagated after cleanup.ctest --test-dir b/rw --label-regex '^tls_function_coverage$' --repeat until-fail:3 --parallel 4 --output-on-failure --timeout 30(99 executions, 19.61 s). Conventions and whitespace checks passed.6ef5a1c4c, head4e9854ea2: both commit patches are unchanged. Rebuilt the focused MSYS2 runtime targets; all 36 tests passed (12.31 s). Conventions, whitespace and Actionlint passed.cecb540a6, the affected runtime targets built successfully; all 36 focused MSYS2 tests and all seven WinLibs GCC 15.2 mutex/condition-variable tests passed, including explicit adaptive-mutex initialization.amd64_only_converterunder macOS 26 Rosetta withSHA-1 stub changed a general register or RFLAGS. The relinker implementation is unchanged from main. The failure did not reproduce in 20 unmodified Linux/WSL runs or 100 native Intel macOS runs. The diagnostic change passed another 20 Linux/WSL runs and the upstream Rosetta job. The underlying cause remains unconfirmed; no preservation assertion was removed or relaxed.e41fb9db5, Windows NT 26300: rebuilt the focused MSYS2 targets; all 29 unwind, exception, module-info, timer, context and ATRAC9 tests passed (10.43 s).BUILD_TESTING=ONconfiguration with standalone Scoop GCC fails immediately withCannot locate MinGW runtime: libgcc_s_seh-1.dll; relinker-only configuration with that same compiler succeeds. MSYS2 configuration succeeds with its adjacent runtime DLLs.libsbuild passed on base252cbc29b; CTest reported 1,670 passed, 19 skipped, 1 failed out of 1,690. The failure wasagc_driver_pass_input_hazard: a pass writing indices read by an open pass took no barrier. The same assertion reproduces with WinLibs GCC 15.2 r7 on the same PR code and machine; this comparison uses the DWARF and SEH paths of the branch.agc_driver_storage_file_writeandagc_driver_pm4passed under both toolchains with validation enabled.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation; verbose logs confirmed the layer loaded.agc_sparse_run_import_copiedpasses but logsVUID-vkCmdCopyBuffer-srcBuffer-00118under both toolchains. No GPU implementation files change.shader_cache_runtime_sourcesfixture taking 43.17 s in the full run / 36.10 s alone. No existing timeout was increased. WinLibs 15.2 r7 previously passed 32 focused runtime tests and eight final compatibility checks. Full Linux runtime qualification has not run locally.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T21:09:50Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libc/src/exception/Unwind.cppL259-260, L419-420docs/dev/debt/libc.mdL103-104docs/dev/BUILD.mdL33-34core/libs/tests/GuestModuleInfo.cppL58-59docs/dev/BUILD.mdL15core/libs/prx/libc/src/exception/Unwind.cppL107-108, L110-111, L113-115Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
docs/dev/BUILD.mddocs/dev/BUILD.mdcore/libs/prx/libc/CMakeLists.txtdocs/dev/debt/libc.mdcore/libs/prx/libc/CMakeLists.txtcore/libs/CMakeLists.txtcore/libs/prx/libc/CMakeLists.txtdocs/dev/BUILD.mddocs/dev/debt/libc.mddocs/dev/debt/libc.mdcore/libs/CMakeLists.txtcore/libs/prx/libSceAjm.native/CMakeLists.txtcore/libs/prx/libc/CMakeLists.txtcore/libs/tests/GuestMessageDestructorAbi.Score/libs/tests/GuestMessageDestructorAbi.cppcore/libs/tests/GuestModuleInfo.cppdocs/dev/debt/libc.mddocs/dev/BUILD.mddocs/dev/debt/libc.mdcore/libs/prx/libc/CMakeLists.txtdocs/dev/debt/libc.mdcore/libs/CMakeLists.txtcore/libs/prx/libc/CMakeLists.txtcore/libs/prx/libc/src/exception/Unwind.cppcore/libs/tests/GuestModuleInfo.cppcore/libs/CMakeLists.txtdocs/dev/debt/libc.mdcore/libs/prx/libc/CMakeLists.txtdocs/dev/debt/libc.mdcore/relinker/codegen/tests/Amd64OnlyConverterTests.cppcore/relinker/codegen/tests/Amd64OnlyConverterTests.cppcore/libs/prx/libc/CMakeLists.txtdocs/dev/debt/libc.mdcore/libs/CMakeLists.txtcore/libs/CMakeLists.txtcore/libs/prx/libc/CMakeLists.txtdocs/dev/debt/libc.mdcore/libs/CMakeLists.txtdocs/dev/debt/libc.mdImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T05:00:51Z.
Thanks, this is careful work. Two questions while this waits for a maintainer decision on the extra Windows CI lane:
1,670 passed, 19 skipped, 1 failed out of 1,690. Which test failed, and does it also fail with WinLibs?if(ANYPS5_RELINKER_ONLY) continue()into an unconditionalcontinue()in the rootCMakeLists.txt. A full build then configures without a missing runtime DLL and fails later at test start (0xc0000135), while #8067 says "Full builds still require all three DLLs". Could you keep theFATAL_ERRORfor full builds, or explain why the MSYS2 path needs it dropped? MSYS2 ships the DLLs inucrt64/binnext to the compiler.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T06:43:41Z.
Thanks for this. We'd like to take MSYS2 GCC support, with one change to how its CI runs and two small things to sort out first.
workflow_dispatchtrigger so it can also be started by hand? The WinLibs row stays as it is.continue()from #8067 unconditional in the rootCMakeLists.txt. So a full build with a runtime DLL missing no longer fails at configure time: it fails later, when a test starts, with 0xc0000135. #8067 kept "full builds still require all three DLLs". Could you keep theFATAL_ERRORfor full builds? If MSYS2 needs it dropped, could you explain why?#8067 is merged now, so a rebase onto main should leave just your own commit.
Imported from boykopovar/AnyPS5. Originally posted by harry-z-kang on 2026-10-20T10:34:07Z.
Addressed in commit 23e40477e:
windows-msys2.ymlworkflow, scheduled daily at 08:23 UTC and runnable throughworkflow_dispatch. The regular WinLibs.github/workflows/build.ymlmatches main, so this adds no MSYS2 build to push or PR runs. The nightly job builds the runtime/libraries, runs the registered suite, checks skips, reports slow tests and uploads its test logs.agc_driver_pass_input_hazard, witha pass writing the indices an open pass reads in place took no barrier. It reproduces with both MSYS2 UCRT64 GCC 16.2.0-6 and WinLibs GCC 15.2 r7 on the same PR code and RTX 5080 / driver 617.42 / Windows NT 26300, with Vulkan validation enabled. The 1,690-test figures refer to the historical run based on252cbc29b; the matched compiler comparison uses this branch's SEH and DWARF paths. The PR description now names the failure directly.FATAL_ERRORfor full builds with testing enabled, while preserving #8067's relinker-only exception. Verified the missing-DLL full build fails during CMake configuration and the same static-runtime compiler still configures in relinker-only mode. MSYS2 configuration and all 29 focused runtime checks pass.Rebased onto main
e41fb9db5; #8067 is now part of main, the branch contains only this PR's single commit, andDepends onisnone. Actionlint, the 11 CI-gating unit tests, conventions and whitespace checks pass. The new scheduled workflow was linted and its cache-key shell step was exercised locally; its first hosted run is still pending.