Repository navigation
Build the C oracle and libobs util with GCC for Windows - #431
Merged
Merged
Conversation
…RED) A GCC-based Windows toolchain can't build the C oracle today: it gets the MSVC threading header, the MSVC-only min/max assumption and the weak os_oom/os_breakpoint stubs. Refs #291
- util/threading.h: threading-windows.h is MSVC intrinsics, so pick it by _MSC_VER; MinGW gets the compiler __atomic builtins. - util/buffered-file-serializer.c: define min/max unless the MSVC <stdlib.h> macros exist, instead of on every _WIN32. - obs-c-oracle build.rs: w32-pthreads by target (Windows), not compiler. - oracle test_stubs.c: strong os_oom/os_breakpoint on every Windows target; MinGW drops weak-only definitions from static archives. Every workspace test binary now links for x86_64-pc-windows-gnu. Closes #291 Local-Gate: v1 tree=bddbac456889d9085fa86ab6743c22f3cd536613 secs=256 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791858737,"gate":"rust/all/fmt","host":"linux-x86_64","key":"b41dbb491bd0eb732f6f8d3b31b6a438b7bbf5decdd105d2bd78969648ca745e","lane":"lint","parents":["c17953e0101943fd2199765f1712edbc1cb2111e"],"secs":28,"stamp":"1e9da3662a07466bc43f05cb106d5c25","tree":"bddbac456889d9085fa86ab6743c22f3cd536613","v":1,"via":"run"} Ci-Attestation: {"at":1791858737,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"b41dbb491bd0eb732f6f8d3b31b6a438b7bbf5decdd105d2bd78969648ca745e","lane":"lint","parents":["c17953e0101943fd2199765f1712edbc1cb2111e"],"secs":28,"stamp":"9e04dfa34bdf1e0b597e290685a2fcb0","tree":"bddbac456889d9085fa86ab6743c22f3cd536613","v":1,"via":"run"} Ci-Attestation: {"at":1791858737,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"2b9bb018c84941528450affe914f9dde87430a4b1ead73864baa0d34f739fd2a","lane":"rust-test","parents":["c17953e0101943fd2199765f1712edbc1cb2111e"],"secs":113,"stamp":"ce5f97aab981596456d5e6860fb7ecef","tree":"bddbac456889d9085fa86ab6743c22f3cd536613","v":1,"via":"run"} Ci-Attestation: {"at":1791858737,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"7cfebc9c79798ada12afdf61bfd5372afedb5ca116db1922ff10dc0b7bcaf1d1","lane":"tier2-linux","parents":["c17953e0101943fd2199765f1712edbc1cb2111e"],"secs":114,"stamp":"1d74a9485a3de6574984c69bc510ea4f","tree":"bddbac456889d9085fa86ab6743c22f3cd536613","v":1,"via":"run"}
Listing it under [toolchain] targets made soldr on the Windows runner build and run the whole test suite as x86_64-pc-windows-gnu, where profiler_parity crashes (a separate MinGW runtime issue). Refs #291 Local-Gate: v1 tree=56a412e99eceeaffd0c6cdd2ff29529c89895778 secs=271 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791861790,"gate":"rust/all/fmt","host":"linux-x86_64","key":"fe474cad64032fe3ec10ae4691f54e8c49225610cae8221e9347aad1268ff3d5","lane":"lint","parents":["bab2092f5ae30199fdcea5cf97494866e72d529f"],"secs":78,"stamp":"c496fe4fd1e3b6a5463b89386ce07548","tree":"56a412e99eceeaffd0c6cdd2ff29529c89895778","v":1,"via":"run"} Ci-Attestation: {"at":1791861790,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"fe474cad64032fe3ec10ae4691f54e8c49225610cae8221e9347aad1268ff3d5","lane":"lint","parents":["bab2092f5ae30199fdcea5cf97494866e72d529f"],"secs":78,"stamp":"70624bf9927503a2cd85c55c4430e4c0","tree":"56a412e99eceeaffd0c6cdd2ff29529c89895778","v":1,"via":"run"} Ci-Attestation: {"at":1791861790,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"86bb0d707d0a503568ff62156e4ee839421a63facfa9099d761bc2ae4acdf5a1","lane":"rust-test","parents":["bab2092f5ae30199fdcea5cf97494866e72d529f"],"secs":124,"stamp":"18dd9fa51f2ba10bcd9c686aa15f8c3e","tree":"56a412e99eceeaffd0c6cdd2ff29529c89895778","v":1,"via":"run"} Ci-Attestation: {"at":1791861790,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"48b7392422fad28aef676a237feac4ab6c382846139e1e0199cd3608eef4a6de","lane":"tier2-linux","parents":["bab2092f5ae30199fdcea5cf97494866e72d529f"],"secs":69,"stamp":"5a68367c97a4620918eab0eb920f3b5a","tree":"56a412e99eceeaffd0c6cdd2ff29529c89895778","v":1,"via":"run"}
zackees
force-pushed
the
fix/291-windows-gnu-oracle
branch
from
October 13, 2026 03:23
1a295fb to
0080625
Compare
Member
Author
|
The Windows Rust Tests failure was caused by this PR. With |
This was referenced Oct 13, 2026
zackees
added a commit
to rdoupe/obs-studio
that referenced
this pull request
Oct 13, 2026
obs-rust#420 (video-io port) and obs-rust#431 (windows-gnu --no-run link in the rust-test lane) merged within minutes, and together the lane failed on master: obs-media-io's video_io test didn't link. - The video-io oracle's obs_get_profiler_name_store/profile_store_name stand-ins were weak on every non-MSVC Windows target, where the audio oracle's strong copies don't exist; MinGW drops weak-only definitions from static archives. Strong on every _WIN32 now. - GNU ld scans archives once, in order, and rustc put the oracle's rlib before obs_util and obs_media_io, which call into it. The lane links through the toolchain's lld (rustlib/<host>/bin/gcc-ld) instead. Refs obs-rust#291
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.
Closes #291.
On a
x86_64-pc-windows-gnu(MinGW) toolchain no test binary linked. I reproduced it from Linux with soldr's mingw-w64 GCC 15.3 cross toolchain, and found four gaps:util/threading.hincludedthreading-windows.h(MSVC intrinsics__iso_volatile_load32,_InterlockedExchange8) on every_WIN32_MSC_VER(clang-cl defines it too). Other compilers usethreading-posix.h, which is only the compiler__atomicbuiltinsutil/buffered-file-serializer.cdefinedmin/maxonly#ifndef _WIN32, relying on MSVC's<stdlib.h>macrosobs-c-oracle/build.rsuseddeps/w32-pthreadsonly when the compiler is MSVCtest_stubs.cmadeos_oom/os_breakpointweak on non-MSVC; MinGW drops weak-only definitions from static archives, and Windows has no Rust shim for them_WIN32The
threading.hchange was approved by the maintainer on the issue thread. MSVC and clang-cl builds take exactly the same path as before.rust-testlane also runssoldr cargo test --workspace --locked --no-run --target x86_64-pc-windows-gnu.rust-toolchain.tomladds that target so rustup installs it. On master's code this fails in the oracle build.x86_64-pc-windows-gnu. They aren't run (no Wine), so this guards the build and link, not test results on MinGW.The local gate (lint, rust-test with the cross build, Tier 2 OFF/ON) passed and is stamped.