Skip to content

Tests: the no-CRT fixtures link in Debug - #3680

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
Sc4ros:dll-thread-calls-debug-link
Nov 23, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
Sc4ros:dll-thread-calls-debug-link

Conversation

@Sc4ros

@Sc4ros Sc4ros commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Claim: #3574 (comment)

AI-assisted (Claude Code). Test-only change; no game files.

Problem

The dll_thread_calls fixture (from #2383) and tiny_tls_cb_only link with /NODEFAULTLIB, but the Visual Studio generator's default Debug config compiles with /RTC1. Its checks reference _RTC_InitBase and _RTC_Shutdown, so a Debug build fails with LNK1120. CI builds RelWithDebInfo, so only local Debug builds hit it. Found while fixing the same thing for gameinput_host in #2420 (review by JRamos1993).

Change

Both fixtures define the two functions as no-ops under #ifdef __MSVC_RUNTIME_CHECKS. Nothing else changes; Release and RelWithDebInfo do not define the macro, so they are untouched.

Tested

Windows 11 build 26300, MSVC 19.44 (Visual Studio generator), AMD Radeon RX 9060 XT (32.0.32029.2010). Base f847748c, head a83d28fb.

  • Before: cmake --build runtime/build --config Debug --target dll_thread_calls tiny_tls_cb_only fails with LNK2001 _RTC_InitBase, _RTC_Shutdown and LNK1120 for each.
  • After: both build in Debug; ctest -C Debug -R "loader_tls|dll_thread_calls" passes 2/2.
  • Release: same targets build, ctest -C Release -R "loader_tls|dll_thread_calls" passes 2/2.

🤖 Generated with Claude Code

dll_thread_calls and tiny_tls_cb_only link with /NODEFAULTLIB, but the Visual Studio generator's Debug config compiles with /RTC1,
whose checks reference _RTC_InitBase and _RTC_Shutdown: LNK1120 in Debug. Both fixtures define the two as no-ops when
__MSVC_RUNTIME_CHECKS is set. Release and RelWithDebInfo are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Maraco91

Copy link
Copy Markdown

Tested a83d28f on Windows 11, MSVC 19.42 (VS 2022 Build Tools), Windows SDK 10.0.28000.0, with the Ninja generator and -DCMAKE_BUILD_TYPE=Debug: pass

The description reproduces this with the Visual Studio generator. It is not specific to it: CMake's default Debug flags for MSVC carry /RTC1 under Ninja too, so scripts\build_runtime.ps1 -Debug hits the same error.

  • This head, Debug: dll_thread_calls, tiny_tls_cb_only, loader_tls_test and dll_thread_calls_test build, and ctest -R "loader_tls|dll_thread_calls" passes 2/2.
  • The two fixtures restored to main, same build folder: the link fails with tiny_tls_cb_only.cpp.obj : error LNK2001: _RTC_InitBase, LNK2001: _RTC_Shutdown and fatal error LNK1120 (Ninja stopped at that first target, so I did not see the second fixture's error separately).
  • RelWithDebInfo is untouched: __MSVC_RUNTIME_CHECKS is not defined there.

No blocker found. No GPU is involved in these two tests.

AI-assisted (Claude Code); test fixtures only, no game files.

@itsonlysimbo

Copy link
Copy Markdown
Contributor

Tested a83d28fb on RTX 4070, NVIDIA 621.14, Windows 11 (10.0.26300), MSVC 19.44, Vulkan SDK 1.4.363, with the Ninja generator (the PR used the Visual Studio generator), -DCMAKE_BUILD_TYPE=Debug: pass.

  • Plain main f847748c in Debug fails to link: tiny_tls_cb_only.cpp.obj : error LNK2001: unresolved external symbol _RTC_InitBase and _RTC_Shutdown, then LNK1120; loader_tls and dll_thread_calls are Not Run.
  • This branch in Debug builds, and ctest -R "loader_tls|dll_thread_calls" passes 2/2.
  • RelWithDebInfo: ctest 140/140; run_gpu_tests.py 153/199 passed, 46 skipped, 0 failed, same as main.

AI-assisted (Claude Code).

@ItsNotRexed
ItsNotRexed merged commit 833a541 into ItsNotRexed:main Nov 23, 2026
2 of 4 checks passed
@Sc4ros
Sc4ros deleted the dll-thread-calls-debug-link branch November 23, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants