Open slinkp opened 1 year ago
Every time I start the GUI, I get this in *Async-native-compile-log*
:
Compiling /usr/local/Cellar/emacs-plus@28/28.2/share/emacs/28.2/lisp/frameset.el.gz...
uncompressing frameset.el.gz...
uncompressing frameset.el.gz...done
ld: library not found for -lemutls_w
libgccjit.so: error: error invoking gcc driver
/usr/local/Cellar/emacs-plus@28/28.2/share/emacs/28.2/lisp/frameset.el.gz: Error: Internal native compiler error failed to compile
Compilation finished.
I had a similar issue with emacs30 and monterey. I was able to 'fix' this temporarily by adding this to my early-init.el:
(setenv "LIBRARY_PATH" "/opt/homebrew/opt/gcc/lib/gcc/12:/opt/homebrew/opt/libgccjit/lib/gcc/12:/opt/homebrew/opt/gcc/lib/gcc/12/gcc/aarch64-apple-darwin21/12")
`
I had a similar issue with emacs30 and monterey. I was able to 'fix' this temporarily by adding this to my early-init.el:
(setenv "LIBRARY_PATH" "/opt/homebrew/opt/gcc/lib/gcc/12:/opt/homebrew/opt/libgccjit/lib/gcc/12:/opt/homebrew/opt/gcc/lib/gcc/12/gcc/aarch64-apple-darwin21/12")
`
Did not work for me.
@appetrosyan ran into the same issue, looks like the last reference has been updated from 21 -> 22 so this works for me:
(setenv "LIBRARY_PATH" "/opt/homebrew/opt/gcc/lib/gcc/12:/opt/homebrew/opt/libgccjit/lib/gcc/12:/opt/homebrew/opt/gcc/lib/gcc/12/gcc/aarch64-apple-darwin22/12")
if it still doesn't work have a quick look to see if you have these directories available on disk, best of luck!
Worked for me too, however, i changed all the direct version occurences (i.e.12 in this case) to current. I noticed, that there is everywhere the folder current which either holds symlinks to the needed files or actually contains the files
@appetrosyan ran into the same issue, looks like the last reference has been updated from 21 -> 22 so this works for me:
(setenv "LIBRARY_PATH" "/opt/homebrew/opt/gcc/lib/gcc/12:/opt/homebrew/opt/libgccjit/lib/gcc/12:/opt/homebrew/opt/gcc/lib/gcc/12/gcc/aarch64-apple-darwin22/12")
if it still doesn't work have a quick look to see if you have these directories available on disk, best of luck!
For the latest GCC 13, run the following early in .emacs
:
;; HACK Work around native compilation on macOS failing with 'ld: library not
;; found for -lemutls_w'.
;; https://github.com/d12frosted/homebrew-emacs-plus/issues/554
(setenv "LIBRARY_PATH"
(string-join
'("/opt/homebrew/opt/gcc/lib/gcc/13"
"/opt/homebrew/opt/libgccjit/lib/gcc/13"
"/opt/homebrew/opt/gcc/lib/gcc/13/gcc/aarch64-apple-darwin22/13")
":"))
Apparently homebrew behaves differently depending on whether you're on an M1/M2 or Intel mac :(
After some googling, found out that if nothing is in /opt/homebrew
there may be equivalent paths somewhere under /usr/local/Cellar
.
I am currently trying this, which works on emacs 23 (string-join
from the previous comment wasn't added until emacs 24) and should support both intel and darwin... at the moment I only have an intel mac ... unfortunately the Cellar paths will have to be adjusted every time there's a gcc minor version bump :( but this got me unstuck:
(setenv "LIBRARY_PATH"
(mapconcat 'identity
'(
"/usr/local/Cellar/gcc/13.1.0/lib/gcc/13/"
"/usr/local/Cellar/libgccjit/13.1.0/lib/gcc/13/"
"/usr/local/Cellar/gcc/13.1.0/lib/gcc/13/gcc/x86_64-apple-darwin22/13/"
"/opt/homebrew/opt/gcc/lib/gcc/13"
"/opt/homebrew/opt/libgccjit/lib/gcc/13"
"/opt/homebrew/opt/gcc/lib/gcc/13/gcc/aarch64-apple-darwin22/13")
":"))
I have noticed that a few of these issues can be fixed by reinstalling the formula. (It also updates your branch.)
I had a similar issue except I couldn't build emacs-plus@29
at all on Sonoma 14.1. brew reinstall gcc
fixed it.
Having the same issue (I'm on M1, Sonoma, running emacs-plus@29 with native comp). was able to start but everytime I used ido or dired (or some other built-in packages) I experienced this error. Have tried some of the fixes mentioned but no luck yet.
After a system update from 13.1.something to 13.2.1, emacsplus 28.1 with native comp enabled was failing to load my config.
(Preamble on the yak shaving I had to do to get this far: I didn't save the errors but they appeared to be failing to load native compiled packages.
brew doctor
told me I needed to reinstall xcode command line tools, so I did that. Then I didbrew update && brew upgrade
. Still could not load packages; I noticedstraight
was failing to fetch packages with git failures in*Warnings*
. I realized my git auth was broken after the system update. Fixed that viagh auth setup-git
.)Still got many failures on startup, apparently during
straight
bootstrapping, like this:I noticed that emacs 28.2 was available, so I figured I'd try an upgrade and rebuild via:
This apparently succeeded building, but when starting emacs, I saw the same errors.
After some googling led to this apparently identical error with doomemacs, I founda this comment with a workaround - if I start emacs inside the console:
... This appears to complete native compilation successfully, and now I can start with the GUI as well.
Here is output of
brew doctor -v
:Here is output of
brew info emacs-plus
: