From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#45303: #45303 [feature/native-comp] building error on Windows Date: Fri, 18 Dec 2020 16:02:20 +0000 Message-ID: References: Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35836"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 45303@debbugs.gnu.org To: Pal Gloss Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 18 17:03:30 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 1kqIE5-00098N-WE for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 17:03:30 +0100 Original-Received: from localhost ([::1]:42504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqIE4-0001o1-UA for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 11:03:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqIDf-0001n6-K6 for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 11:03:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56400) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kqIDe-000628-EB for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 11:03:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kqIDe-0005SR-5e for bug-gnu-emacs@gnu.org; Fri, 18 Dec 2020 11:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Dec 2020 16:03: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.160830734720933 (code B ref 45303); Fri, 18 Dec 2020 16:03:02 +0000 Original-Received: (at 45303) by debbugs.gnu.org; 18 Dec 2020 16:02:27 +0000 Original-Received: from localhost ([127.0.0.1]:39713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqID3-0005RX-J2 for submit@debbugs.gnu.org; Fri, 18 Dec 2020 11:02:27 -0500 Original-Received: from mab.sdf.org ([205.166.94.33]:58404 helo=ma.sdf.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqID0-0005RN-DY for 45303@debbugs.gnu.org; Fri, 18 Dec 2020 11:02:24 -0500 Original-Received: from akrl by ma.sdf.org with local (Exim 4.92) (envelope-from ) id 1kqICy-0006Z6-Da; Fri, 18 Dec 2020 16:02:20 +0000 In-Reply-To: (Pal Gloss's message of "Fri, 18 Dec 2020 12:13:40 +0100") 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:196335 Archived-At: Pal Gloss writes: > Hi, Hi Pal, > Just in case this helps (sorry I did not have time to split up this into separate bug reports, but it will help [I hope] > fix the problems encountered): here are the notes/hacks/command lines I used to build a recent gccemacs on my Win10 > machine with mingw64: good to know is working even if with some hacking on it ;) > #+begin_src shell :exports code > git rev-parse HEAD feature/native-comp > #+end_src > : 682bd303470d4a0fcd2690aff6aa58fb720a8d41 > : 682bd303470d4a0fcd2690aff6aa58fb720a8d41 > > #+begin_src shell :exports code > pacman -S --needed base-devel \ > mingw-w64-x86_64-toolchain \ > mingw-w64-x86_64-xpm-nox \ > mingw-w64-x86_64-libtiff \ > mingw-w64-x86_64-giflib \ > mingw-w64-x86_64-libpng \ > mingw-w64-x86_64-libjpeg-turbo \ > mingw-w64-x86_64-librsvg \ > mingw-w64-x86_64-lcms2 \ > mingw-w64-x86_64-jansson \ > mingw-w64-x86_64-libxml2 \ > mingw-w64-x86_64-gnutls \ > mingw-w64-x86_64-zlib \ > mingw-w64-x86_64-harfbuzz \ > mingw-w64-x86_64-libgccjit > PROCESSORS_TO_USE="3" > EMACS_VERSION=emacs-native-comp > ./autogen.sh > # edit nt/epaths.nt to add PATH_REL_LOADSEARCH: > grep -q PATH_REL_LOADSEARCH nt/epaths.nt || echo '#define PATH_REL_LOADSEARCH ""' >> nt/epaths.nt This should be fixed by yesterday commits > # patch to look for libgccjit-0.dll instead of libgcc.dll? lisp/term/w32-win.el & src/emacs.c > sed -i -e 's/libgccjit.dll/libgccjit-0.dll/' lisp/term/w32-win.el > sed -i -e 's/libgccjit.dll/libgccjit-0.dll/' src/emacs.c I've really no windows knowledge to judge that, perhaps Eli will comment. If these are correct fixes you should submit a patch for those. > # patch to avoid gcc_jit_global_set_initializer (crashes on my machine...; it > # seems there is an interaction with the #pragma and the rest of the parsing > # because the statement is incomplete?) and to adapt to (new) 5th parameter to > # directory-files > sed -i -e '/if (gcc_jit_global_set_initializer)/,/{/ { > /#pragma GCC diagnostic pop/d > /{/a #pragma GCC diagnostic pop > }' \ > -e '/internal_condition_case_4/,/FOR_EACH/ { > s/internal_condition_case_4/internal_condition_case_5/ > s/Qt, return_nil);/Qnil, Qt, return_nil);/ > }' \ > src/comp.c which gcc version are you using? > sed -i -e '/extern Lisp_Object internal_condition_case_4/a extern Lisp_Object internal_condition_case_5 (Lisp_Object > (*) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object, > Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object));' src/lisp.h > sed -i -e '/Like internal_condition_case_1 but call BFUN with ARG1, ARG2, ARG3, ARG4 as/ { > s/ARG4 as/ARG4, ARG5 as/ > a its arguments. */ > a Lisp_Object > a internal_condition_case_5 (Lisp_Object (*bfun) (Lisp_Object, Lisp_Object, > a Lisp_Object, Lisp_Object, > a Lisp_Object), > a Lisp_Object arg1, Lisp_Object arg2, > a Lisp_Object arg3, Lisp_Object arg4, > a Lisp_Object arg5, > a Lisp_Object handlers, > a Lisp_Object (*hfun) (Lisp_Object)) > a { > a struct handler *c = push_handler (handlers, CONDITION_CASE); > a if (sys_setjmp (c->jmp)) > a { > a Lisp_Object val = handlerlist->val; > a clobbered_eassert (handlerlist == c); > a handlerlist = handlerlist->next; > a return hfun (val); > a } > a else > a { > a Lisp_Object val = bfun (arg1, arg2, arg3, arg4, arg5); > a eassert (handlerlist == c); > a handlerlist = c->next; > a return val; > a } > a } > a /* Like internal_condition_case_1 but call BFUN with ARG1, ARG2, ARG3, ARG4 as > }' src/eval.c > sed -i -e '/PATH_EXEC, 0);/ { > s/.*/#ifdef WINDOWSNT/ > a /* On MS-Windows, PATH_EXEC normally starts with a literal > a "%emacs_dir%", so it will never work without some tweaking. */ > a w32_relocate (PATH_EXEC), > a #else > a PATH_EXEC, > a #endif > a 0); > }' src/callproc.c > mkdir -p ../build > cd ../build > ../emacs/configure \ > --with-xml2 \ > --without-pop \ > --prefix="/home/cramaph1/$EMACS_VERSION/dest" \ > --without-compress-install \ > --without-dbus \ > --with-nativecomp \ > --with-modules 'CFLAGS=-O2 -g3' 'LIBGCCJIT=-lz -lgccjit' > sed -i -e 's/^LIBGCCJIT = *$/LIBGCCJIT = -lz -lgccjit/' src/Makefile > make -j"$PROCESSORS_TO_USE" > make install > #+end_src Andrea