From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id C7896385841E for ; Sat, 26 Nov 2022 19:09:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C7896385841E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x62a.google.com with SMTP id n21so16958546ejb.9 for ; Sat, 26 Nov 2022 11:09:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=puVbBqplCxWOKMd94QDpUP3CWvr4ux9M5rImRrd8CEg=; b=imYQXncAjuCTzr0eea90IswiGlpnnZfGeYtidMd8uye5NET0f4+wZCDv7sxxSL4qn4 WE3Bvh+HoeEgfo049H5NcXwlE0trwAfaMXDoUe/F0r7/in6J3infecIdJ8FrWWnOMJ9D XykLPQd+Ls1h2QGlRl0h6OHoBiYmJBlt6+UnrmpoustxcpjvD0bQ9HYYofZrrRr7r7DW eYA7HbxoTxTLAz5vI5lzDElmzvllj1NivbFx7OGoBOta1JokQgVJhyogL/3MvgzcbGj7 jnrFqy1spUsDW7j3ByHdMKWXojf1xs3A7qrdgXvzRH3vJpPio7+VaSbb8Gyh3RiqqmXF FIxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=puVbBqplCxWOKMd94QDpUP3CWvr4ux9M5rImRrd8CEg=; b=ojUHPQIxnCB5lDfzS8df39mzeRrsWThZbApjVR75nP5NiqmqBEDmCg5W4xhYKX9J+r j1N090S05sHId09q9/FoxJ9955d2BV8M7m/VQXxs99O5kQAGmLchwUcOxHS+ppy9h6BC UVXe44pDWPenHequSYV2uRNRpD0WiWMhDy3H3uJeskN26d6c/POM4TKmDXMLBVefvznC nxyDH/17M9n2Z/3h/DCaCwNv5g/K2YIyY4LFJYTypSR9K5OSgiQTRSPJNJsVohS6E4GB zgtn9Pbg/p4eBMHviHS4WOCw9gx42LZZFR9Xh6gXizPLdHkuNLh8ihSyA0nuvH8W4hYe E22g== X-Gm-Message-State: ANoB5pkLzN8s2DVAqQAdui8qfM+35Mt6kCyLSWKlJ7xXO3hDTyGAWors ZaUD0yV9Uxn7ySxtOBJW7MA= X-Google-Smtp-Source: AA0mqf6ou+bkq4/kJVKzma54IxmsSHBb+F73QQ8I69LtarvA8aRNdEr6yMwkZQReRljoCLbr40WhKw== X-Received: by 2002:a17:907:9190:b0:78a:52bb:d904 with SMTP id bp16-20020a170907919000b0078a52bbd904mr20799490ejb.630.1669489751464; Sat, 26 Nov 2022 11:09:11 -0800 (PST) Received: from pali ([2a02:2b88:6:5cc6::2f]) by smtp.gmail.com with ESMTPSA id w12-20020a170907270c00b0076ff600bf2csm2976143ejk.63.2022.11.26.11.09.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 11:09:10 -0800 (PST) Date: Sat, 26 Nov 2022 20:09:09 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: LIU Hao Cc: mingw-w64-public@lists.sourceforge.net, gcc@gcc.gnu.org Subject: Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library Message-ID: <20221126190909.phgwurgcgztok62h@pali> References: <20221120125348.a6xh7kxmvrimse72@pali> <3966ae87-8e0e-3fba-bb3e-4be572c17e04@126.com> <20221120150645.lu4c6m3bhrpupwm3@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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.