runtime: link no-relocation fixtures without incremental linking #2215
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2215"
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 ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-26T06:28:19Z.
Summary
/INCREMENTAL:NOwhen linking fixture images that have no base relocations (/FIXEDor/NODEFAULTLIB)tiny_game_fixed,tiny_tls_cb_only,dll_thread_calls, andgameinput_hostItem: 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
LNK1000inIncrCalcPtrson 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:
runtime/CMakeLists.txt, finding all four vulnerable targetspython -I tests/test_runtime_incremental_link.py— 2 tests, OKpython -m compileall -q tests/test_runtime_incremental_link.py— passgit diff --cached --check— passNo game files or GPU.
AI-assisted with Devin.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-26T08:47:47Z.
Review: COMMENTED
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.ilkfile. This exercises the actual fixture link rules on 19.44. AI-assisted.Imported from ubiquitarianism/leonida. Originally posted by Tyrannys on 2026-11-27T14:51:13Z.
Independent verification of head
e895cca95merged into currentmain(ec91d695c);runtime/CMakeLists.txtauto-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.pyagainstmain'sruntime/CMakeLists.txt(viaLEONIDA_RUNTIME_CMAKE): fails, listingdll_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.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
LNK1000crash. This run only shows that/INCREMENTAL:NOdoes 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
mainec91d695c.ctest -j 6: 500/502; the two failures,xbox_presentandd3d12_set_descriptor_heaps, fail on plainmainhere as well (known). Plainmainbaseline (first run in a fresh build dir): same two, plusxs_proxy_mock,d3d12_queue_handover_two_queuesand timeouts inbig_compile_gateandapi_ref_statethat still failed in a serial rerun there but pass on this tree. I take those as first-run noise onmain, not as something this PR fixes. No new failure.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:48:54Z.
Independent verification on Windows 11 (
10.0.26200, x64) ofe895cca952merged onto currentorigin/main(59e65849b0,0git text conflicts), tested under bothPython 3.12.10andPython 3.14.5:PR + origin/main):origin/main'sruntime/CMakeLists.txtalone,python -I -B tests/test_runtime_incremental_link.pyfails (rc=1) listing 5 targets:['dll_thread_calls', 'fixed_base_probe', 'gameinput_host', 'tiny_game_fixed', 'tiny_tls_cb_only'].e895cca952merged ontoorigin/main(59e65849b0),python -I -B tests/test_runtime_incremental_link.pystill fails (rc=1) on bothPython 3.12.10andPython 3.14.5:['fixed_base_probe'] : linked with /FIXED or /NODEFAULTLIB but not /INCREMENTAL:NO.#2215's base,mainaddedfixed_base_probeatruntime/CMakeLists.txt:1461-1464with/NODEFAULTLIBand/FIXED(target_link_options(fixed_base_probe PRIVATE /NODEFAULTLIB /ENTRY:fixed_base_probe_main /FIXED /DYNAMICBASE:NO ...)), without/INCREMENTAL:NO. Adding/INCREMENTAL:NOtofixed_base_proberesolves both theLNK1000exposure on that new fixture and the test failure.git diff --check,python -I -m compileall -q tests/test_runtime_incremental_link.py,python -I scripts/check_no_game_data.py runtime/CMakeLists.txt tests/test_runtime_incremental_link.py,python -I tests/test_ctest_registration.py, andpython -I tests/test_ci_registration.py(18/18) all exited0.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T02:17:00Z.
Tested
e895cca95merged (no commit) withmain53b77df14. GPUs tested: NVIDIA GeForce RTX 3080, driver 621.40, Windows 11 10.0.26300; MSVC 19.52 (Visual Studio 18), Ninja, RelWithDebInfo; Python 3.12.4.check_no_game_data.pyis clean.Blocker: its own test fails once merged with current
main.tests/test_runtime_incremental_link.pyreports['fixed_base_probe'] != [].fixed_base_probe, a/NODEFAULTLIBfixture added by #2525 since this branch, links without/INCREMENTAL:NO. The test does its job; the PR needs that fixture added. With the CMake change back tomain, the same test lists 4 targets, so it is red without the fix and goes green once the new fixture is covered.run_tiny_game_fixed,run_tiny_game_fixed_exit_code,dll_thread_calls,run_tiny_tls_ga) pass, and so do the 20 other tests of the 5 relinked executables. The LNK1000 itself needs a VS 2026 18.6 incremental relink, which I did not reproduce here.gta6rt.exelinks withoutws2_32.libwith nothing new overmain.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T04:27:01Z.
Review: COMMENTED
Static audit of
e895cca95against mainb6bf3aa0b. No builds, tests, or GPU runs were performed.Merge blocker. Main added
fixed_base_probeatruntime/CMakeLists.txt:1484with/FIXED /DYNAMICBASE:NOand/NODEFAULTLIB. The four edits leave that call without/INCREMENTAL:NO, so the new source check attests/test_runtime_incremental_link.py:36will fail with['fixed_base_probe']when the standard-library CI sweep runs on the merged tree. Please add/INCREMENTAL:NOto the existingfixed_base_probelink options.The four edited calls in
runtime/CMakeLists.txtadd the switch unconditionally, overriding the MSVC Debug and RelWithDebInfo incremental defaults and matching the Release default. The existing Windows runtime guard covers the clang-cl/lld-link Windows cross-build and excludes native Linux, native macOS, and the documented MinGW tools-only build.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T11:36:37Z.
TAKEN by OreoFR (Windows, RTX 4070 8 GB)
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T12:37:57Z.
Verified by OreoFR — READY
8fb974878+ this PR (head867eb160b) merged with --no-ff (still no conflict with maincc0f662a7)runtime/CMakeLists.txt, viaLEONIDA_RUNTIME_CMAKE):python -I tests/test_runtime_incremental_link.pyfails, 5 targets without/INCREMENTAL:NO(dll_thread_calls, fixed_base_probe, gameinput_host, tiny_game_fixed, tiny_tls_cb_only).LEONIDA_CARGO=OFF,LEONIDA_XMA2_DECODER_LIBempty); imports unchanged vs main (25 DLLs, no WS2_32)e895cca95. The new head adds fixed_base_probe, which those runs did not cover.AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.
Ready to merge per the maintainers' plan (green, no conflict, tested).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:27:05Z.
Merged. Tested by OreoFR (RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11) on this head: the PR's test red against main's runtime/CMakeLists.txt, green with the PR (READY). AI-assisted: yes.