Build: host-only test executables under core/libs keep failing to link on MinGW after merge (__gxx_personality_v0) #11287
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 ycbuzi on 2026-10-26T00:12:16Z.
What happens
On the supported MinGW toolchain, a test executable under
core/libsthat links no guestlibcfails to link withundefined reference to `__gxx_personality_v0'. Pull requests never see this, because the Windows product build doesn't run on pull requests. It has now happened at least four times.Title, test or build step
Linking test executables under
core/libs. The four cases I found:guest_json_tests,fiber_testsspirv_validator_exit_testslibcon MinGWagc_driver_registration_prepare_budget_testsguest_sigvec_modules_testsAnyPS5 commit
mainacb900c194, plus #96267610b45905for the reproduction below.System
Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT, posix-seh, DWARF exceptions), Ninja, Release,
BUILD_TESTING=ON.Steps to reproduce
Merge #9626 onto
main, configure asbuild.ymldoes, then:Log
What was checked
Why it fails. On a DWARF-exception MinGW toolchain,
core/libs/CMakeLists.txt:50compiles everything after it with-fno-asynchronous-unwind-tables. C++ objects with exception landing pads then refer to__gxx_personality_v0, which the guestlibcprovides. An executable that links neitherlibc(directly or through another in-tree library) nor its own unwind runtime fails to link. That happens only when one of its objects has a landing pad. Several host-only test executables onmainlink nolibcand are fine, so the problem can't be found reliably from the CMake files alone: whether an object needs the personality depends on its code.Why CI doesn't catch it. The
windowsjob inbuild.yml(line 558) runs only on pushes tomainand onworkflow_dispatch. A pull request that adds such an executable passes CI and breaks the Windows build when it merges, unless someone builds it on Windows first. That is how #9626 and #10953 were found.The fixes already in the tree:
libcon MinGW (#7733 forspirv_validator_exit_tests).-fasynchronous-unwind-tablesand-static -static-libgcc -static-libstdc++(patched_libraries_tests,core/libs/CMakeLists.txt:328-329). On #10953 this pattern made GCC 15.2 stop withinternal compiler error: in choose_baseaddrin a source withsysv_abicalls. The author then compiled that one source with-fno-exceptions -fno-asynchronous-unwind-tables.Options, if you want to prevent the next one:
configure_host_test_executable(target), applying one of the two fixes on MinGW, mentioned in BUILD or CONVENTIONS for test executables that link no guest library.relinker (windows-latest, g++)job already runs on pull requests with the same toolchain. It could also configure withBUILD_TESTING=ONand build only thecore/libsexecutables that link no in-tree library, found through the CMake File API. Because it's a real link, it can't report a false positive. The cost is a full configure plus those few small targets.I can implement either of the first two if you say which you'd prefer.
AI-assisted: yes (Claude Code)