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

Manually merged
github merged 1 commit from gh-pr/877/head into gh-pr/877/base 2026-11-26 09:25:56 +00:00
Owner

@⁠UwUCammie on GitHub · 2026-11-24 14:54 UTC · original
UwUCammie:pr/xma2-synchronization-lib → main · +3 −1 · 1 files · 1 commits · merged 2026-11-24 16:58 UTC

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)
**@⁠UwUCammie** on GitHub · 2026-11-24 14:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/877) `UwUCammie:pr/xma2-synchronization-lib` → `main` · +3 −1 · 1 files · 1 commits · merged 2026-11-24 16:58 UTC 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)
Rust's std imports WaitOnAddress, WakeByAddressSingle and WakeByAddressAll from
synchronization.lib. A clang-cl build against an xwin SDK does not pull that
library in on its own, so gta6rt and acphal_test failed to link with
lld-link: undefined symbol __declspec(dllimport) WaitOnAddress once cargo built
runtime/xma_decoder. Name it next to the decoder's other link dependencies.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:25:54 +00:00
github manually merged commit efe544dac0 into gh-pr/877/base 2026-11-26 09:25:56 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 14:56 UTC · original · approved these changes

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.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 14:56 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/877#pullrequestreview-6041603499) · **approved these changes** 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.
Author
Owner

@⁠MoonEyes on GitHub · 2026-11-24 14:58 UTC · original

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).

**@⁠MoonEyes** on GitHub · 2026-11-24 14:58 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/877#issuecomment-7135249707) 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).
Author
Owner

@⁠SweatierKey on GitHub · 2026-11-24 15:18 UTC · original

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

**@⁠SweatierKey** on GitHub · 2026-11-24 15:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/877#issuecomment-7135816035) 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
This discussion has been locked. Commenting is limited to contributors.
No description provided.