From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oMOxHCz321/4HAAA0tVLHw (envelope-from ) for ; Fri, 18 Dec 2020 00:26:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 6BR8GCz3218IXwAAbx9fmQ (envelope-from ) for ; Fri, 18 Dec 2020 00:26:20 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A5B8C9402B5 for ; Fri, 18 Dec 2020 00:26:12 +0000 (UTC) Received: from localhost ([::1]:48088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kq3b1-0001Zr-FR for larch@yhetil.org; Thu, 17 Dec 2020 19:26:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kq3as-0001Wa-B7 for guix-patches@gnu.org; Thu, 17 Dec 2020 19:26:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:54031) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kq3as-0000KP-0i for guix-patches@gnu.org; Thu, 17 Dec 2020 19:26:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kq3ar-0006FG-SW for guix-patches@gnu.org; Thu, 17 Dec 2020 19:26:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44775] [PATCH] WIP: Add gccemacs Resent-From: Andrew Whatson Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 18 Dec 2020 00:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44775 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Morgan Smith Received: via spool by 44775-submit@debbugs.gnu.org id=B44775.160825113223885 (code B ref 44775); Fri, 18 Dec 2020 00:26:01 +0000 Received: (at 44775) by debbugs.gnu.org; 18 Dec 2020 00:25:32 +0000 Received: from localhost ([127.0.0.1]:37344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kq3aO-0006DB-FA for submit@debbugs.gnu.org; Thu, 17 Dec 2020 19:25:32 -0500 Received: from mail-vs1-f47.google.com ([209.85.217.47]:33023) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kq3aJ-0006CM-4Z for 44775@debbugs.gnu.org; Thu, 17 Dec 2020 19:25:30 -0500 Received: by mail-vs1-f47.google.com with SMTP id e15so491648vsa.0 for <44775@debbugs.gnu.org>; Thu, 17 Dec 2020 16:25:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=4whKzGsYKgZIyDKzEGO9vIGjcNvkpdCL1VznWLm8OlE=; b=TDFUPC8ZFrL5nhyQV/vKXJL336o9hhTN1kwrYHRleMMWf7jY+Ku/aSNwQgRwEFLssR W0RNj7yOPjbOigf1v5QQGDdeRppEiKkOxk/nsI6xCRUc2GIx3zSls4v98oGSFYbdVZB1 DzhdqCm/pvmUUlKfSEQTm8XPkRZnoAwYNMK+Lzvj+EzdTwR1Zm9m1sG8+JyIp2WiWFFf H9QURqC6+hzfPOrwT4Z269175kydG3/QlbkUyZqZQ13KgxTpcvFpeFMADr+Mpc9qVjTU QvvqS5YZr/By0aVa22Z79fa9Jp0WqdVaD2q+nR8/XCMv0yGLgVscXwnXMSmAObiHbiCZ QZLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=4whKzGsYKgZIyDKzEGO9vIGjcNvkpdCL1VznWLm8OlE=; b=r6sYZymj8Xu3usFqiD/6Hx1FewxhZ38AwJX2b/DkZYfI3UPhfrQRwKYZVSDFWvTAsY dLjhhF34Wjb0iGhCjRpf3KMqsA7TLebRqszWCYQuKh2WYtL/NOsQqt6tn754uUWSjIEN PqBtHf/bJ/Xcq3J87Jsf7hfyS4ZkDR974/vYydU2q8AtJZ0f9Nn3lUUoBRGyvyP0Lg0e MbR8AfkMxMQ9+Fu2dscNdDdK6dI/LbQexLmwe/rFQmpQMW9wRX1YTiCLVDYU6HMrfA6P 6QRsjCj4mcqJ/ndOVC27csX0ooiB28rsKQ6BGTzDTD/dioIKyrhB96q5O3dGaxhsCuID sHGQ== X-Gm-Message-State: AOAM530iz/f0GllYiVLRw18FHJd/ekNKjtWZvbL5NKfuGMGiDNQiJ9pQ 9BfAHGzRsrVgCOeM+h0kKG/U3FYYG29ka24NX40= X-Google-Smtp-Source: ABdhPJxXGvnSTszE4jCvqNtC2/y4PfV3qXCPWZ6AIeXqe4xSBPkZcZ+P4dbboCtpuDrKOdLm4tRsFsJ0tK9v7tieZzo= X-Received: by 2002:a67:18c6:: with SMTP id 189mr1814622vsy.54.1608251121422; Thu, 17 Dec 2020 16:25:21 -0800 (PST) MIME-Version: 1.0 References: <874kljnk8z.fsf@asu.edu> <86360zvhkw.fsf@gmail.com> <87pn42wz8o.fsf@asu.edu> <87k0tovzy3.fsf@asu.edu> In-Reply-To: From: Andrew Whatson Date: Fri, 18 Dec 2020 10:25:09 +1000 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 44775@debbugs.gnu.org, John Soo , Andrea Corallo Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.65 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=gmail.com header.s=20161025 header.b=TDFUPC8Z; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: A5B8C9402B5 X-Spam-Score: -1.65 X-Migadu-Scanner: scn0.migadu.com X-TUID: HqLHoLuzmufa 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=3D1` 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 wro= te: > > 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 =C2=A9 2020 Andrew Whatson > > 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 > >