Repository navigation
build(cross): resolve the cross toolchain through soldr cc --print-* (#3059) - #3091
Merged
Merged
Conversation
RED: cmake/common/soldr.cmake still finds the cross compiler and SDK by
walking soldr's install layout (bin/llvm-*/hardlinked/bin/clang,
bin/apple-sdk/*/darwin-<arch>/package/sdk, sdk/.../xwin/*), because soldr had
no `cc --target ... --print-*` when it was written.
uv run python -m unittest ci/test_soldr_cross_toolchain.py
Ran 3 tests - FAILED (failures=12)
AssertionError: '--print-cc' not found in 'function(obs_soldr_cross_toolchain ...'
AssertionError: '/hardlinked/' unexpectedly found in ...
Refs #3059
#3059) GREEN: obs_soldr_cross_toolchain() no longer walks soldr's install layout (bin/llvm-*/hardlinked/bin/clang, bin/apple-sdk/*/darwin-<arch>/package/sdk, sdk/x86_64-pc-windows-msvc/xwin/*). It asks soldr for each tool with `soldr cc --target <triple> --print-cc/--print-cxx/--print-linker/ --print-sysroot/--print-ar/--print-rc`, the interface soldr#2335 shipped, and writes those paths into the generated toolchain file. - The clang target, the hand-written MSVC -idirafter SDK include list and the "link a small crate to provision LLVM" workaround all go: soldr's cc driver is already targeted and carries the target's sysroot, include and link flags. - `--print-rc` covers the Windows resource compiler (llvm-rc); the placeholder ${CMAKE_COMMAND} CMAKE_RC_COMPILER is gone. - `--print-ar` is llvm-lib on the MSVC targets, which speaks lib.exe syntax while CMake drives this driver in GNU-like mode (`ar qc`); the archiver is llvm-ar from the same LLVM soldr printed, and llvm-lib stays documented as the tool the later link step needs. Local: `uv run python -m unittest ci/test_soldr_cross_toolchain.py` -> OK. Cross check, real tree, configured and built on this host with the new toolchain (no native runner): | alias | cmake configure | build | | --- | --- | --- | | win-x64 | 102 s | 200 objects, clean | | mac-arm64 | 20 s | 171 objects, clean | | mac-x64 | 20 s | 241 targets, clean | Tier 2/3/4 do not apply: cmake/common/soldr.cmake and cmake/cross/ are build tooling, and no C test or public header changes.
zackees
marked this pull request as ready for review
October 30, 2026 18:26
Member
Author
|
Handed off to the coordinator.
|
This was referenced Oct 31, 2026
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.
What
The cross check (
cmake/cross, #1075) compiled for win-x64/mac-arm64/mac-x64 with atoolchain that
cmake/common/soldr.cmakeassembled by walking soldr's install layout —bin/llvm-*/hardlinked/bin/clang,bin/apple-sdk/*/darwin-<arch>/package/sdk,sdk/x86_64-pc-windows-msvc/xwin/*/xwin— because soldr had no C-compiler interface for thesetriples when it was written (the
# TODO(soldr cc --target)comment).soldr 0.9.45 has that interface (#3042), so this switches to it:
obs_soldr_cross_toolchain()askssoldr cc --target <triple> --print-cc/--print-cxx/ --print-linker/--print-sysroot/--print-ar/--print-rcfor every tool and writes those pathsinto the generated toolchain file. soldr provisions the target's LLVM, linker and SDK on first
use, so the "run
rustup target addand link a crate to make soldr fetch them" workaround goes.-idirafterSDK include list go too:soldr's cc driver is already targeted and carries the target's sysroot, include and link flags
(it compiles
<windows.h>,<TargetConditionals.h>and the Qt private headers unchanged).--print-rcgives the real resource compiler (llvm-rc) instead of the${CMAKE_COMMAND}placeholder CMake's Windows-Clang platform needed.
--print-arisllvm-libon the MSVC targets, which speaks lib.exe syntax (/out:), whileCMake drives this driver in its GNU-like mode (the executable is named
*-clang, notclang-cl), whose archive rule isar qc. The archiver isllvm-arfrom the same LLVM soldrprinted;
llvm-libis left documented for the link step this issue adds next.ci/test_soldr_cross_toolchain.pypins the class: the tool names come from those printers, andnone of the layout strings (
/hardlinked/,apple-sdk/,xwin/,soldr status,rustup target add,_obs_soldr_locate) may come back.RED
51033cccd—ci/test_soldr_cross_toolchain.pyonorigin/master:(Replayed against
origin/master'scmake/common/soldr.cmakewith the committed test file.)GREEN
34be03a55:Real cross check, configured and fully built on this host (no native runner) with the generated
toolchain, after the change:
win-x64ninja: no work to doon re-runmac-arm64mac-x64Tiers: Tier 1 is the Python pin. Tiers 2/3/4 do not apply — this is build tooling
(
cmake/common/soldr.cmake,cmake/cross/), no C test, public header or product code changes.No user-visible change, so no
docs/features.mdline; no Rust tests, so no Test cost line.Left for this issue
The opt-in
OBS_CROSS_LINKthat links a shared libobs per alias (and the cold-build numbersnext to the native ones) is the next PR; this one only replaces the unsupported toolchain
discovery with the supported interface.
Refs #3059.