From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#45303: 28.0.50; [feature/native-comp] comp.c compilation error on Windows 10 Date: Fri, 18 Dec 2020 22:49:25 +0200 Message-ID: <83r1nm6dre.fsf@gnu.org> References: <838s9w6t8d.fsf@gnu.org> <83v9cz5c9z.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36866"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gongyi.liao@gmail.com, 45303@debbugs.gnu.org To: Andrea Corallo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 18 21:50:16 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kqMhc-0009UW-8m for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 21:50:16 +0100 Original-Received: from localhost ([::1]:46138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqMhb-0006sy-8k for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 15:50:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqMhO-0006sl-UA for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 15:50:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56811) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kqMhO-0001Tw-Lx for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 15:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kqMhO-0006Dn-IU for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 15:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Dec 2020 20:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45303 X-GNU-PR-Package: emacs Original-Received: via spool by 45303-submit@debbugs.gnu.org id=B45303.160832457123873 (code B ref 45303); Fri, 18 Dec 2020 20:50:02 +0000 Original-Received: (at 45303) by debbugs.gnu.org; 18 Dec 2020 20:49:31 +0000 Original-Received: from localhost ([127.0.0.1]:40124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqMgs-0006Cy-Sp for submit@debbugs.gnu.org; Fri, 18 Dec 2020 15:49:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33164) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqMgq-0006Cm-SN for 45303@debbugs.gnu.org; Fri, 18 Dec 2020 15:49:29 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40370) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqMgl-0001H9-FZ; Fri, 18 Dec 2020 15:49:23 -0500 Original-Received: from [176.228.60.248] (port=4753 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kqMgk-0003ux-Rw; Fri, 18 Dec 2020 15:49:23 -0500 In-Reply-To: (message from Andrea Corallo on Fri, 18 Dec 2020 16:37:31 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:196348 Archived-At: > From: Andrea Corallo > Cc: 45303@debbugs.gnu.org, gongyi.liao@gmail.com, > =?UTF-8?Q?Li=C4=81u@debbugs.gnu.org > Date: Fri, 18 Dec 2020 16:37:31 +0000 > > Eli Zaretskii writes: > > >> Date: Fri, 18 Dec 2020 13:28:20 +0000 > >> Cc: gongyi.liao@gmail.com, =?UTF-8?Q?Li=C4=81u@debbugs.gnu.org > >> From: Andrea Corallo via "Bug reports for GNU Emacs, > >> the Swiss army knife of text editors" > >> > >> >> CCLD temacs.exe > >> >> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: > >> >> comp.o: in function `md5_gz_stream': > >> >> C:\msys64\home\VWinUser0\Downloads\emacs\native-comp\build\src/../../src/src/comp.c:713: > >> >> undefined reference to `inflateInit2_' > >> >> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: > >> >> C:\msys64\home\VWinUser0\Downloads\emacs\native-comp\build\src/../../src/src/comp.c:730: > >> >> undefined reference to `inflate' > >> > > >> > That's curious, looks you've not zlib but from the config.log you do... > >> > >> I really would like to understand what's going on here. > >> > >> We check in configure for zlib presence, actually this is also require > >> by --with-nativecomp but somehow the linker fails to find it. > > > > Why does the native-comp branch require zlib in comp.c? what does it > > do with zlib? > > We hash the content of the lisp source files to obtain the correspondent > eln name in the eln-cache. > > This machinery has to work since early bootstrap (and has to be fast > since is executed at each file load), so is directly done from comp.c. > > When Emacs is installed the el files are compressed and so before > hashing them we have to decompress therefore we use zlib. Thanks for the explanations. > > On master, zlib is an optional library, and when some Emacs command is > > invoked that needs it, on MS-Windows we load the zlib DLL at run time > > when requested. See init_zlib_functions in decompress.c. This is > > unlike on Posix systems, where Emacs is linked with zlib at link time. > > Does this explain what is going on? > > I see, we should probably have comp.c use the necessary DEF_DLL_FN bloat > or have these functions wrapped in decompress.c. I think it's better to use functions in decompress.c or add whatever you need there, and have the new functions use the same paradigm, which on Windows loads the DLL the first time it is needed.