reddit / emacs

Getting the following error: Warning (comp): libgccjit.so: error: error invoking gcc driver

Riffle_X · 2022-09-09 06:09
So I am using a M1 Mac, and tryna setup emacs. I was trying to setup Magit and when I run `magit-status-here` I get a compiling error. This is the full error log: [https://hastebin.com/gekaraqiji](https://hastebin.com/gekaraqiji) Not too sure as to what the issue is but any help would be nice
d20frosted · 2022-09-09 06:56
Honestly, I don't see much value in native-comp on M1. I know I am not helpful with this comment as it doesn't address the original issue, but I really advise to check if non-native-comp Emacs works well for you.
from1917til · 2022-09-09 09:05
M-x report-emacs-bug or email bug-gnu-emacs
arthurno1 · 2022-09-09 13:23
I am a bit curious, why does it not make sense to native compile for arm cpu? Is gcc bad on arm compared to x64 or some other reason. Not saying against you just wondering.,
MangyCanine · 2022-09-09 15:11
I don’t know how accurate they are, but there are reports that say the performance improvement with native M1 compilation is minimal.
CulturMultur · 2022-09-09 19:49
I had the same problem, adding directories with gcc and libgccjit.so to LD\_LIBRARY\_PATH and LIBRARY\_PATH solved it. I have these lines in early-init.el that address this problem: ``` (defun my-append-env-var (var-name value) "Append VALUE to the beginning of current value of env variable VAR-NAME." (setenv var-name (if (getenv var-name) (format "%s:%s" value (getenv var-name)) value))) (let ((gccjitpath "/opt/homebrew/lib/gcc/11:/opt/homebrew/lib")) (mapc (lambda (var-name) (my-append-env-var var-name gccjitpath)) '("LIBRARY_PATH" "LD_LIBRARY_PATH" "PATH"))) ```
arthurno1 · 2022-09-10 16:31
> I don’t know how accurate they are, but there are reports that say the performance improvement with native M1 compilation is minimal. It would be interesting to see those reports and benchmarks.
MangyCanine · 2022-09-10 16:45
I think there was a post here, but I can’t find it. Edit: on the other hand, one of the early posts said that native comp felt faster: https://www.reddit.com/r/emacs/comments/nmljgl/comment/gzpst9b/?utm_source=BD&utm_medium=Search&utm_name=Bing&utm_content=PSR1
arthurno1 · 2022-09-10 18:22
Thanks. It is a bit old, it happened quite a bit since release of native compiler on mac and 28.1. I think some proper benchmarks are needed, not just on Mac but on other platforms too. What I think that people are overlooking is impact ob batteri lite, as mentipned there. Since native code essentially eliminiates byte interpretter for functions implemented in Lisp. Even if Emacs does not "feel" faster for us humans due to I/O latencies and perhaps othet reasons that arise in interactive applications, it might still be more efficient to run native code. Of course cost for the compilation itself should be taken into efficiency account. I don't know myself, I haven't done much benchmarking myself so no idea if it is worth or not, but in theory it feels it should be.