emacs-devel
[Top][All Lists]
Advanced

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

Re: Native compilation on Windows, was Re: Bootstrap Compilation Speed


From: Corwin Brust
Subject: Re: Native compilation on Windows, was Re: Bootstrap Compilation Speed
Date: Tue, 18 Jan 2022 18:02:21 -0600

On Tue, Jan 18, 2022 at 3:36 PM H. Dieter Wilhelm
<dieter@duenenhof-wilhelm.de> wrote:
> Unfortunately this build didn't work on another Windows computer.  It
> seems that there are not yet all necessary dependencies in the distro
> archive (for example libgmp-10.dll is missing).  I hope Corwin can bring
> some light into the build system.

We shall see >:-]

I was able make ./build-deps.zip create a version that (appears as if
it) supports native-comp.

New versions are uploaded to my same Sourcehut repo in a new folder
called "with-native-compilation":

  
https://git.sr.ht/~mplscorwin/emacs-w64/tree/master/item/with-native-compilation

I'd be quite interested to learn how these work (or don't) for others.

The hackery I found "successful" is presented at the end of this
message.  In brief, what solved the problem for me was remove -static
from CFLAGS.  You can ignore the swapping of $CACHE and CFLAGS; this
simply made it easier to comment out $CACHE while debugging.

Before removing -static I was running into this:

  #./configure --with-native-compilation CFLAGS="-O2 -static"
  [...snip.. lots of the usual ...]
  checking for gcc_jit_context_acquire in -lgccjit... no
  configure: error: ELisp native compiler was requested, but libgccjit
was not found.
  Please try installing libgccjit or a similar package.
  If you are sure you want Emacs be compiled without ELisp native compiler,
  pass the --without-native-compilation option to configure.

After removing -static build-zips.sh works fine.

I have to assume that "just dumping" the -static flag isn't TRT, so
trying to understand the above error message, code producing it, etc.
will be my next move.  Once I understand that I hope we (I, but feel
free) can work up patches to make building with native compilation the
default when building windows distributables, get the msys pathing
corrected once and for all, and (assuming anything is necessary) fix
configure &ct. to make -static work under msys when
--with-native-compilation is specified.  Notwithstanding -static,
assuming that files linked above are not Just Exactly Perfect then I
am probably understating the remaining work to get back to a "turn
key" windows packaging process.

Here is my "fix" for build-zips:

diff --git a/admin/nt/dist-build/build-zips.sh
b/admin/nt/dist-build/build-zips.sh
index 77d20a5a7b..30131b5202 100755
--- a/admin/nt/dist-build/build-zips.sh
+++ b/admin/nt/dist-build/build-zips.sh
@@ -48,12 +48,13 @@
         echo [build] Configuring Emacs
         $REPO_DIR/$BRANCH/configure \
             --without-dbus \
+            --with-native-compilation \
             --without-compress-install \
-            $CACHE \
-            CFLAGS="$CFLAGS"
+            CFLAGS="$CFLAGS" \
+            $CACHE
     fi

-    make -j 4 $INSTALL_TARGET \
+    make -j 20 $INSTALL_TARGET \
          prefix=$HOME/emacs-build/install/emacs-$VERSION
     cd $HOME/emacs-build/install/emacs-$VERSION
     zip -r -9 emacs-$OF_VERSION-no-deps.zip *
@@ -96,7 +97,8 @@ BUILD=
 BUILD_64=1
 GIT_UP=0
 CONFIG=1
-CFLAGS="-O2 -static"
+#CFLAGS="-O2 -static"
+CFLAGS="-O2"
 INSTALL_TARGET="install-strip"

 ## The location of the git repo



reply via email to

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