Repository navigation
Closed
Description
Follow-up to #697. The cross check (cmake/cross, #1075) compiles the whole C/C++ tree for win-x64, mac-arm64 and mac-x64 on Linux but links nothing, so link errors stay on the native runners. The reason it links nothing was soldr, not the platform: cmake/common/soldr.cmake located the cross compiler and SDK by hand "until soldr has soldr cc --target <triple> --print-cc / --print-sysroot" (soldr#2335). soldr 0.9.45 has that, and on this host a PE executable, a PE DLL, a Mach-O executable and a Mach-O dylib all link from Linux:
| Probe | x86_64-pc-windows-msvc |
aarch64-apple-darwin |
|---|---|---|
--print-linker |
clang driver → lld-link |
clang driver → ld64.lld |
--print-sysroot |
xwin MSVC CRT + Windows SDK (2026-06-22) | Apple SDK 14.5 |
--print-ar / --print-rc |
llvm-lib / llvm-rc |
llvm-ar |
| C executable | linked, 9.7 KB | linked, 50 KB |
| shared library | linked, 8 KB | linked, 17 KB |
What to build
- Switch
cmake/common/soldr.cmaketo the supported interface —soldr cc --target <triple> --print-cc/--print-cxx/--print-linker/--print-sysroot/--print-ar/--print-rcinstead of_obs_soldr_locate()'s layout guessing, with aci/test_*.pypinning that no layout path remains. The# TODO(soldr cc --target)comment goes with it. - Link in the cross check: add an opt-in
OBS_CROSS_LINKthat links a shared libobs (and the platform plugins that are shared libraries, e.g.obs-ffmpeg,win-capture,mac-virtualcam) for each alias, against the prebuilt.depsimport libraries the native build uses. - Measure a cold Linux build (no zccache, no unity cache) per alias, and compare with the native
Build OBS-Studio-Ruststeps: Windows x64 12m25, macOS arm64 8m01, macOS x86_64 7m50 (release run 41007587429).
Acceptance
cmake -S cmake/cross -DOBS_CROSS_TARGET=win-x64 -DOBS_CROSS_LINK=ONproduces alibobsDLL (andmac-arm64/mac-x64produce a dylib) with no native runner involved.- The alias list and its documented limits are unchanged: no
win-arm64(MSVC ARM64__ldar*/__stlr*intrinsics inlibobs/util/threading-windows.h, which clang does not provide). - A cold-build number per alias is recorded next to the native ones, so the per-job move issues (build: Investigate cross-compiling the full OBS C/C++ build for Windows and macOS from Linux #697's remaining work) can be sized from measurement.
Out of scope
- Signing and packaging:
package-macosneedscodesign/notarytool/hdiutil, and the packaged-startup smoke test needs a real Windows host. Those stay native. - Running the built app under Wine — decided against in ci: Run the windows-gnu Rust tests under Wine in the Linux lane #696.
Activity
zackees commentedon Oct 30, 2026
/ready
Triage: meets Ready. The prerequisite (soldr 0.9.45 with
soldr cc --target --print-*) merged in #3042. Acceptance is concrete: a libobs DLL/dylib per alias with no native runner, the alias list unchanged, and cold-build numbers recorded. The failing-test sketch is theci/test_*.pythat pins no layout-guessing path. Scope excludes signing and packaging. P2 (moves link errors off the native runners; sizes #697), size:L.zackees commentedon Oct 30, 2026
Claiming: #3059
ci/test_*.pypin that the cross toolchain comes fromsoldr cc --target <triple> --print-cc/--print-cxx/--print-linker/--print-sysroot/--print-ar/--print-rcand that no layout-guessing path (_obs_soldr_locate) remains incmake/common/soldr.cmake.obs_soldr_cross_toolchain()onto that interface; drop the stale# TODO(soldr cc --target)note.OBS_CROSS_LINKtocmake/crossand link a shared libobs per alias against the prebuilt.depsimport libraries; record a cold per-alias build number next to the native ones.First PR within a day. Refs #697.
zackees commentedon Oct 30, 2026
Progress: PR #3091 (queued) replaces the layout-guessing toolchain discovery with
soldr cc --target <triple> --print-*. Evidence in the PR: the real cross tree configured and built on this host for all three aliases (win-x64200 objects,mac-arm64171,mac-x64241 targets), andci/test_soldr_cross_toolchain.pypins the supported interface.Left on this issue: the opt-in
OBS_CROSS_LINK(shared libobs plus the shared platform plugins per alias, against the prebuilt.depsimport libraries) and the cold per-alias build numbers next to the native ones. That is the next PR, on top of #3091.build(cross): resolve the cross toolchain through soldr cc --print-* (o…
zackees commentedon Oct 31, 2026
Tick progress (
obs-studio5), branchinfra/3059-cross-link(WIP, not a PR yet): the second half — an opt-in link — is started and hits three concrete blockers that are findings in their own right.What is on the branch
OBS_CROSS_LINKincmake/cross/CMakeLists.txt(default OFF, so the lane is unchanged): when ON it builds a sharedlibobsfor the alias from the same object set the shipped Rust build links (LIBOBS_SOURCES+ the host's_SOURCES+LIBOBS_RUST_SOURCES), against the prebuilt.depsimport libraries and the alias's OS libraries.win-x64first.Default-OFF regression check: a fresh default configure+build of
build_cross_win-x64is green with the same 991 warnings as before the change.Three blockers found by trying to link
cmake/cross/CMakeLists.txtheader comment says so), andlibobs.ported-util+.h.candlibobs.rust-variadic+.h.cboth defineblogva,blog,dstr_printf, … Linking both gavelld-link: duplicate symbol: blogva. The link set has to be the Rust build's (LIBOBS_SOURCES+ host sources +LIBOBS_RUST_SOURCES); the ported C set stays compiled but not linked.deps/w32-pthreads/CMakeLists.txt:3isadd_library(w32-pthreads SHARED …), so compilingpthread.cinto libobs duplicates itsDllMain. As its own SHARED target it links cleanly:w32-pthreads.dll55 KB +w32-pthreads.lib30 KB from Linux.msvcrt.libbut notmsvcrtd.lib, whilecmake/crossdefaults toCMAKE_BUILD_TYPE=Debug, so the link died oncould not open 'msvcrtd.lib'. The option now forces Release when the type is empty/Debug (beforeproject()). The SDK's import libraries are also lower case on Linux (avrt.lib, notAvrt.lib), solibobs/cmake/os-windows.cmake's names have to be lower-cased in the cross link only.What is left
The
obs.dlllink now fails only on ≥20 undefined Rust shims (bfree,bmalloc,bmemdup,obs_data_array_*,obs_hotkey_*,calldata_set_data,signal_handler_signal,obs_service_get_weak_service, …;lld-linkhit its error limit). That is the expected shape: the ported halves are Rust in production (libobs/cmake/sources.cmake:10-13), so a reallibobsDLL needs thelibobs-ruststaticlib. A coldsoldr cargo build -p libobs-rust --release --target x86_64-pc-windows-msvcdid not finish within this tick's ~9.5 min (every workspace crate MISSed the cache); wiring that archive into the link target and measuring it is the next slice. The claim stays with me for it.Refs #697.
build(cross): link a shared libobs per alias with OBS_CROSS_LINK (Refs …
zackees commentedon Oct 31, 2026
Progress (
obs-studio5, PR #3123): the opt-in link half is now green for all three aliases.win-x64→obs.dll(PE32+ AMD64, 1,171,968 B, 1,795 exports, all 824 Rust shims named via/EXPORT)mac-arm64→obs.dylib(Mach-O arm64, 3,994,096 B, 5,951 exports)mac-x64→obs.dylib(Mach-O x86_64, 4,013,528 B, 5,989 exports)OBS_CROSS_LINK=OFF) configure+build is unchanged: green, 991 warnings.ci/test_soldr_cross_toolchain.pypins the lane as opt-in, the productionlibobs-ruststaticlib per alias, and the Windows export list.The link set is the shipped hybrid's, plus
libobs-rust,deps/libcaption, the generated version/core-module objects andOBS::obfuscateon Windows. The PR catalogs the RED failures it had to clear (duplicateblogva, undefined Rust shims, xwinMSVCRT.libcase,_mm_set_psdeclared-extern).Left on this issue: the cold-build number per alias (no zccache, no unity cache) next to the native step times, plus the size comparison for #697. Claim stays with me for that slice.
zackees commentedon Oct 31, 2026
Tick progress (
obs-studio5): the last acceptance item — the cold per-alias number — is measured and recorded in #3126 (docs-only, unmerged;docs/ci-tooling.mdgains oneCost, measuredbullet beside the cross-check section).How it was measured: fresh build tree per sample,
-DOBS_CROSS_LINK=ON(so the run builds that alias'slibobs-ruststaticlib and links the DLL/dylib),-j 4to match the 4-vCPU runner class, andZCCACHE_DISABLE=1. The bypass is confirmed rather than assumed: soldr logsno-cache preflight prepared …/targetand the zccache directory stayed at 4 KB across all six builds.win-x64obs.dll1,646,080 Bmac-arm64obs.dylib3,994,096 Bmac-x64obs.dylib4,013,528 BWhat the spread is, and what it is not. The compile set is stable (189–262
Building C/CXX objectedges per sample), so it is not a cache leaking through. The slower sample of each pair is the one whose cargo stage also rebuilt 14–18 workspace crates (4.9–10.1 s of cargo time); the rest tracks co-tenant load — four worker checkouts share this host, and a controlledwin-x64repeat with a fresh zccache directory on a busier box took 52.9 s. The number to plan with is therefore a 30–135 s range per alias, against the native steps in release run 41007587429 (Windows x64 12m25, macOS arm64 8m01, macOS x86_64 7m50): roughly 1/15 of the platform step, with signing and packaging staying native as the out-of-scope list says.State of #3059: all three acceptance items now have evidence — the toolchain comes from
soldr cc --target … --print-*withci/test_soldr_cross_toolchain.pypinning it (#3091),OBS_CROSS_LINK=ONproducesobs.dll/obs.dylibper alias with no native runner (#3123), and the cold cost is the table above (#3126). What is left is the merge of #3126 and then closing this issue; I keep the claim until it lands.Refs #697
zackees commentedon Oct 31, 2026
Closing: all three acceptance items are evidenced and merged.
soldr cc—soldr cc --target <triple> --print-*>resolves the driver,lld-link/ld64.lld, the MSVC CRT + Windows SDK and the Apple SDK;ci/test_soldr_cross_toolchain.pypins it as opt-in (build(cross): resolve the cross toolchain through soldr cc --print-* (#3059) #3091).OBS_CROSS_LINK=ONlinksobs.dll(PE32+ AMD64, 1,795 exports), andobs.dylibformac-arm64andmac-x64, from the same object set the shipped Rust build links; defaultOFFkeeps the lane unchanged (build(cross): link a shared libobs per alias with OBS_CROSS_LINK (#3059) #3123).ZCCACHE_DISABLE=1verified (soldr loggedno-cache preflight, zccache dir stayed 4 KB):win-x6431.5/40.8 s,mac-arm64117.0/31.8 s,mac-x64134.3/26.4 s; plan with a 30–135 s range per alias. Recorded indocs/ci-tooling.md(docs(ci): record the measured cold cross-build cost per alias (#3059) #3126, merged).Out of scope here and staying native: signing/notarization/
hdiutil, and thewin-arm64alias (no cross alias exists — MSVC ARM64__ldar*/__stlr*inlibobs/util/threading-windows.h).cmake/crossstill links no product app; this issue was the libobs + platform-plugin link, which is what landed.Refs #697
build(cross): link a shared libobs per alias with OBS_CROSS_LINK (obs…
docs(ci): record the measured cold cross-build cost per alias (obs-ru…