Skip to content

feat(windows): support MSYS2 GCC runtime builds - #8087

Open
harry-z-kang wants to merge 1 commit into
boykopovar:mainfrom
harry-z-kang:codex/windows-seh-runtime
Open

harry-z-kang wants to merge 1 commit into
boykopovar:mainfrom
harry-z-kang:codex/windows-seh-runtime

Conversation

@harry-z-kang

@harry-z-kang harry-z-kang commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

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, and this branch now contains one commit on current main.

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.

Tested

  • Current main e41fb9db5, Windows NT 26300: rebuilt the focused MSYS2 targets; all 29 unwind, exception, module-info, timer, context and ATRAC9 tests passed (10.43 s).
  • Missing-runtime regression: full BUILD_TESTING=ON configuration with standalone Scoop GCC fails immediately with Cannot locate MinGW runtime: libgcc_s_seh-1.dll; relinker-only configuration with that same compiler succeeds. MSYS2 configuration succeeds with its adjacent runtime DLLs.
  • Actionlint 1.7.12, all 11 CI-gating unit tests, conventions and whitespace checks passed. The nightly cache-key shell step was executed successfully locally. The new scheduled workflow has not run on GitHub yet.
  • Earlier full MSYS2 build and libs build passed on base 252cbc29b; CTest reported 1,670 passed, 19 skipped, 1 failed out of 1,690. The failure was agc_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_write and agc_driver_pm4 passed under both toolchains with validation enabled.
  • That historical run used NVIDIA GeForce RTX 5080, driver 617.42, Windows NT 26300, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation; verbose logs confirmed the layer loaded. agc_sparse_run_import_copied passes but logs VUID-vkCmdCopyBuffer-srcBuffer-00118 under both toolchains. No GPU implementation files change.
  • Historical coverage gaps include the 19 skips (120 Hz display mode unavailable and Windows long paths disabled account for two strict-skip-checker warnings) and the existing shader_cache_runtime_sources fixture 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

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (runtime/build changes; historical qualification on NVIDIA GeForce RTX 5080, driver 617.42, Windows NT 26300)
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Some 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.

Pull request Shared files not compared
PR 674 docs/dev/BUILD.md
PR 1835 docs/dev/BUILD.md
PR 3965 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 3987 docs/dev/debt/libc.md
PR 4627 core/libs/prx/libc/CMakeLists.txt
PR 5021 core/libs/CMakeLists.txt
core/libs/prx/libc/CMakeLists.txt
docs/dev/BUILD.md
docs/dev/debt/libc.md
PR 5303 docs/dev/debt/libc.md
PR 6044 core/libs/CMakeLists.txt
core/libs/prx/libSceAjm.native/CMakeLists.txt
core/libs/prx/libc/CMakeLists.txt
core/libs/tests/GuestMessageDestructorAbi.S
core/libs/tests/GuestMessageDestructorAbi.cpp
core/libs/tests/GuestModuleInfo.cpp
PR 6084 core/libs/prx/libc/CMakeLists.txt
PR 6085 core/libs/prx/libc/CMakeLists.txt
PR 6086 core/libs/prx/libc/CMakeLists.txt
PR 6469 docs/dev/debt/libc.md
PR 6565 docs/dev/debt/libc.md
PR 6713 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 6819 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/src/exception/Unwind.cpp
docs/dev/debt/libc.md
PR 6879 docs/dev/BUILD.md
docs/dev/debt/libc.md
PR 6977 core/libs/prx/libSceAjm.native/CMakeLists.txt
PR 7081 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7192 core/libs/prx/libc/src/specifics/windows/CrashReport.cpp
PR 7201 core/libs/CMakeLists.txt
core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/src/exception/Unwind.cpp
core/libs/tests/GuestModuleInfo.cpp
PR 7275 core/libs/CMakeLists.txt
PR 7386 docs/dev/debt/libc.md
PR 7447 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7544 docs/dev/debt/libc.md
PR 7622 core/libs/CMakeLists.txt
core/libs/prx/libc/src/specifics/windows/CrashReport.cpp
PR 7648 docs/dev/debt/libc.md
PR 7715 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7780 core/libs/CMakeLists.txt
PR 7851 core/libs/prx/libc/CMakeLists.txt
PR 7920 docs/dev/BUILD.md
PR 7952 docs/dev/debt/libc.md
PR 8150 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8227 docs/dev/BUILD.md
PR 8264 core/libs/CMakeLists.txt
PR 8279 docs/dev/debt/libc.md
PR 8284 docs/dev/debt/libc.md
PR 8285 core/libs/CMakeLists.txt
PR 8287 docs/dev/debt/libc.md
PR 8306 docs/dev/debt/libc.md
PR 8311 core/libs/CMakeLists.txt
core/libs/prx/libc/CMakeLists.txt
PR 8373 core/libs/prx/libkernel/Pthread/src/Mutex.cpp
PR 8376 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8384 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8397 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8415 core/libs/CMakeLists.txt
PR 8417 docs/dev/debt/libc.md
PR 8460 core/libs/CMakeLists.txt
PR 8493 core/libs/CMakeLists.txt
PR 8520 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8546 docs/dev/debt/libc.md
PR 8550 docs/dev/debt/libc.md
PR 8561 core/libs/CMakeLists.txt
PR 8568 docs/dev/BUILD.md
PR 8617 core/libs/prx/libkernel/Pthread/src/Mutex.cpp
PR 8619 docs/dev/BUILD.md
PR 8629 core/libs/CMakeLists.txt
PR 8650 core/libs/CMakeLists.txt
PR 8658 core/libs/CMakeLists.txt
core/libs/prx/libc/CMakeLists.txt
core/libs/tests/GuestModuleInfo.cpp
PR 8720 docs/dev/debt/libc.md
PR 8730 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8740 docs/dev/BUILD.md
PR 8855 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8863 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8864 docs/dev/debt/libc.md
PR 8865 docs/dev/debt/libc.md
PR 8872 docs/dev/debt/libc.md
PR 8880 docs/dev/debt/libc.md
PR 8901 core/libs/prx/libc/CMakeLists.txt
PR 8903 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8937 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8941 docs/dev/debt/libc.md
PR 8965 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8968 docs/dev/BUILD.md
PR 8974 core/libs/prx/libc/CMakeLists.txt
PR 8979 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8987 core/libs/CMakeLists.txt
PR 9001 docs/dev/debt/libc.md
PR 9016 docs/dev/BUILD.md
PR 9019 core/libs/CMakeLists.txt
PR 9034 core/libs/prx/libSceAjm.native/CMakeLists.txt
PR 9037 core/libs/CMakeLists.txt
PR 9038 docs/dev/debt/libc.md
PR 9063 core/libs/CMakeLists.txt
PR 9071 docs/dev/debt/libc.md
PR 9087 docs/dev/debt/libc.md
PR 9109 docs/dev/debt/libc.md
PR 9133 docs/dev/debt/libc.md
PR 9137 core/libs/CMakeLists.txt
PR 9141 core/libs/CMakeLists.txt
PR 9156 core/libs/CMakeLists.txt
PR 9160 core/libs/CMakeLists.txt
PR 9161 core/libs/CMakeLists.txt
PR 9162 core/libs/CMakeLists.txt
PR 9163 core/libs/prx/libc/CMakeLists.txt
PR 9165 core/libs/prx/libkernel/Pthread/src/Mutex.cpp
PR 9170 docs/dev/debt/libc.md
PR 9171 core/libs/CMakeLists.txt
PR 9181 docs/dev/debt/libc.md

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Thanks, this is careful work. Two questions while this waits for a maintainer decision on the extra Windows CI lane:

  1. Your MSYS2 run reports 1,670 passed, 19 skipped, 1 failed out of 1,690. Which test failed, and does it also fail with WinLibs?
  2. This PR changes fix(build): allow static MinGW runtimes in relinker-only tests #8067's if(ANYPS5_RELINKER_ONLY) continue() into an unconditional continue() in the root CMakeLists.txt. A full build then configures without a missing runtime DLL and fails later at test start (0xc0000135), while fix(build): allow static MinGW runtimes in relinker-only tests #8067 says "Full builds still require all three DLLs". Could you keep the FATAL_ERROR for full builds, or explain why the MSYS2 path needs it dropped? MSYS2 ships the DLLs in ucrt64/bin next to the compiler.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

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.

  1. CI trigger. A second full Windows build on every push to main roughly doubles our Windows CI time. Could you move the msys2 build out of the per-push matrix into a scheduled nightly run, with a workflow_dispatch trigger so it can also be started by hand? The WinLibs row stays as it is.
  2. The one failing test. Your MSYS2 run reported 1,670 passed, 19 skipped and 1 failed out of 1,690. Which test failed, and does it also fail on WinLibs?
  3. Missing runtime DLLs in full builds. This PR makes the continue() from fix(build): allow static MinGW runtimes in relinker-only tests #8067 unconditional in the root CMakeLists.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. fix(build): allow static MinGW runtimes in relinker-only tests #8067 kept "full builds still require all three DLLs". Could you keep the FATAL_ERROR for 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.

@harry-z-kang
harry-z-kang force-pushed the codex/windows-seh-runtime branch from 8909edf to 23e4047 Compare October 20, 2026 10:33
@harry-z-kang

Copy link
Copy Markdown
Contributor Author

Addressed in commit 23e4047:

  1. CI: MSYS2 now has a separate windows-msys2.yml workflow, scheduled daily at 08:23 UTC and runnable through workflow_dispatch. The regular WinLibs .github/workflows/build.yml matches 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.
  2. Failing test: the reported failure was agc_driver_pass_input_hazard, with a 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 on 252cbc29b; the matched compiler comparison uses this branch's SEH and DWARF paths. The PR description now names the failure directly.
  3. Runtime DLLs: MSYS2 does not need the guard removed. Restored main's FATAL_ERROR for full builds with testing enabled, while preserving fix(build): allow static MinGW runtimes in relinker-only tests #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, and Depends on is none. 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build ci .github docs libc libkernel needs rebase Conflicts with main, rebase needed prx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants