build: use UCRT runtime for Windows (release) binaries #30210

issue fanquake openend this issue on May 31, 2024
  1. fanquake commented at 8:56 am on May 31, 2024: member

    Switching to the modern runtime would be good, because the old runtime is missing features, which has meant writing workarounds for Windows in our code: i.e #29014/#29357.

    Mingw-w64 12.0.0 has been released, which now defaults to the UCRT runtime, over MSVCRT. See https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-doc/howto-build/ucrt-vs-msvcrt.txt for more details. This makes using it somewhat easier, because we can just use 12.0.0 verbatim, rather than having to configure an older mingw-w64 for the newer runtime.

  2. fanquake added the label Windows on May 31, 2024
  3. fanquake added the label Build system on May 31, 2024
  4. jeandudey commented at 10:32 am on July 4, 2024: none

    I’ve sent a patchset a while ago when working on cross-base updating MinGW to 12.0.0: https://issues.guix.gnu.org/71630.

    Using UCRT will likely need a new target triplet for Guix though like MSYS2 does, e.g. x86_64-w64-ucrt-mingw32.

  5. fanquake referenced this in commit 156bf3630f on Jul 16, 2024
  6. fanquake commented at 11:04 am on July 16, 2024: member

    I’ve sent a patchset a while ago

    Thanks. That has now landed, so we’ll bump the time machine to get things started here. See #30452.

  7. fanquake referenced this in commit 77ce657d53 on Jul 18, 2024
  8. fanquake referenced this in commit 314407a2fb on Jul 18, 2024
  9. fanquake referenced this in commit 641c7c44c0 on Jul 19, 2024
  10. fanquake referenced this in commit 1653d78cf3 on Jul 19, 2024
  11. fanquake referenced this in commit 2401a24387 on Jul 31, 2024
  12. hebasto commented at 6:51 am on October 30, 2024: member

    Here is another reason to switch to UCRT.

    UPD. Switching to UCRT does not actually resolve the issue mentioned in the referenced comment.

  13. hebasto commented at 10:02 am on October 30, 2024: member

    FWIW, here is a way to cross-build UCRT-linked Windows binaries on Fedora 41:

    0$ sudo dnf install ucrt64-gcc-c++
    1$ make -C depends HOST=x86_64-w64-mingw32ucrt mingw32_CC=/usr/bin/x86_64-w64-mingw32ucrt-gcc mingw32_CXX=/usr/bin/x86_64-w64-mingw32ucrt-g++
    2$ cmake -B build --toolchain depends/x86_64-w64-mingw32ucrt/toolchain.cmake
    3$ cmake --build build
    
  14. fanquake commented at 2:07 pm on January 21, 2025: member
    Inconsistency in the binaries leading to more workarounds/disabling test code: #31410.
  15. hebasto commented at 8:54 pm on February 1, 2025: member
    • Add CI to cover new runtime.

    I’ve added a nightly build with UCRT to https://github.com/hebasto/bitcoin-core-nightly.

    Inconsistency in the binaries leading to more workarounds/disabling test code: #31410.

    It seems that the mentioned issue requires further investigation, as the fix is still needed.

  16. PastaPastaPasta referenced this in commit 7ab40aecc6 on May 14, 2025
  17. PastaPastaPasta referenced this in commit 7f29288798 on May 16, 2025
  18. PastaPastaPasta referenced this in commit 7711ffb649 on May 19, 2025
  19. hebasto commented at 8:33 am on May 28, 2025: member

    @jeandudey

    I’ve sent a patchset a while ago when working on cross-base updating MinGW to 12.0.0: https://issues.guix.gnu.org/71630.

    Using UCRT will likely need a new target triplet for Guix though like MSYS2 does, e.g. x86_64-w64-ucrt-mingw32.

    Trying to build mingw-w64 with the deleted --with-default-msvcrt=msvcrt configure option results in a linker error:

    0x86_64-w64-mingw32-ld: src/.libs/libwinpthread_la-thread.o: in function `pthread_create_wrapper':
    1/tmp/guix-build-mingw-w64-x86_64-winpthreads-12.0.0.drv-0/mingw-w64-v12.0.0/mingw-w64-libraries/winpthreads/src/thread.c:1544: undefined reference to `__intrinsic_setjmpex'
    2collect2: error: ld returned 1 exit status
    3make[4]: *** [Makefile:706: libwinpthread.la] Error 1
    

    Any ideas on how to resolve this?

  20. PastaPastaPasta referenced this in commit 6a56facac6 on May 28, 2025
  21. DashCoreAutoGuix referenced this in commit 4d0d51c99c on May 30, 2025
  22. PastaPastaPasta referenced this in commit c9571b7b2a on May 31, 2025
  23. PastaPastaPasta referenced this in commit e417fec39c on May 31, 2025
  24. DashCoreAutoGuix referenced this in commit 7cbe6ab0a5 on May 31, 2025
  25. PastaPastaPasta referenced this in commit 563db57988 on Jun 1, 2025
  26. PastaPastaPasta referenced this in commit bf3e468056 on Jun 2, 2025
  27. fanquake referenced this in commit be853e9f7a on Nov 3, 2025
  28. fanquake referenced this in commit 9bcdd81636 on Nov 4, 2025
  29. fanquake referenced this in commit 701fb7c8e2 on Nov 4, 2025
  30. fanquake referenced this in commit 8649f7dcf7 on Nov 5, 2025
  31. fanquake referenced this in commit 5b51244f21 on Nov 6, 2025
  32. fanquake referenced this in commit 6efb234510 on Nov 10, 2025
  33. fanquake referenced this in commit ce204ecace on Nov 10, 2025
  34. fanquake referenced this in commit 746c540845 on Nov 11, 2025
  35. fanquake referenced this in commit 4568773763 on Nov 11, 2025
  36. fanquake referenced this in commit 0716bb53f0 on Nov 11, 2025
  37. fanquake referenced this in commit 94b5b3816c on Nov 11, 2025
  38. hebasto commented at 6:13 pm on November 11, 2025: member
    • Any other documentation / Windows release build configuration updates.

    See: #33857.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-11-27 00:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me