unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Nicolas Bértolo" <nicolasbertolo@gmail.com>,
	"Andrea Corallo" <akrl@sdf.org>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] [WIP] Port feature/native-comp to Windows.
Date: Sat, 09 May 2020 18:48:40 +0300	[thread overview]
Message-ID: <83wo5lds87.fsf@gnu.org> (raw)
In-Reply-To: <CAFnS-O=AAuEkA8o+Kf3KXJ1FRQDX6OzoO_P0fLCvUaOUcw3UNw@mail.gmail.com> (message from Nicolas Bértolo on Sat, 9 May 2020 12:28:29 -0300)

> From: Nicolas Bértolo <nicolasbertolo@gmail.com>
> Date: Sat, 9 May 2020 12:28:29 -0300
> Cc: emacs-devel@gnu.org
> 
> > Also, did you try compiling the modified code with the 32-bit MinGW64
> > compiler?
> 
> I haven't tried to compile it with the 32-bit compiler.

This could have issues with setjmp, I think.

> There are many ways to call setjmp() in Windows. It depends on the architecture,
> whether the Universal CRT is used, whether SEH is enabled, the compiler version,
> etc.

Yes, I know.  But we need to support only the way we compile Emacs,
right?

> I tried copying the assembler and linker (as.exe and ld.exe) into the folder
> where emacs.exe lives. It is necessary to add that folder to PATH, that is the
> first issue I found.

Why do you need this?  The following command will show you the full
absolute file name of the assembler being used by GCC:

  gcc -print-prog-name=as

And similarly with ld.exe and any other program that GCC needs to
invoke as party of the compilation.  Can we use that instead of adding
directories to PATH?  In fact, I wonder how does the
native-compilation branch solve this for GNU/Linux systems, if not
like that?

> If I remove the MSYS installation folder then it fails with these errors:
> 
> libgccjit.so: error: error invoking gcc driver
> 
> -or-
> 
> ld: cannot find dllcrt2.o: No such file or directory
> ld: cannot find crtbegin.o: No such file or directory
> ld: cannot find -lmingw32
> ld: cannot find -lgcc_s
> ld: cannot find -lgcc
> ld: cannot find -lmoldname
> ld: cannot find -lmingwex
> ld: cannot find -lmsvcrt
> ld: cannot find -lpthread
> ld: cannot find -ladvapi32
> ld: cannot find -lshell32
> ld: cannot find -luser32
> ld: cannot find -lkernel32
> ld: cannot find -lmingw32
> ld: cannot find -lgcc_s
> ld: cannot find -lgcc
> ld: cannot find -lmoldname
> ld: cannot find -lmingwex
> ld: cannot find -lmsvcrt
> ld: cannot find crtend.o: No such file or directory

Sounds like something is broken in the MinGW libgccjit port?  It seems
not to pass the correct -L switch to the compiler, or something along
those lines?  Does libgccjit has the equivalent of the -v switch,
which would show the complete commands used to compile?

> You are right when you say that they are native Windows programs. They don't
> need a "pseudo-unix" environment like I said previously. But they need some
> support files from the MSYS installation. I haven't figured out which ones yet.

Well, please try to figure that out, and let us know if we can help
you in that task.  Once we understand the issues, we could think about
solving them.

> >> Subject: [PATCH 4/6] Handle LISP_WORDS_ARE_POINTERS and
> >>  CHECK_LISP_OBJECT_TYPE.
> 
> > Is this specific to MS-Windows?  If so, what is the MS-Windows
> > specific aspects of native compilation that require this?
> 
> This is partially specific to Windows. I had trouble compiling it with the
> `--enable-check-lisp-object-type` configure option, so I had to add support for
> it.

But --enable-check-lisp-object-type is not specific to Windows.
Andrea, is this configuration option supported by the branch on Posix
platforms?

> One aspect that is specific to Windows is that sizeof(void*) != sizeof(long)
> even if WIDE_EMACS_INT is not defined. The code assumed that sizeof(Lisp_Word)
> == sizeof(long) if WIDE_EMACS_INT was not defined. I fixed this by adding many
> types that represent the Lisp_* family and changing the code to use these
> instead of long and long long.

That's a general bug, and should be fixed on all platforms.
WIDE_EMACS_INT is supported on Posix platforms as well; I guess no one
has yet tried to make a 32-bit build of the branch --with-wide-int.



  reply	other threads:[~2020-05-09 15:48 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 19:55 [PATCH] [WIP] Port feature/native-comp to Windows Nicolas Bertolo
2020-05-08 22:00 ` Andrea Corallo
2020-05-08 22:11   ` Nicolas Bértolo
2020-05-08 22:22     ` Andrea Corallo
2020-05-08 22:23       ` Nicolas Bértolo
2020-05-08 22:27         ` Andrea Corallo
2020-05-08 23:18           ` Stefan Monnier
2020-05-09  6:07 ` Eli Zaretskii
2020-05-09 15:28   ` Nicolas Bértolo
2020-05-09 15:48     ` Eli Zaretskii [this message]
2020-05-09 17:09       ` Andrea Corallo
2020-05-10 16:36       ` Nicolas Bértolo
2020-05-10 17:08         ` Eli Zaretskii
2020-05-10 17:50           ` Nicolas Bértolo
2020-05-10 18:22             ` Eli Zaretskii
2020-05-10 19:02               ` Nicolas Bértolo
2020-05-10 19:16                 ` Eli Zaretskii
2020-05-10 19:41                   ` Nicolas Bértolo
2020-05-10 19:50                     ` Andrea Corallo
2020-05-10 19:55                       ` Nicolas Bértolo
2020-05-10 20:01                         ` Andrea Corallo
2020-05-11 14:19                         ` Eli Zaretskii
2020-05-11 14:17                     ` Eli Zaretskii
2020-05-11 15:20                       ` Nicolas Bértolo
2020-05-11 16:19                         ` Eli Zaretskii
2020-05-11 16:43                           ` Andrea Corallo
2020-05-11 16:44                           ` Nicolas Bértolo
2020-05-11 17:05                             ` Eli Zaretskii
2020-05-11 18:19                           ` Fabrice Popineau
2020-05-11 18:37                             ` Andrea Corallo
2020-05-11 18:48                             ` Eli Zaretskii
2020-05-11 19:27                               ` Stefan Monnier
2020-05-11 19:42                               ` Fabrice Popineau
2020-05-12  2:46                       ` Nicolas Bértolo
2020-05-12 16:56                         ` Eli Zaretskii
2020-05-12 17:25                           ` Nicolas Bértolo
2020-05-12 18:21                             ` Andrea Corallo
2020-05-12 20:33                               ` Andrea Corallo
2020-05-13 14:09                                 ` Nicolas Bértolo
2020-05-13 14:31                                   ` Andrea Corallo
2020-05-13 15:00                                     ` Nicolas Bértolo
2020-05-13 15:17                                       ` Andrea Corallo
2020-05-13 15:48                                   ` Eli Zaretskii
2020-05-13  3:59                         ` Richard Stallman
2020-05-13 14:02                           ` Nicolas Bértolo
2020-05-13 15:23                             ` Eli Zaretskii
2020-05-13 14:52                           ` Eli Zaretskii
2020-05-10 19:47                   ` Andrea Corallo
2020-05-10 19:39                 ` Andrea Corallo
2020-05-10 17:13         ` Andrea Corallo
2020-05-10 17:15           ` Eli Zaretskii
2020-05-10 18:14             ` Andrea Corallo
2020-05-10 18:30               ` Eli Zaretskii
2020-05-10 18:54                 ` Andrea Corallo
2020-05-10 19:02                   ` Eli Zaretskii
2020-05-10 19:07                     ` Nicolas Bértolo
2020-05-10 19:14                     ` Andrea Corallo
2020-05-10 19:24                     ` Andrea Corallo
2020-05-10 19:30                       ` Eli Zaretskii
2020-05-10 18:05           ` Nicolas Bértolo
2020-05-10 18:23             ` Andrea Corallo
2020-05-10 17:20       ` Andrea Corallo
2020-05-09 13:42 ` Andrea Corallo
2020-05-09 15:40   ` Nicolas Bértolo
2020-05-09 15:55     ` Eli Zaretskii
2020-05-09 16:07       ` Nicolas Bértolo
2020-05-09 16:15         ` Eli Zaretskii
2020-05-09 16:27     ` Andrea Corallo
2020-05-09 16:33       ` Eli Zaretskii
2020-05-09 16:46         ` Andrea Corallo
2020-05-09 16:52     ` Andrea Corallo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83wo5lds87.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=akrl@sdf.org \
    --cc=emacs-devel@gnu.org \
    --cc=nicolasbertolo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).