Skip to content

runtime: link no-relocation fixtures without incremental linking - #2215

Open
whoalin1 wants to merge 1 commit into
ProjectLeonida:mainfrom
whoalin1:runtime-incremental-no-reloc-fixtures
Open

whoalin1 wants to merge 1 commit into
ProjectLeonida:mainfrom
whoalin1:runtime-incremental-no-reloc-fixtures

Conversation

@whoalin1

Copy link
Copy Markdown
Contributor

Summary

  • pass /INCREMENTAL:NO when linking fixture images that have no base relocations (/FIXED or /NODEFAULTLIB)
  • cover tiny_game_fixed, tiny_tls_cb_only, dll_thread_calls, and gameinput_host
  • add a small static regression test so a new fixture of that kind does not regress the workaround

Item: BUILD-INCREMENTAL-NO-RELOC-FIXTURES

This carries forward the still-uncarried fix in old-pr/10053, originally written by wavehs, reapplied and verified on current main. The original report measured MSVC 14.51.35927 crashing with LNK1000 in IncrCalcPtrs on the default incremental relink of images with no base-relocation table; Microsoft fixed the linker itself in Visual Studio 2026 18.6, but non-incremental links are also correct for these fixtures.

Tests

Under the local machine coordination lock:

  • control: the static guard fails on unpatched runtime/CMakeLists.txt, finding all four vulnerable targets
  • fixed: python -I tests/test_runtime_incremental_link.py — 2 tests, OK
  • python -m compileall -q tests/test_runtime_incremental_link.py — pass
  • git diff --cached --check — pass

No game files or GPU.

AI-assisted with Devin.

@lixonik lixonik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent native RelWithDebInfo / Ninja check on MSVC 19.44: both Python tests passed. All four PE fixtures built, then relinked successfully after their object timestamps changed. Each generated link command ends its incremental-link flags with /INCREMENTAL:NO, and none produced an .ilk file. This exercises the actual fixture link rules on 19.44. AI-assisted.

@Tyrannys

Tyrannys commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Independent verification of head e895cca95 merged into current main (ec91d695c); runtime/CMakeLists.txt auto-merges.

Machine: profile M (RTX 4070 SUPER 12 GB desktop, NVIDIA 621.01, Windows 11 Pro 26300, Ryzen 7 9800X3D), MSVC 14.52 (VS 2026, MSBuild generator), RelWithDebInfo, LEONIDA_SDL3_FETCH=ON. No game files.

Tests:

  • python -I tests/test_runtime_incremental_link.py against main's runtime/CMakeLists.txt (via LEONIDA_RUNTIME_CMAKE): fails, listing dll_thread_calls, gameinput_host, tiny_game_fixed, tiny_tls_cb_only. Against the merged file: 2 tests OK. So the guard catches what it should.
  • The four fixtures build and their tests pass: run_tiny_game_fixed, run_tiny_game_fixed_exit_code, loader_tls* (4), dll_thread_calls, gameinput_host.

Limits: my linker is MSVC 14.52 with the MSBuild generator, not 14.51 with Ninja, so I could not reproduce the LNK1000 crash. This run only shows that /INCREMENTAL:NO does no harm here.

Small point: the PR body says the linker was fixed in VS 2026 18.6, but the new CMake comment says 18.6 crashes and it was "Fixed in VS 2026 18.7". One of them should change.

Full suite: this PR was tested together with #2173, #2152, #2170 and #2215 (they touch separate code) merged into main ec91d695c. ctest -j 6: 500/502; the two failures, xbox_present and d3d12_set_descriptor_heaps, fail on plain main here as well (known). Plain main baseline (first run in a fresh build dir): same two, plus xs_proxy_mock, d3d12_queue_handover_two_queues and timeouts in big_compile_gate and api_ref_state that still failed in a serial rerun there but pass on this tree. I take those as first-run noise on main, not as something this PR fixes. No new failure.

AI-assisted (Claude Code).

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.

3 participants