pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: mingw default crt is surprising
On Sat, 24 Aug 2024 at 10:06, nia <nia%netbsd.org@localhost> wrote:
>
> I had the need to compile some windows code recently, so I had a look
> at mingw-w64 from pkgsrc. I was quite surprised that it linked
> against a C++ runtime that my Windows machine didn't have, given
> I was compiling boring C99 code.
>
> After some research, it appears to be due to this change:
>
> v12.0.0: 2024-05-29
>
> "Important: UCRT is now the default CRT runtime instead of MSVCRT, check the
> mingw-w64-doc/howto-build/ucrt-vs-msvcrt.txt document for details. Both
> header set and CRT must be configured and built with the same settings
> consistently for proper functionality. Switching runtimes requires all
> libraries to be rebuilt, including GCC."
>
> After some more research, I realized other vendors are distributing
> two different versions of MinGW, one with UCRT and the other with
> MSVCRT for supporting Windows before 10:
>
> https://winlibs.com/
>
> Then I did some research (not used Windows in 10 years!) and found
> roughly 5% of Windows users are on versions before 10.
>
> I'd like my boring C99 code to be as portable as possible, and to
> support those 5%. But I'm unsure how to deal with this mess.
> Add a mingw-w64-msvcrt package? Add a PKG_OPTION?
> Swallow my pride and bootstrap an older pkgsrc version to
> some PREFIX?
Microsoft do make free UCRT downloads available for Vista, 7, 8 (and
whatever Windows Servers versions those map to), so it would probably
be good to add a note and link to the mingw-w64 DESCR -
https://support.microsoft.com/en-us/topic/update-for-universal-c-runtime-in-windows-c0514201-7fe6-95a3-b0a5-287930f3560c
Without that I'd definitely have said make a mingw-w64-msvcrt package.
With it... I'd still be slightly more inclined to make a
mingw-w64-msvcrt package over a PKG_OPTION, as people may have an
existing setup and want to target msvcrt over ucrt, or that special
special embedded XP system which "they will migrate away from really
really this year"... but with that note in its DESCR pointing people
at the ucrt version for the default case on Vista and later :)
David
Home |
Main Index |
Thread Index |
Old Index