Skip to content

Instantly share code, notes, and snippets.

@flatwhatson
Last active July 24, 2020 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flatwhatson/887b989d37f782c12b3466689fcb254f to your computer and use it in GitHub Desktop.
Save flatwhatson/887b989d37f782c12b3466689fcb254f to your computer and use it in GitHub Desktop.

GccEmacs

GccEmacs refers to the feature/native-comp branch of Emacs, which adds support for compiling EmacsLisp to native code by leveraging libgccjit. All of the Elisp packages shipped with Emacs are native-compiled during the build process, providing a noticeable performance improvement out-of-the-box. Third-party and user modules may also be compiled to achieve further performance improvements.

The official development log can be found here.

The feature is discussed in detail in the talk "Bringing GNU Emacs to native code" here.

Installation

ArchLinux

An emacs-native-comp-git package is available on the AUR here.

Install it with your favourite AUR helper, or use the following commands to do it yourself:

git clone https://aur.archlinux.org/emacs-native-comp-git.git
cd emacs-native-comp-git
makepkg --syncdeps --install

Guix

An emacs-native-comp package is available in a channel here.

Add the channel to your ~/.config/guix/channels.scm, or use the following commands to install it as a one-off:

git clone https://github.com/flatwhatson/guix-channel.git
guix install --load-path=./guix-channel emacs-native-comp

Nix

An emacsGcc package is available from the Nix community's Emacs overlay here.

For detailed installation instructions, see here.

Manual

To build the native-comp branch of Emacs, you will need libgccjit in addition to the other dependencies described in BuildingEmacs.

First, checkout the feature/native-comp branch of Emacs, and configure it with the --with-nativecomp flag:

git clone git://git.savannah.gnu.org/emacs.git
cd emacs
git checkout feature/native-comp
./autogen.sh
./configure --with-nativecomp

You should see "Does Emacs have native lisp compiler? yes" near the end of the configure output if native compilation has been enabled. Complete the build with make and make install as usual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment