Skip to content

fix(libc): link the thread-name test against libc for its personality routine - #8635

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
dantdmdarealguy:fix/libc-thread-name-test-personality
Oct 21, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
dantdmdarealguy:fix/libc-thread-name-test-personality

Conversation

@dantdmdarealguy

Copy link
Copy Markdown
Contributor

What

Fixes the Windows Debug build of thread_name_tests. The test came in with #5862 and is registered only under if(WIN32). A WinLibs GCC 15.2.0 build with -DCMAKE_BUILD_TYPE=Debug fails to link it on main:

FAILED: [code=1] tests/thread_name_tests.exe
ld.exe: core/libs/prx/libc/CMakeFiles/thread_name_tests.dir/__/__/tests/ThreadName.cpp.obj:ThreadName.cpp:(.data+0x0): undefined reference to `__gxx_personality_v0'
collect2.exe: error: ld returned 1 exit status

core/libs compiles with -fno-asynchronous-unwind-tables on MinGW, so the cleanup of the std::wstring temporary in ThreadName.cpp uses DWARF unwinding and needs __gxx_personality_v0. The SEH libstdc++ of WinLibs exports only __gxx_personality_seh0. On Windows, __gxx_personality_v0 comes from libc.prx (prx/libc/src/exception/Personality.cpp), and thread_name_tests does not link libc. In Release, -O3 removes the landing pad, so the Release object references neither __gxx_personality_v0 nor _Unwind_Resume (checked with nm). That is why Windows CI, which builds Release only, links the test fine.

The fix gives the test the same three lines as log_macros_tests next to it, which is also what #1873 (7add840f1), #6267 and #7733 did for other tests: link libc, configure_windows_unwind, and prepend libc's directory to the test's PATH. The test source and Linux are unchanged.

Tested

Windows 11 Pro, Intel Core i9-14900K, 128 GB RAM, NVIDIA GeForce RTX 5080 (driver 32.0.16.1742), WinLibs GCC 15.2.0, Ninja, BUILD_TESTING=ON, every AGC execution test built.

  • Debug build of main: thread_name_tests fails to link with the error above, and ctest -R "^thread_name$" reports Not Run. Reproduced twice: in a full -k 0 build of 083a3be61, and by rebuilding only that target after stashing the change. With this change it links, and ctest -R "^thread_name$" passes 3 of 3 in Debug and 3 of 3 in Release.
  • Full Debug ctest --parallel 2 --timeout 300 on 083a3be61 with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1: 1761 of 1763 pass. The only failures are thread_name and agc_driver_image_array_window_past_layer_limit. The second does not build with MinGW and is fixed by test(agc): align the array window test's texels at run time #8310.
  • Rebased on 434e965d4: the full Release build and the libs target build with no warnings in the touched file. The only build error is test(agc): align the array window test's texels at run time #8310's object, and with test(agc): align the array window test's texels at run time #8310 applied on a local branch the full build succeeds. ctest -R "^thread_name$|patched_libraries|^log_macros" passes 4/4, with 354 patched libraries loaded and 0 failed. tools/check_test_registration.py passes for the Release and Debug builds, and so do tools/check_conventions.py --base origin/main and tools/pr_overlap.py --branch agent/winsweep2. The overlap tool could not compare 9 conflicting PRs that touch core/libs/prx/libc/CMakeLists.txt; none of their diffs touches thread_name.

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
  • AI-assisted: yes, some AI assistance was used

@github-actions

github-actions Bot commented Oct 20, 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 5021 core/libs/prx/libc/CMakeLists.txt
PR 6044 core/libs/prx/libc/CMakeLists.txt
PR 6819 core/libs/prx/libc/CMakeLists.txt
PR 7081 core/libs/prx/libc/CMakeLists.txt
PR 7201 core/libs/prx/libc/CMakeLists.txt
PR 7715 core/libs/prx/libc/CMakeLists.txt
PR 8150 core/libs/prx/libc/CMakeLists.txt
PR 8520 core/libs/prx/libc/CMakeLists.txt

@oneandonlydean
oneandonlydean merged commit 33a6d6b into boykopovar:main Oct 21, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants