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

Merged
leonida/mandy
UwUCammie merged 1 commit from pr/xma2-synchronization-lib into main 2026-11-24 16:58:15 +00:00

Pull request successfully merged and closed

UwUCammie commented 2026-11-24 14:54:17 +00:00

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)
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 approved these changes 2026-11-24 14:56:19 +00:00
abnalstlll-byte left a comment

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.

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

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

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

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

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 description provided.