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:35:02 -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="33997"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45303@debbugs.gnu.org, =?UTF-8?Q?Li=C4=81u@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:36:14 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 1kqLXy-0008jx-89 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 20:36:14 +0100 Original-Received: from localhost ([::1]:32828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqLXx-00029C-8i for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 14:36:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqLXn-00024t-7K for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 14:36:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56642) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kqLXm-0000iw-CK for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 14:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kqLXm-0002Dq-9u for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 14:36: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:36: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.16083201268480 (code B ref 45303); Fri, 18 Dec 2020 19:36:02 +0000 Original-Received: (at 45303) by debbugs.gnu.org; 18 Dec 2020 19:35:26 +0000 Original-Received: from localhost ([127.0.0.1]:39951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqLXC-0002Ci-Ep for submit@debbugs.gnu.org; Fri, 18 Dec 2020 14:35:26 -0500 Original-Received: from mail-ej1-f48.google.com ([209.85.218.48]:46572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqLX6-0002CO-Fe for 45303@debbugs.gnu.org; Fri, 18 Dec 2020 14:35:25 -0500 Original-Received: by mail-ej1-f48.google.com with SMTP id j22so4804461eja.13; Fri, 18 Dec 2020 11:35:20 -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=cBo3zG+TBRVEwy/TmUmyR8F8i/KmozXnWGm//r5TwW41dNM2kaiJfS9i60reOhkUDp seH5foZdQKKNbKAFBch9GRIGVTyPNUzijMm5cQ0AOh4Su6mfVZ9ISl1cKdthkZBtqV9x lAmjQsceMFGVPU/mwFQMIjeLi40HIi1G/9mUJdzttqmKm2YJ203B3mhHUb6Bb/nBQMuV v3HjMD/D6zlMEhaCZSAeztqcQ+qGo3yI61aGBBMCwZk4IBQJ8WFomXEn8eJGmPXZEE81 IUEz1PlQ2xPXaQmdE6eF5GLttTq2Ij1yVo4gAIp15YofW/l8UDl0OJF2iGNCSmrSS2ZE 8bvQ== 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=l1Iq5Ha6kvl9IRYEq93hPPF+nh1ahcYzLZdbakLfma4QaVtbbl7U3Z2+Pcd8g2WVOj iVj3W3OVZ5rz4jh3WHDo7ZTFQtGcfnnU6X2gkEgKSsF/FFjP6mx7Hn3Lx4ukGp2D8bSl 7Y8d/XBpCrFQgr6RFfoMCQBeURZtv0YFpyaFyZLiF2Cow2aZ8RTFnKlbIU94xNQhIeCR L2AeXLgAi4GKk8DbcM1w3o73y7Zv4pw8BFIykNwwYowHBosGsl6Xxj3Xd4pvalVNi+Zd LPszB2xKXHcDHbmJyziNOsXoLrLb9RvMq2E3fwdzhc+FqfafCfPJlOf01BAO1T77geH3 xqDw== X-Gm-Message-State: AOAM533UC0CU/zEazuUXNUPQIbsuQ2OzqSx6fOqTB4TdNy3PWenBQ+Xp g+0kxTGshVKpxj2EmH4X/wE1JBk/uxV+ad/H7yM= X-Google-Smtp-Source: ABdhPJz6JKOSZGegF6olfhVBquzeEs6t0ZnSaGYGEQH+RXuzvT+kI43R39lkLmLJjmaDPWhORbQf97vXDVaJL2amYz0= X-Received: by 2002:a17:906:adcb:: with SMTP id lb11mr5474776ejb.346.1608320114622; Fri, 18 Dec 2020 11:35:14 -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:196345 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.