From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.comp.lib.gnulib.bugs,gmane.emacs.devel Subject: Re: Emacs build fails on Windows mingw64 Date: Sun, 24 Oct 2021 11:50:06 +0100 Message-ID: <86r1cag0ip.fsf@gmail.com> References: <86v91nfp6e.fsf@gmail.com> <0b467abe-dd50-6a0a-7d1f-37eb990900be@cs.ucla.edu> <83ee8b3pme.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="940"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt) Cc: emacs-devel@gnu.org To: bug-gnulib@gnu.org Cancel-Lock: sha1:s7YRGF73LGOg22oeR0ReNq3z0TY= Original-X-From: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Sun Oct 24 12:51:08 2021 Return-path: Envelope-to: gnu-bug-gnulib@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 1meb5o-000AXY-Bj for gnu-bug-gnulib@m.gmane-mx.org; Sun, 24 Oct 2021 12:51:08 +0200 Original-Received: from localhost ([::1]:45894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meb5n-0003D0-AO for gnu-bug-gnulib@m.gmane-mx.org; Sun, 24 Oct 2021 06:51:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meb5H-0002su-0b for bug-gnulib@gnu.org; Sun, 24 Oct 2021 06:50:36 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:45446) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meb5F-0003xU-Hf for bug-gnulib@gnu.org; Sun, 24 Oct 2021 06:50:34 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1meb5B-0009o7-9M for bug-gnulib@gnu.org; Sun, 24 Oct 2021 12:50:29 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=gnu-bug-gnulib@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnulib" Xref: news.gmane.io gmane.comp.lib.gnulib.bugs:45175 gmane.emacs.devel:277645 Archived-At: On Sun 24 Oct 2021, Eli Zaretskii wrote: >> From: Paul Eggert >> Date: Sat, 23 Oct 2021 23:45:04 -0400 >> Cc: bug-gnulib@gnu.org, emacs-devel@gnu.org >> >> On 10/23/21 4:42 PM, Andy Moreton wrote: >> > Can this issue be addressed in gnulib so the emacs bug can be fixed ? >> >> This appears to be an issue in Emacs not Gnulib, as a few of Emacs's >> MS-Windows-specific files don't include first, which is a >> documented requirement for Gnulib-using apps. Proposed Emacs patch >> attached. I haven't tested or installed this, as I don't use MingW. > > This solution cannot be used, because ntlib cannot include config.h, > due to various redefinitions and redirections we do in ms-w32.h for > Emacs. (We could redesign these tricks, but that's a lot of tedium, > and cannot be done on the release branch anyway.) An alternative workaround in ntlib.c is to add the missing defines before including : #define _GL_ATTRIBUTE_MALLOC #define _GL_ATTRIBUTE_DEALLOC_FREE That bootstraps on emacs-28. > Let me turn the table and ask why that declaration of strdup is at all > needed in Gnulib's string.h when it's used in MinGW builds? strdup is > available natively in the MS C runtime, and its prototype is already > in the system's string.h header. I'm aware that Gnulib has strdup.c, > but we don't currently use it in Emacs, and even if we will at some > point, we won't use it in the MinGW build. So how about ifdef-ing > that declaration away for MinGW in the Gnulib header? That would be less likely to need further atention each time that emacs is updated to import updated gnulib files. AndyM