1
0
mirror of https://github.com/skeeto/w64devkit.git synced 2025-07-30 04:03:05 +03:00

Use --with-default-msvcrt=msvcrt-os with Mingw-w64

The Mingw-w64 default may change to UCRT in the future, possibly soon,
but w64devkit will continue with the original msvcrt.dll for as long as
possible. It has far better compatibility with older systems, and UCRT
has limited availability prior to Windows 10.

The only benefits of linking UCRT that I know are better compatibility
when statically linking with UCRT-based toolchains, particularly MSVC,
and actually-working assertions (something Mingw-w64 could fix, as it
does printf, etc.). That's it! Mingw-w64 already fills in the missing
C99 bits. The Mingw-w64 documentation vaguely mentions a UTF-8 locale,
but it is either false or useless depending on the meaning. UCRT has all
the same narrow API limitations of MSVCRT — *the* biggest and thorniest
issue with Windows CRTs.

Trading away a ton of backwards compatibility just for better static
linking with MSVC sounds like a poor cost-benefit trade-off. In that
light, the choice of CRT seems obvious regardless of the Mingw-w64
default. My own view is that Windows CRTs have been poorly implemented
and are generally not worth using, so they should be avoided in the
first place, i.e. define {main,WinMain}CRTStartup, call Win32 directly,
and compile with -nostartfiles.

https://sourceforge.net/p/mingw-w64/mailman/message/37853546/
This commit is contained in:
Christopher Wellons
2023-06-12 22:17:52 -04:00
parent 2617b47433
commit c17f5ca2b4
2 changed files with 13 additions and 9 deletions

View File

@ -90,6 +90,7 @@ WORKDIR /x-mingw-headers
RUN /mingw-w64-v$MINGW_VERSION/mingw-w64-headers/configure \
--prefix=/bootstrap/$ARCH \
--host=$ARCH \
--with-default-msvcrt=msvcrt-os \
&& make -j$(nproc) \
&& make install
@ -127,6 +128,7 @@ RUN /mingw-w64-v$MINGW_VERSION/mingw-w64-crt/configure \
--prefix=/bootstrap/$ARCH \
--with-sysroot=/bootstrap/$ARCH \
--host=$ARCH \
--with-default-msvcrt=msvcrt-os \
--disable-dependency-tracking \
--disable-lib32 \
--enable-lib64 \
@ -212,6 +214,7 @@ WORKDIR /mingw-headers
RUN /mingw-w64-v$MINGW_VERSION/mingw-w64-headers/configure \
--prefix=$PREFIX/$ARCH \
--host=$ARCH \
--with-default-msvcrt=msvcrt-os \
&& make -j$(nproc) \
&& make install
@ -220,6 +223,7 @@ RUN /mingw-w64-v$MINGW_VERSION/mingw-w64-crt/configure \
--prefix=$PREFIX/$ARCH \
--with-sysroot=$PREFIX/$ARCH \
--host=$ARCH \
--with-default-msvcrt=msvcrt-os \
--disable-dependency-tracking \
--disable-lib32 \
--enable-lib64 \