Cross builds with clang 18 work again: mimalloc's C++ gets past the MSVC headers' Clang 19 check (STL1000) #4353
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4353
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4352"
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?
@kMagic142 on GitHub · 2026-11-30 19:14 UTC · original
kMagic142:pr-clang-mimalloc→main· +967 −847 · 33 files · 14 commits · closed without mergingWhat it changes
Since #1487,
victory-gpudepends on mimalloc. On MSVC targetslibmimalloc-sys(0.1.49) compiles mimalloc's sources as C++, so they include the C++ headers of Microsoft's STL, and those stop any Clang older than 19:A cross build with cargo-xwin (
docs/linux-proton.md) compiles them with the system'sclang-cl, and on Ubuntu 24.04 that is clang 18.1.3. Socargo xwin build,check,clippyandtestof main stop in libmimalloc-sys's build script there. Windows builds with Visual Studio, as in CI, are not affected..cargo/config.tomlnow sets this, with a comment saying why:Cargo passes
[env]to build scripts, and the compiler cc runs from them inherits it:CLholds options that cl.exe and clang-cl put in front of their own command line. The macro turns off only the compiler-version checks inyvals_core.h(STL1000 for Clang, STL1001 for cl.exe, STL1002 for CUDA); nothing else in the headers reads it. mimalloc then compiles with clang 18._CL_would not do: its options go after the command's own, and cc ends a clang-cl command with-- <source file>, so they would be read as file names.CLtoo, and there the define changes nothing: cl.exe passes its own headers' check already.CLalready set in the environment is kept; cargo's[env]does not replace a variable that is set.blake3's, which compiles its SSE/AVX assembly and checks the/arch:AVX512flag. No C++ header is involved there, and the extra/Dchanges nothing. The workspace's own build scripts compile nothing (victory-gpuandvictory-shaderfingerprint their sources;apps/victoryandtests/fixtures/hle-probepass linker arguments).Cargo.lockdoes not change, so neither does the translator's fingerprint. cc has a build script rerun whenCLchanges, so the first build after this runs libmimalloc-sys's again, once.The
[env]table goes above[alias], so that it merges without conflict with the open PRs that add a table below[alias](see below).How it was tested
e1251c31.cargo xwin check --locked -p victory --target x86_64-pc-windows-msvcfails (exit 101) withfailed to run custom build command for libmimalloc-sys v0.1.49:cargo clean -p libmimalloc-sys --target x86_64-pc-windows-msvc. The same command passes (exit 0). libmimalloc-sys's build script ran withCLset to the define, and mimalloc's object was compiled by clang 18.1.3.CLset.cargo testpassed for the crates it touches: it touches no crate's code; the check above runs every build scriptvictoryneeds.Checked for overlap
.cargo/config.toml). None of them fixes this. Related:rustflagstable (target-cpu=x86-64-v3) below[alias]in.cargo/config.toml. This PR merges with either without conflict (checked withgit merge-file).linux-crossCI job that runscargo xwin clippyandcargo xwin buildwith theclangUbuntu installs onubuntu-latest(24.04, clang 18). That is the setup above, so on today's main that job would stop at STL1000 too; with this PR it would not.CL, so nothing changes for it.@trustno1-coder on GitHub · 2026-12-01 18:42 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed