Tooling/clang-cl cross build - #80
Open
Belonit wants to merge 9 commits into
Open
Conversation
Keep labels inside their inline assembly blocks and make byte-sized memory operands explicit where clang-cl requires their size.
Configure a Linux-hosted Ninja build with clang-cl, LLD, and the installed MSVC headers and libraries. Apply the compatibility settings required by bx.
Use aligned CRT allocation for bgfx render records so clang-cl-generated aligned SSE accesses cannot receive under-aligned storage.
Assemble the legacy MASM sources with native UASM instead of invoking ml.exe through Wine.
The build pipeline no longer invokes Wine after native UASM and LLVM RC replaced the remaining wrapper tools.
Belonit
force-pushed
the
tooling/clang-cl-cross-build
branch
from
August 30, 2026 12:15
7059183 to
f91b0ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an experimental Linux-hosted Win32 cross-build using clang-cl, LLVM tools,
LLD, and UASM with the MSVC ABI, headers, and libraries. The work also makes
the source and legacy assembly accepted by clang-cl, and adds a VS Code
IntelliSense example for the configuration.
Behavior and compatibility
Behavior preserved for supported Visual Studio 2022 Win32 Debug and Release
builds. The clang-cl configuration is explicitly unsupported and intended for
compiler-portability work; it does not expand the supported build matrix.
The cross-build does not change game data formats, saves, replays, networking,
deterministic simulation, COM interfaces, or externally consumed ABI. The
existing codebase may contain undefined behavior that is not exposed by the
supported MSVC build, so a successful clang-cl build is not runtime evidence.
Known clang-cl runtime observations:
undefined behavior causes the game to crash.
undefined behavior produces rendering artifacts on voxels.
Validation
Configured and built with clang-cl 22.1.8, MSVC 14.44.35207, and Windows SDK
10.0.26100.0. The build completed with inherited warnings and no errors.
All logger checks passed, including 100,000 intact log lines.
Supported Visual Studio 2022 Win32 Debug and Release builds were not run before
submitting this PR; CI remains the required validation for the supported matrix.
Documentation
Updated
docs/BUILDING.mdwith the experimental toolchain requirements,configuration command, and the runtime limitation caused by potentially
unexposed undefined behavior.
Checklist