From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Li=C4=81u@debbugs.gnu.org, _?= =?UTF-8?Q?Kiong-G=C4=93_?= =?UTF-8?Q?=E5=BB=96=E5=AE=AE=E6=AF=85?= 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 13:40:22 -0600 Message-ID: References: <838s9w6t8d.fsf@gnu.org> <83v9cz5c9z.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14857"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 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 20:41:17 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 1kqLcq-0003ja-M4 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 20:41:16 +0100 Original-Received: from localhost ([::1]:36180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqLcp-0003nx-NS for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 14:41:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqLcc-0003mt-Mo for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 14:41:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56696) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kqLcc-0002Uk-Fc for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 14:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kqLcc-0002NM-E8 for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 14:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Li=C4=81u@debbugs.gnu.org, _?= =?UTF-8?Q?Kiong-G=C4=93_?= =?UTF-8?Q?=E5=BB=96=E5=AE=AE=E6=AF=85?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Dec 2020 19:41: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.16083204439077 (code B ref 45303); Fri, 18 Dec 2020 19:41:02 +0000 Original-Received: (at 45303) by debbugs.gnu.org; 18 Dec 2020 19:40:43 +0000 Original-Received: from localhost ([127.0.0.1]:40005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqLcJ-0002MK-BG for submit@debbugs.gnu.org; Fri, 18 Dec 2020 14:40:43 -0500 Original-Received: from mail-ed1-f49.google.com ([209.85.208.49]:33325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqLcH-0002M5-SD for 45303@debbugs.gnu.org; Fri, 18 Dec 2020 14:40:42 -0500 Original-Received: by mail-ed1-f49.google.com with SMTP id j16so3562344edr.0 for <45303@debbugs.gnu.org>; Fri, 18 Dec 2020 11:40:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7xB2QpgwLJcyaiPOLNspplGOH1mCCjx7nAayDVGEWp4=; b=f0x3TyyC3Eg6WFfiXue+1O1mMSpYq0ItRAB0g+w9kGXhWfcbWak9LqMV8C49RAmAah wLV+jxvYR2YrOyLjUFJCw3jXznLo17qxiN1cvG89qeF1gOWcjeIcUdos5mFZHjvZ7lrE ipJlRubjLFWeGmrPq25oDTjbzWpWTgKvBd2aav1P5g20S4hGXfReW/xo21vvCAeP2NGl r44bQaQQVxe5ScK+r5kgkMPlVbLsiJVYgXB+KAotdvc26HwwNJoddTfgPhOMdx8kSPKg 9nMDNLPg9QwiS6MMMoKtcSJuk8J8uNJxCKxiFoKw9H4n70g/NTSs6CT/stJM2TFCAXlg w5Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7xB2QpgwLJcyaiPOLNspplGOH1mCCjx7nAayDVGEWp4=; b=O8tH5qfILT+ndfDTkWRKYzJlVMFVZNPUCIrsvLpVWE2dhX9zUo6eVER0u1rjLNhKka 3VbKH4Yyf6hCnmzFE9fikvyCfHAR8Y+eHfP7YFroFLtn28gJl0/MMQ9T/68uYvAu4Bq6 BbUdT9rwPpnnCwsOQC9QioJxzSPpDLsqIN8hPPqFH49JBh72lVv3Ndna9VLhXX9nrO8s 0Z3AqAFuT1cm2+guIZrK8szdCezDtWz76tlX2VigNMreRh8aeHWD5xU3i5m3brx5e0aa G2nzmktasa/3yGDSteL8q0XgeGgUG7igGk4USjmQ59KvfeW/S6s1YCSs0mcNFP6uzVZl LaAQ== X-Gm-Message-State: AOAM531kWeGKrbfKXLVxq1fF5wwjsou2MdT6LHeZ+qvcfrlST0FnFxME PZbiViHMGWDFhhslhNhqswQxMlF2f3WU/NLPPdk= X-Google-Smtp-Source: ABdhPJyXuYKMAlTAyusr+JLGyCZqmcSLQzESImmRr4WpRLNx7llWAgw+7FX1eC+0VJCMhzd++unLlgEKroEeDczY7kM= X-Received: by 2002:a50:f61b:: with SMTP id c27mr5973735edn.61.1608320435995; Fri, 18 Dec 2020 11:40:35 -0800 (PST) In-Reply-To: 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:196346 Archived-At: By changing src/Makefile's temacs target to: temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(EMACSRES) \ $(charsets) $(charscript) $(MAKE_PDUMPER_FINGERPRINT) $(AM_V_CCLD)$(CC) -o $@.tmp \ $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \ $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES) \ -lgccjit -lz Now the temacs is successfully generated, however, at ELC+ELN step of macroexpand.el, temacs just crashed: make[2]: Entering directory '/home/VWinUser0/Downloads/emacs/native-comp/build/lisp' ELC+ELN ../../src/lisp/emacs-lisp/macroexp.elc Backtrace: 00000004001adbe2 00000004000b40a6 00000004000ccc64 000000040020581a 00007ffeba377ff0 00007ffebb9910f7 00007ffebb93b46c 00007ffebb98fc26 make[2]: *** [Makefile:319: ../../src/lisp/emacs-lisp/macroexp.elc] Error 255 make[2]: Leaving directory '/home/VWinUser0/Downloads/emacs/native-comp/build/lisp' make[1]: *** [Makefile:833: bootstrap-emacs.pdmp] Error 2 make[1]: Leaving directory '/home/VWinUser0/Downloads/emacs/native-comp/build/src' make: *** [Makefile:434: src] Error 2 Such a problem does not occur on Linux or FreeBSD. Thanks, Kiong-Ge. On Fri, Dec 18, 2020 at 10:37 AM Andrea Corallo wrote: > > 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. > > > 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.