Opened 5 months ago

Last modified 2 months ago

#71528 new defect

emacs-app @29.4_1+nativecomp+rsvg+treesitter+xwidgets ld: library 'emutls_w' not found libgccjit.so: error: error invoking gcc driver

Reported by: wyuenho (Jimmy Yuen Ho Wong) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.10.5
Keywords: sequoia Cc: roshanshariff (Roshan Shariff), kanreki
Port: emacs emacs-app

Description (last modified by wyuenho (Jimmy Yuen Ho Wong))

After upgrading to macOS 15.2, Xcode 16.2 and a port migrate, when native compiling some packages on Emacs 29, I get lots of these messages in the *Native-compile-Log* buffer. It appears the trampolines for native compile advices to primitive functions are messed up due to a missing reference to libemutls_w in libgccjit. This problem currently broke native compilation for the emacs packages: lsp-mode, magit, forge, git-modes, multiple-cursors, because they all advise Emacs primitive functions.

git-commit.el:109:2: Error: Native compiler error: (lambda (&rest arg2484) (let ((f #'make-process)) (apply f arg2484))), "Compiling /Users/wyuenho/.emacs.d/eln-cache/29_4-de93b662/subr--trampoline-6d616b652d70726f63657373_make_process_0.eln...
ld: library 'emutls_w' not found
libgccjit.so: error: error invoking gcc driver
Internal native compiler error: \"failed to compile\", \"/Users/wyuenho/.emacs.d/eln-cache/29_4-de93b662/subr--trampoline-6d616b652d70726f63657373_make_process_0.eln\", \"error invoking gcc driver\"

Error: native-ice (\"failed to compile\" \"/Users/wyuenho/.emacs.d/eln-cache/29_4-de93b662/subr--trampoline-6d616b652d70726f63657373_make_process_0.eln\" \"error invoking gcc driver\")
  mapbacktrace(#f(compiled-function (evald func args flags) #<bytecode -0xdec7fd7a2512f81>))
  debug-early-backtrace()
  debug-early(error (native-ice \"failed to compile\" \"/Users/wyuenho/.emacs.d/eln-cache/29_4-de93b662/subr--trampoline-6d616b652d70726f63657373_make_process_0.eln\" \"error invoking gcc driver\"))
  comp--compile-ctxt-to-file(\"/Users/wyuenho/.emacs.d/eln-cache/29_4-de93b662/subr--trampoline-6d616b652d70726f63657373_make_process_0.eln\")
  comp-compile-ctxt-to-file(\"/Users/wyuenho/.emacs.d/eln-cache/29_4-de93b662/subr--trampoline-6d616b652d70726f63657373_make_process_0.eln\")
  comp-final1()
  load-with-code-conversion(\"/private/var/folders/sl/zn7bnjxj4cz8zg9jqn3xywhh0000gn/T/emacs-int-comp-subr--trampoline-6d616b652d70726f63657373_make_process_0-gtjPZO.el\" \"/private/var/folders/sl/zn7bnjxj4cz8zg9jqn3xywhh0000gn/T/emacs-int-comp-subr--trampoline-6d616b652d70726f63657373_make_process_0-gtjPZO.el\" nil t)
  command-line-1((\"-l\" \"/var/folders/sl/zn7bnjxj4cz8zg9jqn3xywhh0000gn/T/emacs-int-comp-subr--trampoline-6d616b652d70726f63657373_make_process_0-gtjPZO.el\"))
  command-line()
  normal-top-level()
"

Change History (5)

comment:1 Changed 5 months ago by wyuenho (Jimmy Yuen Ho Wong)

Summary: Emacs 29 ld: library 'emutls_w' not found libgccjit.so: error: error invoking gcc driveremacs-app @29.4_1+nativecomp+rsvg+treesitter+xwidgets ld: library 'emutls_w' not found libgccjit.so: error: error invoking gcc driver

comment:2 Changed 4 months ago by wyuenho (Jimmy Yuen Ho Wong)

Description: modified (diff)

comment:3 Changed 3 months ago by OpenSauce04 (OpenSauce)

I am also experiencing this issue with a fresh macports installation on an M1 MacBook Air.

Same emutls_w and libgccjit.so: error: error invoking gcc driver messages.

I've managed to circumvent the issue on my end for now by putting this in my .emacs:

(setq native-comp-enable-subr-trampolines nil)

Last edited 3 months ago by OpenSauce04 (OpenSauce) (previous) (diff)

comment:4 Changed 3 months ago by roshanshariff (Roshan Shariff)

Cc: roshanshariff added

comment:5 Changed 2 months ago by kanreki

Cc: kanreki added
Note: See TracTickets for help on using tickets.