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: Sun, 25 Feb 2024 12:40:56 +0100 Message-ID: References: <864je1m0mn.fsf@gnu.org> <86cysn1tbr.fsf@gnu.org> <86bk871j90.fsf@gnu.org> <86bk86yxbs.fsf@gnu.org> <86edd1xdcj.fsf@gnu.org> <8634tgyg2z.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="8106"; 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 Sun Feb 25 14:12:27 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 1reEIt-0001wi-21 for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Feb 2024 14:12:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reEI8-0006dR-TA; Sun, 25 Feb 2024 08:11:41 -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 1reCsP-00056s-Tk for emacs-devel@gnu.org; Sun, 25 Feb 2024 06:41:01 -0500 Original-Received: from mail-vi1eur05olkn2059.outbound.protection.outlook.com ([40.92.90.59] helo=EUR05-VI1-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 1reCsN-0000Nj-OA; Sun, 25 Feb 2024 06:41:01 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hhmt0i17Sv/hd029HqSP090oAaHuOaO3pOnncHm3FLYj2/ETOgs53JACOnFhxQ4sS/Rl58HOhkDBHLb/m5sCttMi3AIEQZ5diVYgJ0pSAFz2PGbh0ybRhenhCgK8zH/YhYeZz1H1k//ctZGHbnfSHjbSuPbg9IX/p4KznQwZWkEW2OLdL5J6vOhoKP3NIaATOV/oXecLc88keonXdP2VOi7hoJyfW31FNVL25t3gCbtvKs6DbXZel5E498a4wdIt7TCdqB8H6L2Hb9aQSEUNIbegJoEmC+t2rQrlsgxdltpLrO+lp/y6DfJJOroWcb4gpFKasLHTPUA0xQlq/jf2eQ== 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=5BynxKq6d05rqtBQNXVWp/TQwcinDtQ2ce7J5twoesU=; b=OgPcNZrTbqIA4uj9+hb+g1iclzpIzZsR10KsXnamnr1IC8WbTnGUathvHKu2zlX+nkjTJX3KrqNnMvXCSVFQ5uIZXB23E4mZdp7Q0Ub9Yp1rMVCg8kI3rIdj2zf+Z8b7tG1M7bnW76H7TGpnyHNgXf6q9xQsJhBWK3xNgOrbFM4SkOTvLBFdzP+PHUHpal09ttZ9t2/5AjOCq48z3JrPF8qtz8It1y+j3mvNDOycbmk7SiQ2XdFehHy9A9yIwvf4Zl92uFgcMSUkJKXIP83BouVUqp9FI1Kik0AeqMbZODnfSMQaQ7EH5ttkLGTmX407Sg5jPs7qaGy+/sX41ZLtxw== 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=5BynxKq6d05rqtBQNXVWp/TQwcinDtQ2ce7J5twoesU=; b=RSLVaVaHMwbmGxC2Zxta43yTtyDGxSGtLh10+Fa3NScWGqGSGQxSmvZMS58CUmgW9OcsosMLei9TnItLuXFHZaZw7h04XPXtp1LudL5MDnqTn1AHvvuBQNrcbprpFnP9zCFDxxH1bSz3Abt27glRvbywsIy0KtoiOCo1QmcJ0qYYH4nFOqeGsYkSUJnpX6agcyYhpggCNH1Dmxd7RlVDZns2KAmm1zDMnhxZaP7NgsL2K7cD21JRoPPjd+3mEfNcUW3AD2XUDR9Hmw4skrP0JHSOoEPMw2yjEyuHdOYxdb7CQNdcUZ/81bCI/vRwVpduDLm/nrv91imLEsyNugf2SQ== Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) by AS2PR02MB8839.eurprd02.prod.outlook.com (2603:10a6:20b:553::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.33; Sun, 25 Feb 2024 11:40:54 +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.023; Sun, 25 Feb 2024 11:40:54 +0000 In-Reply-To: <8634tgyg2z.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 25 Feb 2024 05:48:57 -0500") X-TMN: [rcXAmI6dKt0caAkDmnIbVgugpzqC1wYr] X-ClientProxiedBy: OS6P279CA0119.NORP279.PROD.OUTLOOK.COM (2603:10a6:e10:3c::20) To DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) X-Microsoft-Original-Message-ID: <86il2cvkjb.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR02MB10109:EE_|AS2PR02MB8839:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ab95cab-413f-4102-8419-08dc35f69fff X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aSfG0Tb3qasTkiulfKfRsypyfVclT+6WpyRtwrzeEFWYcuamJdVxMPB4fzJ9bZCuEgXaU8hhl9CM5nOWlYc9bS4qu37h4aNgeeb4fk98uZ07QqlsXqAaqHcUjquwD/psaZDe9gb6MEdZsBDMeDxeoeubwyLzbpX92ydSar8kLsiMji4oC5CFm+sPJint46GRrdYNVvkcDvI7n10DPJEUGxTsfgvvjfWHitYYenc17wfX4pz3XByaaQFWh/H3r88SlHke5l0gpOUdMnksO1Da///YND4MmH1OejWwETa09zh60drW7+Z0wLxh8q2yB2dvli6nq6pFnHAwEqdA/pZMXT2b5PIVq4d4uFiAvFPncVXhaom/aCJZs52Tp/h4JIswVJ3igyVgR3pRuCOh+hbZJDjPYU4u46excY+orXrS5lamzYGPEGYoGB/OusGFHteWut9MlUvKLmTNI48sP30g/V17gmIm+8U6Hq6m6svI0qIMxbhGppbx6klWWpOLUY8m+ABTaN8QmNk5mu1DUjU0erQLPGrS43q6HufALiM5Ga/L+5OwZWpek4jPXJAmlzyq X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?t86M96JtOgnlCf8kYkRX3EfT1mrx0Gw9D+AMlLyNtl/5YmoewTqYXm7fGyaf?= =?us-ascii?Q?pr8Rw749OQ1XHmbgwZ68kJcrAYUsotw22X6cLKhD6kiXEOHH1btCaIoGrJgm?= =?us-ascii?Q?1Hdc5ZIqUHtuyo9fcaEtdkez1aufDKr81og4/3AkYsvEyaH5irRWgDzca7/h?= =?us-ascii?Q?3Lj+uHN7Q1BuJ9ye/HAog/i/93v1Yb6YhQplF6oKfSB6pHiXEhDEr3mUmyvd?= =?us-ascii?Q?tLuY032wYKJ9I5FW6n5jZTbgEPgcq80umiJ3x29PzqW3Lu/56Bu/MjPHmj/f?= =?us-ascii?Q?CvIqPm7iL4gmat4vqIRir5puv3+noHxgU5h2pPzQsj+kb6gKpqXBb9G/Cu98?= =?us-ascii?Q?vvJ3188sgGKIZjyWqlxVHjZXzV+PqV21W4yYt+LEEcRAsKTLl4rJ0Mk2WrE4?= =?us-ascii?Q?3qHd7zTPjBHj1CwYU63j4N/mWnK+kaVoWKIkJ8Y9TKU6O8N8V/UJSXekfCOg?= =?us-ascii?Q?bGN5MQBMiyz9AQMSv5I+C1U0a06ZQEtWHuwZAwAl3cfwXV1XyVbqBEF+BYPX?= =?us-ascii?Q?kXaKHXARO9PQfJBxFw/CJBraV/Z8A6EOcip+g6yFsUKcamD9db+g1XFzfVAb?= =?us-ascii?Q?AlhqgHDUhl5IdexMfv6xrBbZ3OdOLz0Ggb6ZqIZt5QfmvI3xtHUPKFUmujTK?= =?us-ascii?Q?Pr X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-ab7de.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 1ab95cab-413f-4102-8419-08dc35f69fff X-MS-Exchange-CrossTenant-AuthSource: DU2PR02MB10109.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2024 11:40:54.5443 (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: AS2PR02MB8839 Received-SPF: pass client-ip=40.92.90.59; envelope-from=arthur.miller@live.com; helo=EUR05-VI1-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_PASS=-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: Sun, 25 Feb 2024 08:11:37 -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:316516 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Cc: emacs-devel@gnu.org >> Date: Sun, 25 Feb 2024 11:19:58 +0100 >> >> Eli Zaretskii writes: >> >> >> > const bool some_pending = (__fpending (stream) != 0); >> >> > const bool prev_fail = (ferror (stream) != 0); >> >> > const bool fclose_fail = (fclose (stream) != 0); >> >> >> >> prev_fail sometimes fail with Operation not permitted. >> >> fclose fails always with -1 >> > >> > What is the value of errno before and after fclose, in particular when >> > ferror does NOT fail (i.e. prev_fail is false)? >> >> fclose *always* fail with -1. All calls to fclose are -1. I don't see any call >> to fclose that does not return -1. Both when prev_fails is EPERM and when >> prev_fail does not fail. > > OK, but I asked also about the value of errno _after_ fclose is called > and fails. It's important for understanding why it fails. You got the ansewr: -1; always after fclose :). It seem to never succeed. c:\Users\arthu\repos\emsrc\ucrt-0225\src\emacs.exe: FPENDING:: No error c:\Users\arthu\repos\emsrc\ucrt-0225\src\emacs.exe: PREV-FAIL:: No error c:\Users\arthu\repos\emsrc\ucrt-0225\src\emacs.exe: FCLOSE:: Unidentified error: -1 c:\Users\arthu\repos\emsrc\ucrt-0225\src\emacs.exe: Write error to standard output: Unidentified error: -1 c:\Users\arthu\repos\emsrc\ucrt-0225\src\emacs.exe: FPENDING:: No error c:\Users\arthu\repos\emsrc\ucrt-0225\src\emacs.exe: PREV-FAIL:: Operation not permitted c:\Users\arthu\repos\emsrc\ucrt-0225\src\emacs.exe: FCLOSE:: Unidentified error: -1 c:\Users\arthu\repos\emsrc\ucrt-0225\src\emacs.exe: Write error to standard output: Unidentified error: -1 Compilation finished. I did this little abomination: #include int close_stream (FILE *stream) { /* const int some_pending = (__fpending (stream) != 0); */ /* const int prev_fail = (ferror (stream) != 0); */ /* const int fclose_fail = (fclose (stream) != 0); */ const int some_pending = __fpending (stream); emacs_perror ("FPENDING:"); const int prev_fail = ferror (stream); emacs_perror ("FPREV:"); const int fclose_fail = fclose (stream); emacs_perror ("FCLOSE:"); /* Return an error indication if there was a previous failure or if fclose failed, with one exception: ignore an fclose failure if there was no previous error, no data remains to be flushed, and fclose failed with EBADF. That can happen when a program like cp is invoked like this 'cp a b >&-' (i.e., with standard output closed) and doesn't generate any output (hence no previous error and nothing to be flushed). */ if (prev_fail || (fclose_fail && (some_pending || errno != EBADF))) { if (! fclose_fail) errno = 0; return EOF; } return 0; } (moved it to sysdep.c) Everytime native compiler compiles a file, and Emacs exits I get this, so I guess it is from closing the process? So it perhaps has nothing to do with snprintf at all? >> I understand; thanks. I guess I should learn nm tool. >> >> Which one shold be correct than: should sydep.c use stuff from ucrt dll; or >> should it use the built-in stuff? > > Sorry, I don't understand: what about sysdep.c? If you are talking > about close_output_streams, then we are not done yet investigating why I meant in general; should temacs/emacs also use snprintf/_vsnprintf from ucrt runtime or one that comes with Emacs/gnulib? > close_stream fails in the UCRT build. When we understand what happens > there, we can revisit the close_output_streams issue and decide how to > handle it. >> By the way, a slight regression: since cmdproxy includes its own >> windows.h; it does not hurt to add _win32_lean_and_mean above too? > > Maybe, but why bother? >> > You can use -jN, and that speeds up the compilation quite a lot. On >> > my system I use -j16, and I can bootstrap Emacs in under 4 min. >> >> Ha! :-) >> >> $ time make bootstrap -j12 >> >> real 12m40.651s >> user 2m46.900s >> sys 1m19.613s > > Well, you have 1/3rd of execution units I have, so 12 min is > reasonable, especially if this is with native-compilation. So what are you saying: that thes "efficient cores" as intel sells them are just paperweight? :-) Basically it is a dual-core machine than? I think my old haswell i7 I have in my desktop is also much faster, but I am not at home now, so I can't measure it.