Skip to content

Tooling/clang-cl cross build - #80

Open
Belonit wants to merge 9 commits into
OpenTS-Developers:mainfrom
Belonit:tooling/clang-cl-cross-build
Open

Tooling/clang-cl cross build#80
Belonit wants to merge 9 commits into
OpenTS-Developers:mainfrom
Belonit:tooling/clang-cl-cross-build

Conversation

@Belonit

@Belonit Belonit commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

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:

Validation

cmake -S . -B build/clang-cl -G Ninja \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/clang-cl-msvc.cmake \
  -DOPENTS_MSVC_ROOT=<msvc-root>
cmake --build build/clang-cl

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.

wine build/clang-cl/bin/LogStress.exe

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.md with the experimental toolchain requirements,
configuration command, and the runtime limitation caused by potentially
unexposed undefined behavior.

Checklist

  • The change is focused; unrelated mechanical cleanup is separate
  • Compatibility effects and any migration are explicit
  • Validation distinguishes what passed, failed, and was not run
  • No prohibited assets, binaries, SDKs, credentials, or generated output are included

@Belonit Belonit changed the title Tooling/clang cl cross build Tooling/clang-cl cross build Aug 30, 2026
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
Belonit force-pushed the tooling/clang-cl-cross-build branch from 7059183 to f91b0ba Compare August 30, 2026 12:15
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.

1 participant