build: the clang-cl cross-compile fails on gfx1013_vertex_id.cpp after the /W4 /WX ratchet #3855
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#3855
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@triggered02 on GitHub · 2026-12-02 13:21 UTC · original
Summary.
mainno longer builds with the clang-cl cross-compile documented indocs/non-windows-hosts.md.x2w_shader_compilerfails with 7 errors insrc/gfx1013_vertex_id.cpp.Cause.
d654ad80("build: raise MSVC warnings for the shader compiler", 2026-12-01) added a warning ratchet insideif(MSVC):CMake sets
MSVCto true for clang-cl as well, because clang-cl presents the MSVC command line. So clang-cl also receives/W4and/WX, and clang warns where MSVC does not.Observed. Linux host, clang-cl 19.1.1 + xwin SDK splat, Release, the toolchain file from
docs/non-windows-hosts.md's clang-cl section:The compile line carries
/W4 /WXfor that target, confirming it is the ratchet and not a local flag: the rest of the tree compiles, andd3d12_xs_shimonly fails because it depends onx2w_shader_compiler.Why it matters.
docs/non-windows-hosts.mdpublishes the clang-cl + xwin route as a supported way to build the eight stand-ins on Linux, and that route now stops at configure-independent build time. It is not a WARP/GPU capability issue: nothing here needs a device.Possible fixes, whichever you prefer:
if(MSVC AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang"); orgfx1013_vertex_id.cpp(7 sites, all{...}aggregate initialisations that leavevaluedefault-initialised); or-Wno-missing-field-initializersfor clang only, which keeps the /W4 ratchet's other warnings.I hit this while rebasing an unrelated GPU PR onto
5770f14e; I have made no change for it yet. Environment: Debian, clang-cl 19.1.1, xwin SDK 10.0.26100, no Windows and no GPU involvement.@triggered02 on GitHub · 2026-12-02 13:21 UTC · original
Claiming this since I hit it and it blocks my other work.
Slice: the
if(MSVC)guard around the/W4 /permissive-+/WXratchet inCMakeLists.txt. CMake setsMSVCfor clang-cl too, so the ratchet reaches a compiler it was not written for. I will make the ratchet apply to real MSVC and leave clang-cl out of it, which matches the commit's own wording ("raise MSVC warnings for the shader compiler").Environment: Debian, clang-cl 19.1.1, xwin SDK 10.0.26100, Release — the clang-cl route documented in
docs/non-windows-hosts.md. No Windows, no GPU, no D3D12 device needed to reproduce.Verification I can offer: before/after
cmake --build out/build/clang --target d3d12_xs_shimon this host — fails with the 7-Wmissing-field-initializerserrors before, builds after. I cannot produce MSVC evidence, so the MSVC side of the ratchet will be unchanged-by-inspection only.Overlap: none — the issue is seconds old and unassigned.
If you would rather keep
/W4 /WXfor clang-cl and silence just this warning class (-Wno-missing-field-initializersfor clang only), say so and I will switch the approach; that keeps clang coverage at the cost of one suppression.