build: link synchronization for the Rust XMA2 decoder (BUILD-XMA2-SYNCH-LIB) #877

Merged
UwUCammie merged 1 commit from upstream-pr/877 into main 2026-11-24 16:58:15 +00:00
UwUCammie commented 2026-11-24 14:54:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by UwUCammie on 2026-11-24T14:54:17Z.


Claimed in the coordination issue as: BUILD-XMA2-SYNCH-LIB

What and why

runtime/xma_decoder (#404) is linked into gta6rt and acphal_test with kernel32;ntdll;userenv;ws2_32;dbghelp. Rust's std also imports WaitOnAddress, WakeByAddressSingle and WakeByAddressAll, which live in synchronization.lib. MSVC's default libraries cover that, but a clang-cl build against an xwin SDK does not, so once cargo builds the decoder the link fails:

lld-link: error: undefined symbol: __declspec(dllimport) WakeByAddressSingle
lld-link: error: undefined symbol: __declspec(dllimport) WakeByAddressAll
lld-link: error: undefined symbol: __declspec(dllimport) WaitOnAddress

This names synchronization next to the decoder's other link dependencies, with a comment saying why.

Tested

  • Linux cross build with clang-cl and an xwin SDK (cmake --build <build> --target gta6rt acphal_test): the link fails as above without the change and succeeds with it.
  • acphal_test.exe under Wine 11.22 with the decoder linked: 170 checks, 0 failures.
  • Run on a branch that carries the same runtime/CMakeLists.txt change on top of #404; this branch is only that one-line change on main.

GPUs tested: n/a (build change only; the machine is an AMD Radeon RX 7900 XT, RADV, Mesa 26.3.1, CachyOS, Wine 11.22)

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: no translator change)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5474544645 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/877). Originally posted by [UwUCammie](https://github.com/UwUCammie) on 2026-11-24T14:54:17Z. --- Claimed in the coordination issue as: BUILD-XMA2-SYNCH-LIB ### What and why `runtime/xma_decoder` (#404) is linked into `gta6rt` and `acphal_test` with `kernel32;ntdll;userenv;ws2_32;dbghelp`. Rust's std also imports `WaitOnAddress`, `WakeByAddressSingle` and `WakeByAddressAll`, which live in `synchronization.lib`. MSVC's default libraries cover that, but a clang-cl build against an xwin SDK does not, so once cargo builds the decoder the link fails: ``` lld-link: error: undefined symbol: __declspec(dllimport) WakeByAddressSingle lld-link: error: undefined symbol: __declspec(dllimport) WakeByAddressAll lld-link: error: undefined symbol: __declspec(dllimport) WaitOnAddress ``` This names `synchronization` next to the decoder's other link dependencies, with a comment saying why. ### Tested - Linux cross build with clang-cl and an xwin SDK (`cmake --build <build> --target gta6rt acphal_test`): the link fails as above without the change and succeeds with it. - `acphal_test.exe` under Wine 11.22 with the decoder linked: `170 checks, 0 failures`. - Run on a branch that carries the same `runtime/CMakeLists.txt` change on top of #404; this branch is only that one-line change on `main`. GPUs tested: n/a (build change only; the machine is an AMD Radeon RX 7900 XT, RADV, Mesa 26.3.1, CachyOS, Wine 11.22) 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. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change)
abnalstlll-byte commented 2026-11-24 14:56:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:56:19Z.

Review: APPROVED


Audited and verified. Adds synchronization to INTERFACE_LINK_LIBRARIES for leonida_xma2_decoder in
untime/CMakeLists.txt, resolving missing WaitOnAddress/WakeByAddress* symbols under clang-cl with xwin SDK. Approved.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6041603499 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/877#pullrequestreview-6041603499). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T14:56:19Z. **Review:** APPROVED --- Audited and verified. Adds synchronization to INTERFACE_LINK_LIBRARIES for leonida_xma2_decoder in untime/CMakeLists.txt, resolving missing WaitOnAddress/WakeByAddress* symbols under clang-cl with xwin SDK. Approved.
MoonEyes commented 2026-11-24 14:58:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-24T14:58:24Z.


This fixes more than the clang-cl/xwin case, and the new comment is not accurate for MSVC: MSVC on GitHub's runner fails the same way.

Evidence: a workflow_dispatch of the Runtime workflow on main f3e26be7c (my fork, run 45416796648, windows-latest, Visual Studio 18 Enterprise, MSVC 14.52.37025, link.exe):

leonida_xma2_decoder.lib(std-...rcgu.o) : error LNK2019: unresolved external symbol __imp_WakeByAddressSingle ...
leonida_xma2_decoder.lib(std-...rcgu.o) : error LNK2019: unresolved external symbol __imp_WakeByAddressAll ...
leonida_xma2_decoder.lib(std-...rcgu.o) : error LNK2019: unresolved external symbol __imp_WaitOnAddress ...
gta6rt.exe : fatal error LNK1120: 3 unresolved externals

So the windows job of the Runtime workflow is red on main for this reason, and no runtime-windows artifact is produced (the "Without a compiler" path in docs/testing.md has nothing to download). That makes this PR a main-blocker rather than a cross-build nicety.

Suggest rewording the comment to something like "Rust's std imports WaitOnAddress and WakeByAddress*, which live in synchronization.lib; neither MSVC's link.exe (14.52 on windows-latest) nor lld-link with an xwin SDK adds it by default." The one-line change itself looks right to me.

(The linux-gpu-tools job in the same run fails only on the known cs_imgload_tfe / cs_imgload_d16_tfe pair, #31, unrelated.)

AI-assisted review (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7135249707 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/877#issuecomment-7135249707). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-24T14:58:24Z. --- This fixes more than the clang-cl/xwin case, and the new comment is not accurate for MSVC: MSVC on GitHub's runner fails the same way. Evidence: a `workflow_dispatch` of the Runtime workflow on `main` f3e26be7c (my fork, run 45416796648, `windows-latest`, Visual Studio 18 Enterprise, MSVC 14.52.37025, `link.exe`): ``` leonida_xma2_decoder.lib(std-...rcgu.o) : error LNK2019: unresolved external symbol __imp_WakeByAddressSingle ... leonida_xma2_decoder.lib(std-...rcgu.o) : error LNK2019: unresolved external symbol __imp_WakeByAddressAll ... leonida_xma2_decoder.lib(std-...rcgu.o) : error LNK2019: unresolved external symbol __imp_WaitOnAddress ... gta6rt.exe : fatal error LNK1120: 3 unresolved externals ``` So the `windows` job of the Runtime workflow is red on `main` for this reason, and no `runtime-windows` artifact is produced (the "Without a compiler" path in docs/testing.md has nothing to download). That makes this PR a main-blocker rather than a cross-build nicety. Suggest rewording the comment to something like "Rust's std imports WaitOnAddress and WakeByAddress*, which live in synchronization.lib; neither MSVC's link.exe (14.52 on windows-latest) nor lld-link with an xwin SDK adds it by default." The one-line change itself looks right to me. (The `linux-gpu-tools` job in the same run fails only on the known `cs_imgload_tfe` / `cs_imgload_d16_tfe` pair, #31, unrelated.) AI-assisted review (Claude Code).
SweatierKey commented 2026-11-24 15:18:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by SweatierKey on 2026-11-24T15:18:53Z.


Note: this also fixes a live Windows CI link failure on main (MSVC 14.52 in GitHub Actions windows job is currently failing to link gta6rt.exe with leonida_xma2_decoder.lib ... error LNK2019: unresolved external symbol __imp_WakeByAddressSingle / __imp_WakeByAddressAll, e.g. observed on PR #793's windows job). Linking synchronization unblocks both clang-cl/xwin and MSVC CI builds.

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7135816035 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/877#issuecomment-7135816035). Originally posted by [SweatierKey](https://github.com/SweatierKey) on 2026-11-24T15:18:53Z. --- Note: this also fixes a live Windows CI link failure on `main` (MSVC 14.52 in GitHub Actions `windows` job is currently failing to link `gta6rt.exe` with `leonida_xma2_decoder.lib ... error LNK2019: unresolved external symbol __imp_WakeByAddressSingle / __imp_WakeByAddressAll`, e.g. observed on PR #793's `windows` job). Linking `synchronization` unblocks both `clang-cl`/xwin and MSVC CI builds. AI-assisted: yes
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!877
No description provided.