[MacPorts] #64331: emacs-app-devel: problems with native compilation

MacPorts noreply at macports.org
Sun Jan 2 01:16:24 UTC 2022


#64331: emacs-app-devel: problems with native compilation
------------------------------+----------------------
  Reporter:  pmetzger         |      Owner:  drkp
      Type:  defect           |     Status:  assigned
  Priority:  Normal           |  Milestone:
 Component:  ports            |    Version:
Resolution:                   |   Keywords:
      Port:  emacs-app-devel  |
------------------------------+----------------------

Comment (by pmetzger):

 Native compilation is a feature of Emacs as of version 28. The port builds
 fine, but Emacs now features a native code compiler for elisp, the
 extension language that is part of the Emacs system. It works by using
 libgccjit, although it's not a jit but rather an ahead of time compiler.
 What happens is emacs itself starts, but when it attempts to compile elisp
 code to execute it, it starts spitting out error messages. If you're not
 an Emacs user, this likely isn't very meaningful to you.

 Regardless, the problem happens with most elisp. For example, with my
 particular init.elc file:

 {{{
 Warning (initialization): An error occurred while loading
 ‘/Users/perry/.config/emacs/init.elc’:

 Native compiler error: (lambda (arg0 &optional) (let ((f #'yes-or-no-p))
 (funcall f arg0))), Compiling /Users/perry/.config/emacs/eln-
 cache/29_0_50-99cad26e/subr--trampoline-
 7965732d6f722d6e6f2d70_yes_or_no_p_0.eln...
 ld: library not found for -lSystem
 collect2: error: ld returned 1 exit status
 libgccjit.so: error: error invoking gcc driver
 Debugger entered--Lisp error: (native-ice "failed to compile"
 "/Users/perry/.config/emacs/eln-cache/29_0_50-99cad..." "error invoking
 gcc driver")
   comp--compile-ctxt-to-file("/Users/perry/.config/emacs/eln-
 cache/29_0_50-99cad...")
   comp-compile-ctxt-to-file("/Users/perry/.config/emacs/eln-
 cache/29_0_50-99cad...")
   comp-final1()
   load-with-code-
 conversion("/private/var/folders/f7/wtf8h98x1wd8sbzw0vrh0d5c00..."
 "/private/var/folders/f7/wtf8h98x1wd8sbzw0vrh0d5c00..." nil t)
   command-line-1(("-l"
 "/var/folders/f7/wtf8h98x1wd8sbzw0vrh0d5c0000gq/T/e..."))
   command-line()
   normal-top-level()

 }}}

 You can invoke it in many ways and get similar problems. The consistent
 error is the stuff about -lSystem not being found.

 It's important that those of us who know how to deal with Emacs fix this
 relatively soon because Emacs 28 will be out relatively soon.

-- 
Ticket URL: <https://trac.macports.org/ticket/64331#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list