unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrew Whatson <whatson@gmail.com>
To: Morgan Smith <Morgan.J.Smith@outlook.com>
Cc: 44775@debbugs.gnu.org, John Soo <jsoo1@asu.edu>,
	Andrea Corallo <akrl@sdf.org>
Subject: [bug#44775] [PATCH] WIP: Add gccemacs
Date: Fri, 18 Dec 2020 10:25:09 +1000	[thread overview]
Message-ID: <CAPE069df+8MNuS9oczV8tA2dsW77CULctFPEXshirDRWwjvKtQ@mail.gmail.com> (raw)
In-Reply-To: <SN4PR0801MB3679A3939B2DDB789993B21BC5C40@SN4PR0801MB3679.namprd08.prod.outlook.com>

Hi everyone,

Yes, I'm very happy for my work to be included in Guix in whatever
form.  I've detailed my work below, and also CC'd Andrea who is
responsible for developing this feature in case he has anything to
add.

1. Enable the `--with-native-comp` configure flag.  Self explanatory!

2. Set the `NATIVE_FULL_AOT=1` make flag, maybe.  This tells the build
process to native-compile *all* of the Elisp that ships with Emacs.
Otherwise only the minimal set of Elisp packages included in the pdump
will be native-compiled, with the rest to be compiled on-demand at
runtime.  This has a significant impact on compilation time, so makes
more sense if the package will be built once and installed many times,
and less sense if everyone is building the package themselves.

3. Extend `LIBRARY_PATH` so libgccjit works at compile time.  This is
necessary for a functioning libgccjit and to pass the "smoke test" in
the configure script.  I think this should probably be exported by the
libgccjit package as a search path instead of requiring all dependents
to handle it manually.

4. Patch the `comp-native-driver-options` in `comp.el`.  This is
necessary to have libgccjit functioning at runtime.  Originally I was
setting LIBRARY_PATH in the emacs wrapper to achieve this, but that
had the undesirable effect of leaking to any process launched from
Emacs.  Setting the necessary paths via the driver options is a much
more targeted solution.

5. Remove the shell-script wrappers from eln files.  The
`glib-or-gtk-build-system` aggressively wraps anything which smells
like an executable, preventing the native-compiled Elisp from being
loaded as shared libraries at runtime.  This is based on the
`restore-emacs-pdmp` phase in the base Emacs package which works
around the same problem.

6. Use a newer `libgccjit` based on `gcc-10`.  This is not strictly
necessary, but if I recall correctly libgccjit-9 suffers from a bug
related to the inlining of constant strings which was fixed in
libgccjit-10, and this has some impact on the performance of
native-compiled Elisp.  The `libgccjit` package in Guix is only
defined for gcc-9, so I created a package factory to define libgccjit
packages based on an arbitrary gcc, and use gcc-10 and libgccjit-10 as
dependencies for the emacs-native-comp package.  I haven't tried to
build using gcc-9 and libgccjit-10, so I'm not sure if there's some
interdependency.  I think it would be best to upstream libgccjit-10
alongside an emacs-native-comp package.

I hope this all makes sense, happy to answer any questions.

Cheers,
Andrew

On Fri, 18 Dec 2020 at 03:26, Morgan Smith <Morgan.J.Smith@outlook.com> wrote:
>
> Hi John,
>
> (And hi Andrew. We're discussing including your code into the main Guix
> repository. You can view the full conversation here:
> https://issues.guix.gnu.org/44775)
>
> The code I linked to is already licensed under GPLv3+ meaning that you
> are free to integrate their code into the Guix code-base (Going to put
> here that I'm not a lawyer and that this is not legal advice and might
> not even be correct). You should indeed put a little copyright line for
> Andrew in the code. The exact copyright line you should use seems to be
> this (pulled from their git repo):
>
> ;;; Copyright © 2020 Andrew Whatson <whatson@gmail.com>
>
> You can do all this without contacting the author, but hopefully Andrew
> responds to us with lots of love.
>
> Thanks,
>
> Morgan
>
> On 12/11/20 3:40 PM, John Soo wrote:
> > Hi Morgan,
> >
> > Thank you! I will take a look. If I end up using some of their code,
> > should I consult them about it and see if they want a copyright line?
> > How is that supposed to work?
> >
> > Thank you again,
> >
> > John
> >




  reply	other threads:[~2020-12-18  0:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-21  9:15 [bug#44775] [PATCH] WIP: Add gccemacs John Soo
2020-11-23 22:22 ` zimoun
2020-11-24 15:06   ` John Soo
2020-12-18  2:50     ` zimoun
2020-11-24 15:28   ` John Soo
2020-11-29  2:14     ` Morgan Smith
2020-12-11 20:40       ` John Soo
2020-12-17 17:26         ` Morgan Smith
2020-12-18  0:25           ` Andrew Whatson [this message]
2023-05-29 12:06 ` bug#44775: " Jelle Licht

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://guix.gnu.org/

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

  git send-email \
    --in-reply-to=CAPE069df+8MNuS9oczV8tA2dsW77CULctFPEXshirDRWwjvKtQ@mail.gmail.com \
    --to=whatson@gmail.com \
    --cc=44775@debbugs.gnu.org \
    --cc=Morgan.J.Smith@outlook.com \
    --cc=akrl@sdf.org \
    --cc=jsoo1@asu.edu \
    /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/guix.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).