On Sunday 20 November 2022 16:45:55 Eli Zaretskii wrote:
> > Date: Sun, 20 Nov 2022 13:53:48 +0100
> > From: Pali Rohár via Gcc <gcc@gcc.gnu.org>
> > 
> > Hello! I would like to propose a new parameter for gcc: -mcrtdll= to
> > allow specifying against which Windows C Runtime library should be
> > binary linked. On Windows there are more crt libraries and currently gcc
> > links to libmsvcrt.a which is in most cases symlink to libmsvcrt-os.a
> > (but can be changed, e.g. during mingw-w64 building). mingw-w64 project
> > already builds import .a library for every crt dll library (from the old
> > crtdll.dll up to the new ucrtbase.dll), so it is ready for usage. Simple
> > patch for gcc which implements -mcrtdll parameter is below. Note that on
> > internet are other very similar patches for -mcrtdll= parameters and
> > some are parts of custom mingw32 / mingw-w64 gcc builds. What do you
> > think? Could gcc have "official" support for -mcrtdll= parameter?
> 
> Linking a program against a specific runtime means the produced binary will
> not run on Windows systems older than the one where it was linked.  Why is
> such a limitation a good idea, may I ask?

It will run also on older Windows system if you install redistributable
runtime library. Which in most cases is already installed because other
programs use it.

And why you want a new version? Because of better C99/C11 support which
is in ucrtbase.dll

Note that with this option, you can also choose older version than the
default one (WinXP msvcrt.dll). So e.g. you can choose msvcrt20.dll or
crtdll.dll for older Windows version.

Reply via email to