Bug 2314420 - All mingw-w64 variants support UCRT; none support MSVCRT
Summary: All mingw-w64 variants support UCRT; none support MSVCRT
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mingw-crt
Version: 41
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kalev Lember
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-09-24 11:20 UTC by Ron Yorston
Modified: 2024-10-03 12:28 UTC (History)
4 users (show)

Fixed In Version: mingw-crt-12.0.0-4.fc42 mingw-crt-12.0.0-4.fc41
Clone Of:
Environment:
Last Closed: 2024-09-30 00:26:42 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ron Yorston 2024-09-24 11:20:40 UTC
With the 12.0.0 release of mingw-w64 the default C runtime supported has changed from MSVCRT to UCRT. However, the Fedora build hasn't been updated to use the appropriate build-time configuration. As a result all toolchains in Fedora 41 target UCRT.

The release notes are here:

   https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-doc/howto-build/ucrt-vs-msvcrt.txt

They say:

   Users who wish to continue using msvcrt.dll can easily do so by
   adding the --with-default-msvcrt=msvcrt argument to both the
   mingw-w64-headers and mingw-w64-crt configure scripts.

However, looking at the RPM spec file for mingw-crt 12.0.0-3.fc41 I see:

%build
pushd mingw-w64-crt
    # Filter out -fstack-protector and -lssp from LDFLAGS as libssp is not yet potentially built with the bootstrap gcc
    MINGW32_LDFLAGS="`echo %{mingw32_ldflags} | sed 's|-fstack-protector||' | sed 's|-lssp||'`"
    MINGW64_LDFLAGS="`echo %{mingw64_ldflags} | sed 's|-fstack-protector||' | sed 's|-lssp||'`"
    MINGW64_CONFIGURE_ARGS="--disable-lib32"
    UCRT64_LDFLAGS="`echo %{ucrt64_ldflags} | sed 's|-fstack-protector||' | sed 's|-lssp||'`"
    UCRT64_CONFIGURE_ARGS="--disable-lib32 --with-default-msvcrt=ucrt"
    %mingw_configure
    %mingw_make_build
popd

I believe the correct configure arguments are now:

   MINGW64_CONFIGURE_ARGS="--disable-lib32 --with-default-msvcrt=msvcrt"
   UCRT64_CONFIGURE_ARGS="--disable-lib32"


Reproducible: Always

Steps to Reproduce:
I tested this by building a Windows application using the x86_64-w64-mingw32 toolchain. The resulting executable failed to run on a system without UCRT.

Performing the same build with the x86_64-w64-mingw32ucrt toolchain resulted in an executable which was identical to the other (apart from the timestamp and checksum in the PE header).

Comment 1 Fedora Update System 2024-09-24 12:53:07 UTC
FEDORA-2024-8dc61ddbe8 (mingw-crt-12.0.0-4.fc41 and mingw-headers-12.0.0-3.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-8dc61ddbe8

Comment 2 Sandro Mani 2024-09-24 12:53:40 UTC
Thanks for the bug report, should be fixed in the above mentioned packages.

Comment 3 Ron Yorston 2024-09-24 15:03:47 UTC
I've run some quick tests using the new packages and everything seems to be back to normal.

Thanks, Sandro!

Comment 4 Fedora Update System 2024-09-25 01:33:40 UTC
FEDORA-2024-8dc61ddbe8 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-8dc61ddbe8`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-8dc61ddbe8

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2024-09-29 18:16:22 UTC
FEDORA-2024-7b84650e0e (mingw-crt-12.0.0-4.fc42 and mingw-headers-12.0.0-3.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-7b84650e0e

Comment 6 Fedora Update System 2024-09-30 00:26:42 UTC
FEDORA-2024-7b84650e0e (mingw-crt-12.0.0-4.fc42 and mingw-headers-12.0.0-3.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 7 Ron Yorston 2024-09-30 06:54:48 UTC
Will there also need to be a rebuild of the mingw32/mingw64 packages which are built using mingw-crt/mingw-headers?

Comment 8 Fedora Update System 2024-10-03 00:15:21 UTC
FEDORA-2024-8dc61ddbe8 (mingw-crt-12.0.0-4.fc41 and mingw-headers-12.0.0-3.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Sandro Mani 2024-10-03 11:36:16 UTC
> Will there also need to be a rebuild of the mingw32/mingw64 packages which are built using mingw-crt/mingw-headers?

I believe mingw-gcc should suffice, or are you seeing any other remaining issues?

Comment 10 Ron Yorston 2024-10-03 12:28:29 UTC
No, I don't have any other issues. My program doesn't have any dependencies beyond the C runtime.


Note You need to log in before you can comment on or make changes to this bug.