From Fedora Project Wiki
(Change submitted to FESCo)
(Add trackers)
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:


== Current status ==
== Current status ==
[[Category:ChangeReadyForFesco]]
[[Category:ChangeAcceptedF37]]


[[Category:SelfContainedChange]]
[[Category:SelfContainedChange]]
Line 25: Line 25:
* [https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/ODEXJQQBOLFY3BHIVL6FPSZYPQ3QRMJC/ devel thread]
* [https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/ODEXJQQBOLFY3BHIVL6FPSZYPQ3QRMJC/ devel thread]
* FESCo issue: [https://pagure.io/fesco/issue/2754 #2754]
* FESCo issue: [https://pagure.io/fesco/issue/2754 #2754]
* Tracker bug: <will be assigned by the Wrangler>
* Tracker bug: [https://bugzilla.redhat.com/show_bug.cgi?id=2055254 #2055254]
* Release notes tracker: <will be assigned by the Wrangler>
* Release notes tracker: [https://pagure.io/fedora-docs/release-notes/issue/806 #806]


== Detailed Description ==
== Detailed Description ==

Latest revision as of 14:25, 16 February 2022

MinGW UCRT target

Summary

This proposal is to add the UCRT target & support from Fedora to the MinGW cross-toolchains.

Owner


Current status

Detailed Description

The current mingw32 and mingw64 cross-toolchains provided by Fedora target the MSVCRT (Microsoft Visual C++ Runtime). Since Visual Studio 15 & Windows 10, the default and recommended runtime is UCRT. See also MSVCRT vs UCRT.

A new toolchain target triple x86_64-w64-mingw32ucrt and associated binaries will be added.

Fedora MinGW macros will be provided to target UCRT, with ucrt64-* prefix (ex: ucrt64-meson)

mingw-* libraries will be progressively adjusted to add the produced ucrt64-* binaries.

Since mingw-*.spec are very repetitive and cumbersome to modify (each mingw32, mingw64, ucrt package has to be defined manually, and this is tedious and error-prone), a custom MinGW/Fedora tool or solution will be proposed. In the meantime, packages can be modified to add manually the new target.

UCRT plans on mingw@lists.fedoraproject.org

Feedback

Benefit to Fedora

This change will allow to cross-compile projects to Windows with the up to date C runtime & headers, and better c99 support. This should allow to more easily mix binaries produced from different versions or compilers as well.

Scope

  • Proposal owners:
    • update the mingw filesystem, binutils, headers, gcc & winpthreads packages
    • bootstrap the new toolchain
    • propose a solution to simplify library packaging with the different targets
    • update some common library packages, such as mingw-zlib
  • Other developers:
    • Progressively adjust the mingw-* packages to produce ucrt64- packages, following the updated guidelines.
  • Policies and guidelines: N/A (not needed for this Change)

https://fedoraproject.org/wiki/Packaging:MinGW packaging guideline will be adjusted.

  • Trademark approval: N/A (not needed for this Change)
  • Alignment with Objectives:


Upgrade/compatibility impact

None

How To Test

$ x86_64-w64-mingw32ucrt-gcc test.c

$ /usr/bin/mingw-objdump -p a.exe | grep DLL
 vma:            Hint    Time      Forward  DLL       First
    DLL Name: KERNEL32.dll
    DLL Name: api-ms-win-crt-time-l1-1-0.dll
    DLL Name: api-ms-win-crt-math-l1-1-0.dll
    DLL Name: api-ms-win-crt-runtime-l1-1-0.dll
    DLL Name: api-ms-win-crt-environment-l1-1-0.dll
    DLL Name: api-ms-win-crt-private-l1-1-0.dll
    DLL Name: api-ms-win-crt-heap-l1-1-0.dll
    DLL Name: api-ms-win-crt-locale-l1-1-0.dll
    DLL Name: api-ms-win-crt-stdio-l1-1-0.dll
    DLL Name: api-ms-win-crt-string-l1-1-0.dll


User Experience

Windows binaries produced by Fedora cross-toolchain will target a more modern and compatible C runtime, bringing hopefully better compatibility & safety.

Dependencies

None

Contingency Plan

  • Contingency mechanism: N/A (not a System Wide Change)
  • Contingency deadline: N/A (not a System Wide Change)
  • Blocks release? No (not a System Wide Change)

Documentation

N/A (not a System Wide Change)

Release Notes

The new MinGW toolchain and tools are available to compile binaries targeting the Windows UCRT.