From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Compiling in mingw-ucrt runtime Date: Fri, 23 Feb 2024 12:32:27 +0100 Message-ID: References: <864je1m0mn.fsf@gnu.org> <86cysn1tbr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36715"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 23 13:00:30 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rdUE9-0009Ik-Kd for ged-emacs-devel@m.gmane-mx.org; Fri, 23 Feb 2024 13:00:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdUDE-00028h-0h; Fri, 23 Feb 2024 06:59:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdTn2-0006cu-0F for emacs-devel@gnu.org; Fri, 23 Feb 2024 06:32:28 -0500 Original-Received: from mail-dbaeur03olkn2010.outbound.protection.outlook.com ([40.92.58.10] helo=EUR03-DBA-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdTmy-0006Qc-3i; Fri, 23 Feb 2024 06:32:27 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jB7pAvCFYWN8qqBET2c7R8hdK5aUJHb/kUh9qyoYJEfko+gKodAhK6X1xn3s2ooqHrW4mBDf6/a5SZ9Df4mP6RYX+urbedZJLbl3D8oRt9PiFyBnXp2oVwZf+im0+STHp5gHWArE237XpxWqrjb743eWgxQvUeDNpvnV5UawHiXri4k6m303OVe8ylrYikEFRR/ptLE6DIK5/hKVDM0aDKWCEQzq1SLVWqE9CHVdgSjnDtj6uM/VH84dsPY7ZkfKzEt/nJcrhzIow/uA7/opfTOqqC5HDy+lBBPF95QbIrHM/wWzB1c6Kh252OPgWndHPl2spUm6B25ow7exmmRXIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WTMMxgPmi09rdOwic2KFXVTTRcWl/QOQst4LjT8JGqo=; b=GE9gfpdnAt0H/ECZnxDhvaBGDDpWA3o1rz5beQi0AU+T0q38tRhYwXdNiVblthKua8cafOL1shj5ocwQbGvOY5bdXn10BTO9nB5BXpeTbU4o8nYVl0frmNFqZCDyLJGwgDLhdztkP+O5Xgk57i0HTZzQQ0mQDKkSjK4HiWJfluV40MLjBvI66WKcODxcrI/ABkbJ0mVENq2Ok0yqPEc3ByteKgZyP5W2pIyl5t1XRdJ31tjNmOd9zd9UT3spTU8k950K5VWg57WvHjaUiFA7DrG01RpWZLSXE+W9t7Xv1WBgdSXCkw23hKEx5WKYD0Gy4jpGr2qbY5lgVgx1a6VTFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WTMMxgPmi09rdOwic2KFXVTTRcWl/QOQst4LjT8JGqo=; b=D+X+bYwt8i/kz3aD8sHaXwxOnjCQN/7oHTy+wnl+uuTvoKH2B2waPQDH3LjUOhljVNyf1JGv1bjewqm+V8F0QDK1Fxu8qn8S1qh7jSbha/SdxgSRZSux7BxPKYBMacMIllpIpBUbGa0Tz/zhwKkkBG4K+DZwsiUuv4vtZ00g2TLbNEvmqT2ub19dqncw/ImZzSYE3JfmylLMXpFYOWkFQJYncmhS8U+1n8srHDiUFkUH/j7BIJY61FPTTGRH8lo5ehNo27JBn5DFgCUtX/G4hjLn0W1lr3tL62J0GkQDhM0PCc3faTVmarO6PH0LMvaRxS1P5fhqhgNWGxemQPbJ3Q== Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) by AS8PR02MB8616.eurprd02.prod.outlook.com (2603:10a6:20b:54e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.22; Fri, 23 Feb 2024 11:32:21 +0000 Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com ([fe80::b4ad:e01a:924c:52e]) by DU2PR02MB10109.eurprd02.prod.outlook.com ([fe80::b4ad:e01a:924c:52e%7]) with mapi id 15.20.7316.018; Fri, 23 Feb 2024 11:32:21 +0000 In-Reply-To: <86cysn1tbr.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 23 Feb 2024 03:24:44 -0500") X-TMN: [g5hRTQG3LV7YIWNKMVFPw4p3b5xg9MyR] X-ClientProxiedBy: OS6P279CA0034.NORP279.PROD.OUTLOOK.COM (2603:10a6:e10:32::10) To DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) X-Microsoft-Original-Message-ID: <865xyfza9g.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR02MB10109:EE_|AS8PR02MB8616:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b35e8c3-9932-4c34-d2af-08dc3463195d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4jMr0XiO0CIHPatm1iS6NHIuBadxlVY/yAEOK/ezW/+Uo8yQMMTMTp3CmlPmKsttVZycrIB6Sq90W25W/oI+65X4jdYDA0X6xguGRApu9j2FelnwlreveZD6YNlOu6xrq49pEgGJggjqP5Z2so8heLMZYo4k0fQ2NsyWsb0i+eHu7WrddTovut7BtZU4SoxYbBbuoZKNTBTAhCU7rD9Kyn1cuJz2YuqStsAvPxJxsC0QE3w6bsihDkEzVU2LKfoOkK8mxfujhZahvK0ego4d/xdSLEtHb0WWNuPr20d6TGakLX1SSOwtd8PgThHHl7Q2A3Owj+ZrZ+D8B17KKuQT2iBIMYnht293rDETMotB/Z9AZOwFeaVlsQS1Lf5SeYecgw/4IGxm7+h0NVg9fQvxnmLFfrRScPm4UJn5tqBE+ue8dtI93BBK2i+XHhXbKfxgZaanw/ML5TFcEUYo0uH8/sOAa3wrZcO4dC8plb90xVv63GURihp0p6yVdy59cUmGmb+5/YN0VTYGH2oZt0wwYPdFPZ7KO77DFp/pqObf+u488T5dm/fmwcXGOrVfUqod X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?gfKotUlhwJmF/QZP03HTsQCL/f5V9QC3yCSivSQb4wEHtnToHTp++O1D/ams?= =?us-ascii?Q?2yvFx2uLQIIRfRaA+4NYSoj8QOAP5xymu5w6ZnDdwPC5QcHcqSwFAb0IHcIg?= =?us-ascii?Q?0z1g1KJIJir0y/5gnQRwylo4lR/wJYRpavbC1qOUSYXUF5sm8Otng8fQQ2KD?= =?us-ascii?Q?23rwqVRYkGs0k7VJ2gxuSmmYgm2n+IFwhepkN23XzV3hUnAGNP6p1G1FcODV?= =?us-ascii?Q?W/wepPWvUwahGBKDJ81kX4hlVfJWIgNY2uvCjALFS/4F4KeiLmB9b7Hfx3Am?= =?us-ascii?Q?/q9HGyQypjHgM9t2wtJfHuQA3bueE3mwr7zzQtchEtmERK6VN0kUasKiBNS+?= =?us-ascii?Q?AOSb6LTGTXeUFCaJSsFwY+aQSpWr+N6nJthjl4FjWlLGg9kLDjE8EndmDQUD?= =?us-ascii?Q?18auI5Ucpb6HzLpzYx+VlUzIV/hAT1I8+QO6kM4Lvcgu0jurK8l2zHYW48Fh?= =?us-ascii?Q?a2SHL7rcL8/QqfVuzQMqNM9kRw4zuA9SH5Zr4PuwmA+EUSfx6/SfktSTwwLa?= =?us-ascii?Q?6bK1RIKLdSLTBea0iOf129rX2y8uCS1uhg56SufVD1nxrWSYiC90ZS2lb2ep?= =?us-ascii?Q?m0sxm8gywWGgs0mskIBj97ZhXuTctfB9Xz/UQUhNonSrrG3ssxCmNy5Q1cKK?= =?us-ascii?Q?lu X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-ab7de.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 5b35e8c3-9932-4c34-d2af-08dc3463195d X-MS-Exchange-CrossTenant-AuthSource: DU2PR02MB10109.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2024 11:32:21.5757 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR02MB8616 Received-SPF: pass client-ip=40.92.58.10; envelope-from=arthur.miller@live.com; helo=EUR03-DBA-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 23 Feb 2024 06:59:23 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316464 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Cc: emacs-devel@gnu.org >> Date: Fri, 23 Feb 2024 08:58:43 +0100 >> >> >> +#ifdef _UCRT >> >> +#define _snprintf snprintf >> >> +#endif >> > >> > I don't understand this change. Are you saying UCRT doesn't provide >> > _snprintf? If so, why is the above needed only in cmdproxy? w32*.c >> >> As mingw ucrt patch mentions; MS ucrt provides snprintf so mingw does not >> provide one in ucrt. > > Sorry, I don't understand what you mean by that. MinGW only provides > some stuff that the MS libraries lack, so by "UCRT doesn't provide > _snprintf" I meant that the combination of MS ucrt and the MinGW > additions in UCRT mode doesn't provide _snprintf. I meant they explained that in mingw runtime, msys/mingw provides their own implementation of snprintf, while in ucrt runtime it comes from Microsoft. If I remember well from the time I uset to write some win32 code, Microsoft used to prefix all posix functions with and underscore, so snprintf turned into _snprintf. Perhaps mingw just followed that convention by Microsoft. And now in ucrt Microsoft don't underscore posix names? No idea really; just guessing. I am not familiar with how msys/mingw folks do their patches and what is included and what not. >> I don't know why is it needed only there. From my original attemt, the linker >> missed reference to _snprintf only for cmdproxy, so I guess it is linked with >> the wrong library. I have looked at the Makefiles in nt directory, but as far as >> I understand linker flags comes from some included makefile (LDFLAGS=@ldflags@), >> so perhaps they have somehow wrong library elsewhere. > > If you say "make V=1", you will see the complete compilation and link > commands, including any libraries that we are linking into the > executables. If you spot some library that is present for temacs.exe, > but not for cmdproxy.exe, we can add that missing library to the link > command, or at least understand the nature of the problem and devise > some solution. MinGW should come with a tool that allows you to see > what functions are exported by a DLL, so if you find which libraries > are not linked into cmdproxy, you could look at those libraries and > see which one of them, if any, provides _snprintf. Can you please try > that and report the results? ok. >> Yes, I agree, it is all about close_stream. Seems like it is all the same error: >> -1 (unspecified error). You can see the test from the patch. >> >> I haven't seen the code for close_stream or msys patches; I will have to >> download and look at it; but it sounds plausible as you said that they probably >> don't clean up errno. > > The source fore close_stream is in the lib/ subdirectory of the Emacs > source tree, so you should already have it. Ah, I see. Thanks I'll look there.