Repository navigation
docs: cross-compiling with clang-cl and xwin, and the startup debugger under Wine - #1301
Conversation
…r under Wine Add two sections to the non-Windows host guide: a clang-cl, lld-link and xwin toolchain file that builds the startup stand-ins on Linux, with the four differences from an MSVC build (/EHa for the __try memory probes, bracket depth, the OneCore.lib spelling, DXC), and what a startup run under Wine with vkd3d-proton needed.
tedin7
left a comment
There was a problem hiding this comment.
Review at commit 932423c7f2d5489c1de75a5817bc1d8c4f5d1218:
Verification
- Linux:
git diff --check origin/main...HEAD: clean (exit 0)/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: passed (16 Markdown files, 290 links)/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: passed (1086 tracked files)
- Windows Server 2025: N/A (docs-only change in
docs/non-windows-hosts.md; no C++/test target changes).
Review Notes
- Clearly documents the
clang-cl+xwincross-compile toolchain (/EHaordering after/EHsc,-fbracket-depth=2048,OneCore.libcase-sensitivity symlink, anddxcrequirement) and explicitly scopes it as a compile check with MSVC/Windows CI remaining the reference. - Documents the Wine +
vkd3d-protonstartup debugger setup and known differences (python312._pth,d3d12/dxgioverrides,XDG_RUNTIME_DIRtmpfs note, descriptor handle tag bits, and section-per-page cost) while keeping title-neutral framing and explicitly noting it is not Windows verification.
|
One small edge case in the cross-build example at I checked the resulting flag fragments with a POSIX shell on cloud Linux and synthetic paths: AI-assisted. |
Review: an SDK or checkout directory with spaces split the /imsvc and /libpath arguments. The paths are now quoted inside the flag strings.
|
@nanyoudegege you're right, thanks. Fixed in Checked with the actual cross-build rather than the shell split: I configured and built Not checked: a checkout (source directory) path with spaces, and a path containing a double quote, which the quoting would not survive. |
tedin7
left a comment
There was a problem hiding this comment.
Re-reviewed at commit 3185186ec1f82737af56f1f5e457116be9c12e30 (delta since 932423c7f2d5489c1de75a5817bc1d8c4f5d1218).
Delta Review (docs/non-windows-hosts.md)
429fb8f7+3185186e: quotesXWINandLIBCASEpaths inside theclang-cl/imsvcand/libpath:flag strings and explicitly documents which directories with spaces were tested (XWIN,LIBCASE, build directory) versus not tried (source directory). Looks clean and accurate.
Verification (Linux, docs-only)
git diff --check origin/main...HEAD: cleanpython -B tests/docs_links_check.py: passed (16 Markdown files, 291 links)python -B tests/bidi_controls_check.py: passed (1093 files)
Refs #870.
What this adds
Two sections in
docs/non-windows-hosts.md, next to the existing msvc-wine one. Docs only.Cross-compile with clang-cl and an xwin SDK. A toolchain file and the commands that build the eight startup stand-ins on Linux with clang-cl, lld-link and an
xwin splat, plus the four things that differ from an MSVC build:/EHais required and must come after CMake's default/EHsc. The stand-ins probe title memory inside__try(src/startup_stubs/local_log.h). With/EHsc, clang-cl does not catch the access violation of a load written directly in the__trybody, and the first probe of an unreadable address ends the process insided3d12_xs.dll. This one cost the most time to find.-fbracket-depth, for the 512-argument fold expression ind3d12_xs_device.cpp.OneCore.libversus the splat'sonecore.libon a case-sensitive file system.dxcto satisfyfind_program.It is presented the way the msvc-wine section is: a real compiler and the real SDK, usable as a compile check, with MSVC and Windows CI as the reference. It does not stub
cl, MASM, D3D12 or WARP.Startup debugger under Wine. What a
debug_launch.pyrun on those stand-ins needed under Wine with vkd3d-proton: the Windows build of CPython (and why the embeddable package needs its._pthfile removed), which D3D12 DLLs go into the prefix, mapping a package drive letter, FXC under Wine, where a desktopxgameruntime.dllcomes from, Wine's section backing on a small tmpfs, and two open differences (tagged descriptor handles, window order). It also records how slow one section per 64 KiB page is under Wine.Evidence
Commit: the head of this branch, on
mainat93cb6a2a./EHaas the only exception flag on the compile lines. Host: Debian 13, clang-cl 19.1.7, SDK 10.0.26100 fromxwin splat./EHastatement is measured both ways on that host: built with/EHsc, a startup run stopped at an unhandled access violation in the stand-in's readable-memory probe; rebuilt with/EHalast, the same run continued.python -B tests/docs_links_check.py: pass (290 links).python -B tests/bidi_controls_check.py: pass.git diff --check: clean.Not covered
Related
The page-mapping cost mentioned at the end is the subject of a separate code PR I am preparing. #1251 (mapping a package drive letter in the launcher) would replace the manual
dosdevicesstep for hosts where it applies.