public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: sotrdg sotrdg <euloanty@live.com>
To: "mingw-w64-public@lists.sourceforge.net"
	<mingw-w64-public@lists.sourceforge.net>,
	LIU Hao <lh_mouse@126.com>
Cc: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>,
	"mingw-w64-public@lists.sourceforge.net"
	<mingw-w64-public@lists.sourceforge.net>
Subject: Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library
Date: Sun, 27 Nov 2022 01:06:42 +0000	[thread overview]
Message-ID: <SA1PR11MB713048327B0F1DFCFA4D4685B2109@SA1PR11MB7130.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20221126190909.phgwurgcgztok62h@pali>

[-- Attachment #1: Type: text/plain, Size: 2522 bytes --]

what you want is basically a ucrt multilib. However, neither glibc provides the same toggle too. i do not see a good reason for your request.

Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: Pali Rohár <pali.rohar@gmail.com>
Sent: Saturday, November 26, 2022 2:09:09 PM
To: LIU Hao <lh_mouse@126.com>
Cc: gcc@gcc.gnu.org <gcc@gcc.gnu.org>; mingw-w64-public@lists.sourceforge.net <mingw-w64-public@lists.sourceforge.net>
Subject: Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

On Monday 21 November 2022 13:21:53 LIU Hao wrote:
> 在 2022/11/20 23:06, Pali Rohár 写道:
> > Thank you for explaining more details. My simple patch takes this in
> > care and defines also __MSVCRT_VERSION__ to the correct value based on
> > -mcrtdll parameter.
>
> Apologies for reading your message only partially. I thought your patch was
> the same as MSYS2's. It turns out that you have made further progress;
> that's very kind of you.
>
> As for the patch itself: It's probably safe to switch between MSVCR* DLLs,
> but switching from MSVCR* to UCRT requires a complete rebuild due to
> differences in implementation of stdio functions and definition of `time_t`
> on x86. There are more reasons, for example, that MSVCR80 and 90 require
> architecture-specific manifests to load, and MSVCR80 to 120 are not
> pre-installed and have to be installed by users. These could explain why
> `-mcrtdll=` hasn't gained wide use, while UCRT-based toolchains have.
>
> So, the patch may be acceptable, but I don't think it will solve the issue
> for you. A user should usually choose MSVCRT or UCRT, which however requires
> rebuilding the CRT. For those who really really wish to link against
> MSVCR100 for example, it's always doable to pass `-nodefaultlibs` to GCC,
> and specify desired libraries explicitly.

The ultimate goal could be to improve mingw-w64 build process to compile
one set of libraries which would work with both msvcrt and ucrt. There
is already discussion about it in separate mingw-w64 email thread.
Probably not easy task, but I think it can be possible. Anyway, in any
case, this work is independent of gcc and independent of introduction of
-mcrtdll= gcc switch. So I think this switch still can be useful.


_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

  reply	other threads:[~2022-11-27  1:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-20 12:53 Pali Rohár
2022-11-20 13:36 ` [Mingw-w64-public] " LIU Hao
2022-11-20 15:06   ` Pali Rohár
2022-11-21  5:21     ` LIU Hao
2022-11-26 19:09       ` Pali Rohár
2022-11-27  1:06         ` sotrdg sotrdg [this message]
2022-11-20 14:45 ` Eli Zaretskii
2022-11-20 15:04   ` Pali Rohár
2022-11-20 15:23     ` Eli Zaretskii
2022-11-20 15:44       ` Pali Rohár
2022-11-20 15:58         ` Eli Zaretskii
2022-11-20 16:19           ` [Mingw-w64-public] " ralph engels
2022-11-20 16:20           ` Matthew Brett
2022-11-20 21:22 ` Martin Storsjö
2022-12-04 12:16 ` Pali Rohár
2022-12-04 12:48   ` LIU Hao
2023-04-21 16:23     ` Pali Rohár
2023-05-06 10:45       ` Pali Rohár
2023-05-08  3:44         ` LIU Hao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SA1PR11MB713048327B0F1DFCFA4D4685B2109@SA1PR11MB7130.namprd11.prod.outlook.com \
    --to=euloanty@live.com \
    --cc=gcc@gcc.gnu.org \
    --cc=lh_mouse@126.com \
    --cc=mingw-w64-public@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).