Skip to content

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

Merged
aslan2142 merged 1 commit into
ProjectLeonida:mainfrom
UwUCammie:pr/xma2-synchronization-lib
Nov 24, 2026
Merged

aslan2142 merged 1 commit into
ProjectLeonida:mainfrom
UwUCammie:pr/xma2-synchronization-lib

Conversation

@UwUCammie

Copy link
Copy Markdown
Contributor

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

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)

…CH-LIB)

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.

@abnalstlll-byte abnalstlll-byte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

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 f3e26be (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

Copy link
Copy Markdown
Contributor

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

@aslan2142
aslan2142 merged commit fce586c into ProjectLeonida:main Nov 24, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants