Skip to content

Migrate Windows x86_64 builds from MINGW64 to UCRT64 - #36

Merged
hendriks73 merged 2 commits into
devfrom
hendrik/msys2-ucrt64
Oct 22, 2026
Merged

hendriks73 merged 2 commits into
devfrom
hendrik/msys2-ucrt64

Conversation

@hendriks73

Copy link
Copy Markdown
Owner

Why

setup-msys2 warns: "[msystem-mingw64] MINGW64 is deprecated. Migrate to UCRT64 or CLANG64."

Change

  • build-and-test.yml (x64 matrix entry) and deploy.yml (windows-x64-build) now use msystem: ucrt64 with the mingw-w64-ucrt-x86_64-* toolchain and Doxygen packages.
  • The 32-bit jobs stay on mingw32. UCRT64 and CLANG64 are 64-bit only, and the deprecation warning is only about MINGW64.
  • A new CI step in the Windows test job prints the imports of the built DLL, so runtime dependencies are visible.
  • I updated the docs (CLAUDE.md, ffsampledsp-x86_64-win/CLAUDE.md) and NOTES.md.

Why UCRT64 and not CLANG64

  • The prebuilt FFmpeg static libs (com.tagtraum:ffmpeg-x86_64-win:8.1.0) are already compiled against UCRT. libavutil.a, libavformat.a and libbz2.a reference __acrt_iob_func, which exists only in UCRT, and they were built with MSYS2's GCC 15.2. MINGW64 links them against msvcrt through mingw-w64 compatibility shims; UCRT64 makes the toolchain match the libs.
  • UCRT64 keeps GCC, so the existing compiler/linker options (-static-libgcc, -Wl,--kill-at, …) apply unchanged. CLANG64 would switch to clang/lld and libc++/compiler-rt.

Impact

The x86_64 DLL now imports the Universal C Runtime (api-ms-win-crt-*) instead of msvcrt.dll. UCRT is part of Windows 10 and later, and on Windows 7/8.1 it comes with update KB2999226. Any JDK 11+ on Windows already depends on UCRT itself.

Testing

This can't be built locally (macOS). CI on this PR is the test, and the new "Print DLL imports" step should show only system DLLs.

🤖 Generated with Claude Code

MSYS2 deprecated the MINGW64 environment. UCRT64 keeps GCC (so the
existing gcc-specific linker options still apply) and matches the
prebuilt FFmpeg static libs, which are already compiled against UCRT
(they reference __acrt_iob_func). The 32-bit builds stay on MINGW32,
as MSYS2 has no 32-bit UCRT environment.

Also print the imports of the built DLL in CI, to make runtime
dependencies visible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hendriks73
hendriks73 merged commit e08ab09 into dev Oct 22, 2026
36 checks passed
@hendriks73
hendriks73 deleted the hendrik/msys2-ucrt64 branch October 22, 2026 09:17
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