mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:55:52 +01:00
[PR #319] runtime: link the fixtures with no base relocations with /INCREMENTAL:NO (BUILD-1550) #372
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#372
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/319
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/10053📝 Commits (1)
ed65e8cruntime: link the fixtures with no base relocations with /INCREMENTAL:NO (BUILD-1550)📊 Changes
2 files changed (+55 additions, -4 deletions)
View changed files
📝
runtime/CMakeLists.txt(+9 -4)➕
tests/test_runtime_incremental_link.py(+46 -0)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Claimed in the coordination issue as BUILD-1550: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7117121019 (the earlier PR for it,
#5073, was closed unmerged during the PR cleanup with no check of its head)What and why
With Visual Studio 2026 18.6 (link 14.51.36246), every clean
scripts\build_runtime.ps1build of main5d74c27stops withmanifest.res : fatal error LNK1000: Internal error during IncrCalcPtrs, an access violation in link.exe. It fails on tiny_game_fixed.exe, dll_thread_calls.dll and gameinput_host.dll: the same three in two fresh build folders.CMake links Debug and RelWithDebInfo with
/debug /INCREMENTALby default. Its Ninja and Makefile generators then relink every target incrementally, with only manifest.res changed, to embed the manifest. The 14.51 linker crashes on that relink when the image has no base relocations: /FIXED strips tiny_game_fixed's, and the two DLLs built without the CRT have nothing to relocate.A standalone repro shows the same split: images without relocation entries crash and images with them relink, while 14.44 relinks both. The Visual Studio generator also crashes on tiny_game_fixed once tiny_game.cpp changes. The crash is listed as fixed in VS 2026 18.7 (release notes, Developer Community 11090307). That fits the
#5073tester on cl 19.51.36260 who could not reproduce it, but 18.6 is still what a fresh Build Tools install can give.The four fixtures linked with /FIXED or /NODEFAULTLIB now link with
/INCREMENTAL:NO. tiny_tls_cb_only has relocations and did not crash, but it is the same kind of fixture. tiny_game_fixed keeps /FIXED, /DYNAMICBASE:NO, its 0x140000000 base and stripped relocations, and every other target links as before. The newtests/test_runtime_incremental_link.pyfails for such a fixture without/INCREMENTAL:NO.#5073covered only the two DLLs; tiny_game_fixed came later with RT-22.Tested
Windows 11, RTX 4070 SUPER; VS 2026 18.6 (MSVC 19.51.36246, CMake 4.2.3, Ninja 1.13.2) and VS 2022 17.14 (MSVC 19.44.35227); Windows SDK 10.0.26100; -DLEONIDA_SDL3_FETCH=ON.
5d74c27(VS 2026): 2 of 2 clean builds fail with LNK1000 on the same three fixtures, and a Debug build fails on tiny_game_fixed.5d74c27(VS 2026): 3 of 3 clean builds pass (one through build_runtime.ps1), ctest gives 113/113, and the Debug build and the VS-generator relink pass.5d74c27(VS 2022): the clean build passes and ctest gives 113/113.2d53a8055: pytest on test_runtime_incremental_link.py and test_build_runtime_cmake.py passes, and tiny_game_fixed.exe links with VS 2026. A full build of2d53a8055currently stops on compile errors in files this PR does not touch (runtime/shims/acphal.cpp static_asserts on SHAPE_XMA_CONTEXT/SHAPE_PCM_CONTEXT sizes, and d3d12_xs_device.cpp:1606rt::d3d12::create_console_descriptor_heap), so ctest was not run on that base.crt_timed_waitfails about 1 run in 20 with both toolsets (wait_for(200 ms) wakes at 199 ms). This change does not touch it.AI-assisted: yes (Claude Code)
Discord: bigpeppa.
Checklist
docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.