[PR #973] runtime: compile the shim registry once for compatible Windows targets #1010

Open
opened 2026-11-26 20:19:47 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/973
Author: @Kadamitas
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: build/reuse-registry-object


📝 Commits (1)

  • 24ab90c runtime: compile the shim registry once for compatible Windows targets

📊 Changes

1 file changed (+47 additions, -39 deletions)

View changed files

📝 runtime/CMakeLists.txt (+47 -39)

📄 Description

Claimed in the coordination issue as: compile the shim registry once for compatible Windows targets (unlisted build work).

What and why

The Windows runtime and 40 possible test/tool targets each listed the same shims/registry.cpp. This change compiles the common implementation in a CMake object library. Each executable links its own copy, so process-local state and static shim registrations keep their original ownership.

39 of the 41 source lists can share this object. The XMem test keeps a private compilation because clang-cl enables asynchronous exception handling there. The loader fuzzer keeps a private compilation for its AddressSanitizer and STL annotation settings. The number of targets enabled depends on the installed libraries and generator options.

Tested

  • Windows x64, Visual Studio 2022 MSVC 19.36, SDK 10.0.26100, RelWithDebInfo. In the generated CPU-only build, 36 executables referenced one shared object. The registry source compiled separately for the object library, XMem test and fuzzer.
  • Built and ran five cases with the static CRT: startup_trace, xmem, process_cmdline, bcrypt_rng, and bcrypt_rng_seeded. All five passed.
  • Generated a second configuration with the default dynamic CRT and LEONIDA_LOADER_FUZZ_ASAN=ON. Built the shared registry object and compiled the fuzzer's private registry source with /fsanitize=address and both STL annotation disables. The complete dynamic-CRT test build on this older toolset stops in main's separate crt_timed_wait.cpp; those full binaries were not tested in that configuration. clang-cl was not run.
  • git diff --check and the repository's no-game-data checker passed.

GPUs tested: N/A, CPU-only build change. No frame-rate claim.

AI-assisted: yes, OpenAI Codex.

Checklist

  • Based on current main.
  • One build-system change.
  • No game files, keys, or decryption content.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/973 **Author:** [@Kadamitas](https://github.com/Kadamitas) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `build/reuse-registry-object` --- ### 📝 Commits (1) - [`24ab90c`](https://github.com/ubiquitarianism/leonida/commit/24ab90c6b070317e46046b1596f559c09f11798b) runtime: compile the shim registry once for compatible Windows targets ### 📊 Changes **1 file changed** (+47 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+47 -39) </details> ### 📄 Description Claimed in the coordination issue as: [compile the shim registry once for compatible Windows targets](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7137069951) (unlisted build work). ### What and why The Windows runtime and 40 possible test/tool targets each listed the same `shims/registry.cpp`. This change compiles the common implementation in a CMake object library. Each executable links its own copy, so process-local state and static shim registrations keep their original ownership. 39 of the 41 source lists can share this object. The XMem test keeps a private compilation because clang-cl enables asynchronous exception handling there. The loader fuzzer keeps a private compilation for its AddressSanitizer and STL annotation settings. The number of targets enabled depends on the installed libraries and generator options. ### Tested - Windows x64, Visual Studio 2022 MSVC 19.36, SDK 10.0.26100, RelWithDebInfo. In the generated CPU-only build, 36 executables referenced one shared object. The registry source compiled separately for the object library, XMem test and fuzzer. - Built and ran five cases with the static CRT: `startup_trace`, `xmem`, `process_cmdline`, `bcrypt_rng`, and `bcrypt_rng_seeded`. All five passed. - Generated a second configuration with the default dynamic CRT and `LEONIDA_LOADER_FUZZ_ASAN=ON`. Built the shared registry object and compiled the fuzzer's private registry source with `/fsanitize=address` and both STL annotation disables. The complete dynamic-CRT test build on this older toolset stops in main's separate `crt_timed_wait.cpp`; those full binaries were not tested in that configuration. clang-cl was not run. - `git diff --check` and the repository's no-game-data checker passed. GPUs tested: N/A, CPU-only build change. No frame-rate claim. AI-assisted: yes, OpenAI Codex. ### Checklist - [x] Based on current main. - [x] One build-system change. - [x] No game files, keys, or decryption content. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1010
No description provided.