sdk-ng icon indicating copy to clipboard operation
sdk-ng copied to clipboard

Upgrade MinGW Toolchain

Open stephanosio opened this issue 1 year ago • 1 comments
trafficstars

The MinGW toolchain that is available as part of Debian 10, which is the base image for the sdk-build Docker image, is too outdated (MinGW 6.0.0 with GCC 8.3.0) to support Windows LLVM build.

Update the sdk-build Docker image to include a more up-to-date MinGW-w64 toolchain.

Notes

  • It will be necessary to build the full MinGW-w64 toolchain from source since there is no adequate binary distribution available for Debian 10.
  • Use mingw-w64 package from Ubuntu 24.10 as a reference.
    • This will get us a fairly up-to-date and stable MinGW-w64 toolchain to use.
    • It is also up-to-date enough to support UCRT (see https://github.com/zephyrproject-rtos/sdk-ng/issues/681).
  • GCC will need to be built for both win32 and posix thread models.
    • Keep building Windows GNU toolchain with win32 thread model since we do not need pthread and we do not want to include pthread DLL in the Windows GNU toolchain distribution.
    • LLVM uses std::thread, which depends on pthread, and therefore require the posix thread model. Yes, we will need to include the pthread DLL.
  • Build MinGW-w64 with UCRT as the "default MSVCRT."

Resources

  • Ubuntu 24.10 MinGW-w64 Source Packages
    • https://launchpad.net/ubuntu/oracular/+package/mingw-w64
    • https://launchpad.net/ubuntu/oracular/+package/binutils-mingw-w64
    • https://launchpad.net/ubuntu/oracular/+package/gcc-mingw-w64
  • https://github.com/zephyrproject-rtos/sdk-ng/issues/681

stephanosio avatar Oct 23 '24 03:10 stephanosio