Enable native comp in Windows native Emacs

If following the guide and installing native Emacs on Windows from Scoop, the latest versions have native comp enabled but it is unusable due to the lack of a viable libgccjit. The following instructions will install libgccjit and place it on your path so that the Scoop-installed Emacs will have working native compilation.

Warning: This will place a newly installed MSYS2 GCC executable on your path. If you have GCC installed another way it may cause issues. gcm gcc can help debug from a PowerShell terminal.

  1. Install MSYS2
  2. Open MSYS2 MINGW64 terminal from the start menu
  3. Run pacman -S mingw-w64-x86_64-libgccjit
  4. Open up Edit environment variables for your account, edit the Path user variable, and add C:\msys64\mingw64\bin (or replace C:\msys64 with your actual install location, if you chose a non-default)
  5. Native comp should now work! Run doom doctor and check.
1 Like