From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fencepost.gnu.org (fencepost.gnu.org [IPv6:2001:470:142:3::e]) by sourceware.org (Postfix) with ESMTPS id 7C63C396E856 for ; Sun, 20 Nov 2022 14:45:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7C63C396E856 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=vwVzx3RX+i4QdxRISkOe36gnSOzigJABo1ZS4vI0K4k=; b=Pedx+zhVepH4hN4v8HEh j3zyBZiwI14SSca/qCXs4Fl2FCIAb/Yv/svk22OEAzsH7TQjW4YwK1sMQMUY5ZEJ5DH1q1HHPxGJU 4QOt1lvVo4YywK5DblwXTh2uVkRslL+Ilu1u+8fQkc2lrHgkUKnUC1KnZcLH7XxIo/By+6RZ/uEpe skZS8YkW+KleB/scRWd5z4lg9XzOAyciLWBbsQ7N4f7828JW/kJZwSJd+vBo1rdRUu8UdrEz/aXsZ us9oIOPi7xUs95Zzvdc+1Sv+qK0fZcHqJN+2s0e6zI4G8cEgjFT2/8wLTCkWrGy8VnVBMY/ef0zxq TxZQbRkKZVpPZA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owlZp-0000nC-H9; Sun, 20 Nov 2022 09:45:45 -0500 Date: Sun, 20 Nov 2022 16:45:55 +0200 Message-Id: <83cz9h65wc.fsf@gnu.org> From: Eli Zaretskii To: Pali =?utf-8?Q?Roh=C3=A1r?= Cc: gcc@gcc.gnu.org, mingw-w64-public@lists.sourceforge.net In-Reply-To: <20221120125348.a6xh7kxmvrimse72@pali> (message from Pali =?utf-8?Q?Roh=C3=A1r?= via Gcc on Sun, 20 Nov 2022 13:53:48 +0100) Subject: Re: gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library References: <20221120125348.a6xh7kxmvrimse72@pali> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Date: Sun, 20 Nov 2022 13:53:48 +0100 > From: Pali Rohár via Gcc > > 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?