runtime: link the fixtures with no base relocations with /INCREMENTAL:NO (OLD-10053 / BUILD-1550) #1147

Closed
ambroseautomation wants to merge 1 commit from upstream-pr/1147 into main
ambroseautomation commented 2026-11-24 19:12:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ambroseautomation on 2026-11-24T19:12:32Z.


Claimed in the coordination issue as: OLD-10053 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7141743369)

What and why

Carries forward old-pr/10053 (draft #319, original commit author QemmHD preserved; indexed in #17; BUILD-1550), rebased cleanly onto current main.

Fixes clean Debug / RelWithDebInfo CMake+Ninja builds on Visual Studio 2026 18.6 (MSVC linker 14.51), which crashes with manifest.res : fatal error LNK1000: Internal error during IncrCalcPtrs on incremental relinks of images that have no base relocations:

  • Adds /INCREMENTAL:NO to the four relocation-less runtime test fixtures in runtime/CMakeLists.txt (tiny_game_fixed, tiny_tls_cb_only, dll_thread_calls, gameinput_host).
  • Adds tests/test_runtime_incremental_link.py to verify that every /FIXED or /NODEFAULTLIB target in runtime/CMakeLists.txt specifies /INCREMENTAL:NO.

Tested

  • python -I tests/test_runtime_incremental_link.py -v: 2 tests, OK.
  • python -I scripts/check_no_game_data.py runtime/CMakeLists.txt tests/test_runtime_incremental_link.py: exit 0 (no game data).

GPUs tested: n/a (CMake linker configuration + Python stdlib regression test on Windows 11 Pro 64-bit, Python 3.12.10)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a — CMake runtime build fix)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5478648010 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1147). Originally posted by [ambroseautomation](https://github.com/ambroseautomation) on 2026-11-24T19:12:32Z. --- Claimed in the coordination issue as: OLD-10053 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7141743369) ### What and why Carries forward `old-pr/10053` (draft #319, original commit author `QemmHD` preserved; indexed in #17; BUILD-1550), rebased cleanly onto current `main`. Fixes clean Debug / RelWithDebInfo CMake+Ninja builds on Visual Studio 2026 18.6 (MSVC linker `14.51`), which crashes with `manifest.res : fatal error LNK1000: Internal error during IncrCalcPtrs` on incremental relinks of images that have no base relocations: - Adds `/INCREMENTAL:NO` to the four relocation-less runtime test fixtures in `runtime/CMakeLists.txt` (`tiny_game_fixed`, `tiny_tls_cb_only`, `dll_thread_calls`, `gameinput_host`). - Adds `tests/test_runtime_incremental_link.py` to verify that every `/FIXED` or `/NODEFAULTLIB` target in `runtime/CMakeLists.txt` specifies `/INCREMENTAL:NO`. ### Tested - `python -I tests/test_runtime_incremental_link.py -v`: 2 tests, OK. - `python -I scripts/check_no_game_data.py runtime/CMakeLists.txt tests/test_runtime_incremental_link.py`: exit 0 (no game data). GPUs tested: n/a (CMake linker configuration + Python stdlib regression test on Windows 11 Pro 64-bit, Python 3.12.10) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a — CMake runtime build fix)
abnalstlll-byte commented 2026-11-24 19:22:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T19:22:06Z.

Review: APPROVED


Reviewed and verified. Resolves VS 2026 18.6 linker crash (\LNK1000: Internal error during IncrCalcPtrs) by linking fixtures without base relocations (\ iny_game_fixed, \ iny_tls_cb_only, \dll_thread_calls, \gameinput_host) with /INCREMENTAL:NO. Clean regression test in \ ests/test_runtime_incremental_link.py. 100% clean-room.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045830845 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1147#pullrequestreview-6045830845). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T19:22:06Z. **Review:** APPROVED --- Reviewed and verified. Resolves VS 2026 18.6 linker crash (\LNK1000: Internal error during IncrCalcPtrs\) by linking fixtures without base relocations (\ iny_game_fixed\, \ iny_tls_cb_only\, \dll_thread_calls\, \gameinput_host\) with \/INCREMENTAL:NO\. Clean regression test in \ ests/test_runtime_incremental_link.py\. 100% clean-room.
kawaii-shakal commented 2026-11-24 19:23:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kawaii-shakal on 2026-11-24T19:23:34Z.


I clean-built all four affected targets at 55aaab47 on native Windows using the CMake NMake Makefiles generator, once in Debug and once in RelWithDebInfo. All eight links succeeded. In every verbose link invocation, the target-specific /INCREMENTAL:NO followed the configuration-wide /INCREMENTAL; CMake selected the non-incremental link path. Both Python regression tests also passed. My installed MSVC toolset was 14.50.35717, so this verifies the generated linker behavior; I did not reproduce the original 14.51 linker crash.

— Codex

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7142030360 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1147#issuecomment-7142030360). Originally posted by [kawaii-shakal](https://github.com/kawaii-shakal) on 2026-11-24T19:23:34Z. --- I clean-built all four affected targets at 55aaab47 on native Windows using the CMake NMake Makefiles generator, once in Debug and once in RelWithDebInfo. All eight links succeeded. In every verbose link invocation, the target-specific `/INCREMENTAL:NO` followed the configuration-wide `/INCREMENTAL`; CMake selected the non-incremental link path. Both Python regression tests also passed. My installed MSVC toolset was 14.50.35717, so this verifies the generated linker behavior; I did not reproduce the original 14.51 linker crash. — Codex
Deedlyy commented 2026-11-24 20:13:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:13:10Z.


Recommendation: [MERGE]

Reasoning: Carries #319: links the four relocation-less runtime test fixtures with /INCREMENTAL:NO, avoiding the VS 2026 18.6 linker's LNK1000 internal error on incremental relinks. Small build change with a test. Verified by kawaii-shakal on native Windows (Debug and RelWithDebInfo). CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 3/10

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7143207253 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1147#issuecomment-7143207253). Originally posted by [Deedlyy](https://github.com/Deedlyy) on 2026-11-24T20:13:10Z. --- **Recommendation:** [MERGE] **Reasoning:** Carries #319: links the four relocation-less runtime test fixtures with `/INCREMENTAL:NO`, avoiding the VS 2026 18.6 linker's LNK1000 internal error on incremental relinks. Small build change with a test. Verified by kawaii-shakal on native Windows (Debug and RelWithDebInfo). CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 3/10
QemmHD commented 2026-11-24 22:37:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T22:37:44Z.


VS 2026 before/after, as promised. This is my original BUILD-1550 fix, so I'll leave the review and merge to others; this is just evidence.

Toolchain: VS 2026 Build Tools, Microsoft (R) C/C++ Optimizing Compiler Version 19.51.36246 for x64, Microsoft (R) Incremental Linker Version 14.51.36246.0. Clean Ninja RelWithDebInfo configure, building the fixture targets tiny_game_fixed, tiny_tls_cb_only, dll_thread_calls and gameinput_host.

Plain main 2a5ff9714: the linker crashes on 3 of the 4 fixtures (gameinput_host.dll, dll_thread_calls.dll, tiny_game_fixed.exe). Each one shows:

  Version 14.51.36246.0
  ExceptionCode            = C0000005
manifest.res : fatal error LNK1000: Internal error during IncrCalcPtrs
Access violation

Each failing link line carries /debug /INCREMENTAL, and ninja stops. tiny_tls_cb_only.dll happened to link.

Main + this PR (55aaab479): all 4 fixtures link (build rc 0). Each link line now has /INCREMENTAL:NO after CMake's default /INCREMENTAL, with no LNK warnings. With that VS 2026 build, loader_tls, dll_thread_calls and gameinput_host pass 3/3.

VS 2022 (Windows 11 / RTX 4070 SUPER, VS 2022 Build Tools + Ninja): the full build is fine either way. test_runtime_incremental_link passes 2/2, and the affected ctests pass 14/14 both plain and with LEONIDA_VK_VALIDATION=1. In a cumulative run with 12 other PRs on main 540d5111f, full ctest is 316/317, and the only failure is the pre-existing d3d12_depth_resolve.

Thanks @ambroseautomation for carrying it forward.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7146457390 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1147#issuecomment-7146457390). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-24T22:37:44Z. --- VS 2026 before/after, as promised. This is my original BUILD-1550 fix, so I'll leave the review and merge to others; this is just evidence. **Toolchain:** VS 2026 Build Tools, `Microsoft (R) C/C++ Optimizing Compiler Version 19.51.36246 for x64`, `Microsoft (R) Incremental Linker Version 14.51.36246.0`. Clean Ninja RelWithDebInfo configure, building the fixture targets `tiny_game_fixed`, `tiny_tls_cb_only`, `dll_thread_calls` and `gameinput_host`. **Plain main 2a5ff9714:** the linker crashes on 3 of the 4 fixtures (`gameinput_host.dll`, `dll_thread_calls.dll`, `tiny_game_fixed.exe`). Each one shows: ``` Version 14.51.36246.0 ExceptionCode = C0000005 manifest.res : fatal error LNK1000: Internal error during IncrCalcPtrs Access violation ``` Each failing link line carries `/debug /INCREMENTAL`, and ninja stops. `tiny_tls_cb_only.dll` happened to link. **Main + this PR (55aaab479):** all 4 fixtures link (build rc 0). Each link line now has `/INCREMENTAL:NO` after CMake's default `/INCREMENTAL`, with no LNK warnings. With that VS 2026 build, `loader_tls`, `dll_thread_calls` and `gameinput_host` pass 3/3. **VS 2022** (Windows 11 / RTX 4070 SUPER, VS 2022 Build Tools + Ninja): the full build is fine either way. `test_runtime_incremental_link` passes 2/2, and the affected ctests pass 14/14 both plain and with `LEONIDA_VK_VALIDATION=1`. In a cumulative run with 12 other PRs on main 540d5111f, full ctest is 316/317, and the only failure is the pre-existing `d3d12_depth_resolve`. Thanks @ambroseautomation for carrying it forward. AI-assisted (Claude Code, Claude Opus 5.5).
potatoe0100 commented 2026-11-25 10:01:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by potatoe0100 on 2026-11-25T10:01:33Z.


Data point from a second machine, without this PR: RTX 4060 box, Windows 11 26300.

  • VS 2026 Build Tools 18.6 (MSVC 14.51), main at 626d1281a, scripts\build_runtime.ps1: LNK1000: Internal error during IncrCalcPtrs on tiny_game_fixed.exe, then on gameinput_host.dll and dll_thread_calls.dll on a rerun.
  • After updating to VS 2026 18.12.1 (MSVC 14.52), the same script on main (no /INCREMENTAL:NO on those fixtures) builds cleanly and all three fixtures link.

So this matches the note in the diff that newer VS 2026 releases fix the linker; this PR still helps anyone on 18.6.

AI-assisted (Claude Code); posted by a non-developer tester.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7159120953 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1147#issuecomment-7159120953). Originally posted by [potatoe0100](https://github.com/potatoe0100) on 2026-11-25T10:01:33Z. --- Data point from a second machine, without this PR: RTX 4060 box, Windows 11 26300. - VS 2026 Build Tools 18.6 (MSVC 14.51), `main` at `626d1281a`, `scripts\build_runtime.ps1`: `LNK1000: Internal error during IncrCalcPtrs` on `tiny_game_fixed.exe`, then on `gameinput_host.dll` and `dll_thread_calls.dll` on a rerun. - After updating to VS 2026 18.12.1 (MSVC 14.52), the same script on `main` (no `/INCREMENTAL:NO` on those fixtures) builds cleanly and all three fixtures link. So this matches the note in the diff that newer VS 2026 releases fix the linker; this PR still helps anyone on 18.6. AI-assisted (Claude Code); posted by a non-developer tester.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1147
No description provided.