Skip to content

Tooling/clang-cl cross build - #80

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

Tooling/clang-cl cross build#80
Belonit wants to merge 8 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 with the MSVC
ABI, headers, and libraries. The branch also makes the C++ sources and legacy
assembly accepted by clang-cl, aligns bgfx render-record allocations, and adds a
VS Code IntelliSense example.

Behavior and compatibility

  • Supported Visual Studio 2022 Win32 Debug and Release behavior is preserved.
  • The clang-cl configuration is unsupported and does not expand the build matrix.
  • Therenderer translation unit now defines BX_CONFIG_DEBUG to match the bgfx libraries and allocates bgfx records alignment-correctly, keeping MSVC and clang-cl builds consistent.

The codebase may still contain undefined behavior the supported MSVC build does not expose, so a successful clang-cl build is not runtime evidence.
Validate any clang-cl result separately.

Known clang-cl runtime observations:

Validation

  • clang-cl 22.1.8, MSVC 14.44.35207, Windows SDK 10.0.26100.0: configured and
    built (Release, Ninja) with inherited warnings and no errors; LogStress passed, including 100,000 intact log lines.
  • Supported MSVC Win32 Release: build completed under Wine with cl 14.44.35207 (Ninja), including the test executables. The Visual Studio Debug configuration and CI were not exercised.

Documentation

docs/BUILDING.md documents the experimental toolchain requirements,
configuration, and the runtime limitation.

Checklist

  • The change is focused; unrelated mechanical cleanup is separate
  • Compatibility effects and any migration are explicit
  • Documentation impact is stated
  • 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
@Belonit
Belonit force-pushed the tooling/clang-cl-cross-build branch 2 times, most recently from f91b0ba to b3554b6 Compare August 30, 2026 22:48
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 47a9078 to d910706 Compare August 30, 2026 23:12
@github-actions

Copy link
Copy Markdown

Development builds of d910706:

The links work without a GitHub account. Artifacts expire after 90 days, and this comment follows the latest successful build.

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