From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 4D38B39730E8 for ; Sun, 20 Nov 2022 15:04:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4D38B39730E8 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-x62f.google.com with SMTP id me22so6857121ejb.8 for ; Sun, 20 Nov 2022 07:04:14 -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=c4EyySq0XBfGNoTWqwTFeWHTAGq0MDjHNkNDsA24NO0=; b=csSmpnp2ExThHVdZrq8zlTwUbZerVtHfcCMgmwjFCqmZo7qqF68Jfam+/3K2qmE8l/ qVaeqszBJeAVVpQml7pLgJLYJJwMs2T2EMSbtczRTfVIWQgD9rmSqCP7WatQco/kDy+o d+uzvm71vkpsXkSjW/MLQ0Xk527q9xJAdEvpGDlVRdKtGQtI0klJVsyPOUlLRfcUKaxL AEzjBEsXOHwWfPilFRrDKb5XXJUtBPxyTHerStFb2g3nmk6+F7yNHugSPa7JbYuUOLxS bVHYaeeegDwWiEaKJMXHbgLvqaEO0AVUSW3XpbtVPTf5Il+/aMcPO0nq2Pi2IKkPnDzh m+wg== 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=c4EyySq0XBfGNoTWqwTFeWHTAGq0MDjHNkNDsA24NO0=; b=T4OGxkZyaKTt0BPKRaVe1OH+bXldnaKh0hy+1TLgXRrmihZR/YiIowM6xofk9gNNzO d+U8SuoBYNwKLl20m1WG+0HbmdkamXO8LrpwYXZdBEwa1SFlT5Br6dw8vRC93JYrheCz A4tjZwVOUQ1UZ6yu8qapdOxbrBjiay1S4z4RnoLoWXK41dBuwBJSXImqSD0/x204q7Zp I3IaVw0j0bBQe2aAqKIMqveRjR/raB5/X8rpkZvSGfk3T/x4iitI0vtQLM0Z8xFDXcTk IGuqxkIowe54btmSThHNkTKYlDi43u4hr6YBmPifrmmJDNDmOKU5MOadNqOAqcebWMlH mxow== X-Gm-Message-State: ANoB5pllAWON32x0K/MqY/nkJK+QDTz+Q0zVe+BOppHCaiiAiS8JhI8W Zf+fWrd1pBsYLlTNJT79Orw= X-Google-Smtp-Source: AA0mqf5Tgn3djjkpZQIrBzdGrsTgkSwa2BSTgUEwVKGTC3B+GH+g9SswdKyYApa8qYdMWDVVbavEuQ== X-Received: by 2002:a17:906:4a8d:b0:78d:a4ca:32df with SMTP id x13-20020a1709064a8d00b0078da4ca32dfmr11910730eju.686.1668956652926; Sun, 20 Nov 2022 07:04:12 -0800 (PST) Received: from pali ([2a02:2b88:6:5cc6::2f]) by smtp.gmail.com with ESMTPSA id er21-20020a056402449500b00451319a43dasm4052659edb.2.2022.11.20.07.04.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Nov 2022 07:04:12 -0800 (PST) Date: Sun, 20 Nov 2022 16:04:11 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Eli Zaretskii Cc: gcc@gcc.gnu.org, mingw-w64-public@lists.sourceforge.net Subject: Re: gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library Message-ID: <20221120150411.yimchs4ic3xtvny3@pali> References: <20221120125348.a6xh7kxmvrimse72@pali> <83cz9h65wc.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <83cz9h65wc.fsf@gnu.org> 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 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 > > > > 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.