emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] [WIP] Port feature/native-comp to Windows.


From: Nicolas Bertolo
Subject: [PATCH] [WIP] Port feature/native-comp to Windows.
Date: Fri, 8 May 2020 16:55:59 -0300

Hello emacs-devel

 

I have ported the feature/native-comp branch to Windows. I have tested my changes in Windows 10 x64 with Mingw64 GCC 10.0. Other architectures or compilers should work, but it may be necessary to adjust the code a little bit.

 

I would like to thank the author of this blogpost which was very helpful for me: http://www.albertzhou.net/blog/2020/01/emacs-native-comp.html

 

As I said above other architectures or compilers should work, but it may be necessary to change the code that generates calls to setjmp(), since there are many ways to do it. An option would be to copy what the setjmp.h header does, but I do not think it is a good idea. The proper fix would be to use autoconf to detect it somehow.

 

Another issue is that the “emacs_dir” environment variable needs to be set quite early in the initialization process. I do not know enough about the Emacs internals to make the proper changes for that, so I just added a dirty hack.

 

There is a remaining issue involving the environment in which emacs runs. The libgccjit likes to run in a Mingw64 environment, so it can find the assembler, linker, etc. This is means that Emacs needs to run in a pseudo-Unix environment. I don’t like this since this environment would be propagated to other processes launched by Emacs, and they may not like this.

 

I have thought about a simple fix to this but I haven’t implemented it yet. The Emacs process that needs to run in a Mingw64 environment is actually the subprocess that performs the compilation, not the main process that runs the editor. So my idea is to run this subprocess through a small script that setups the environment that libgccjit expects without polluting the Emacs environment.

Attachment: 0001-HACK-Ensure-the-emacs_root_dir-function-does-not-cra.patch
Description: Binary data

Attachment: 0002-Do-not-block-SIGIO-in-platforms-that-don-t-have-it.patch
Description: Binary data

Attachment: 0003-Handle-setjmp-taking-two-arguments-in-Windows.patch
Description: Binary data

Attachment: 0004-Handle-LISP_WORDS_ARE_POINTERS-and-CHECK_LISP_OBJECT.patch
Description: Binary data

Attachment: 0005-Remove-a-layer-of-indirection-for-access-to-pure-sto.patch
Description: Binary data

Attachment: 0006-Workaround-the-32768-chars-command-line-limit-in-Win.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]