reddit / emacs

Issues building Emacs.app for Mac OS from source with native compilation

treeblahh · 2022-10-27 00:51
Hello! I've been struggling with this issue for several days now and wondered if any Mac OS Emacs users have successfully overcome it. I created a thread on the [Emacs StackExchange](https://emacs.stackexchange.com/q/74239/38373) describing the issue and my attempts at solutions in detail, but the gist is: 1. I'm building Emacs from source on Mac OS, 12.4 w/ M1. 2. I'm configuring Emacs with native compilation. ``` ./configure --with-native-compilation \ --with-ns \ --disable-silent-rules ``` 3. The build succeeds, `src/emacs` runs like a charm and I `make install`. 4. My nextstep/Emacs.app runs, but emits a ton of `libgccjit.so: error: error invoking gcc driver` errors to the Messages buffer. I suspect the Emacs.app package has some misconfigured paths that are unable to find my `libgccjit` library, which I've installed via homebrew. I've tried experimenting with [exec-path-from-shell](https://github.com/purcell/exec-path-from-shell) to ensure Emacs is aware of my shell paths, but to no avail. In the meantime, I've been able to use `emacs` and `emacsclient` from the CLI with no issues to speak of. The only problems arise when I interact with the Emacs.app application. Anyone have an idea as to what's going on here?
mclearc · 2022-10-27 02:25
you could try with this script. Works for me on macos 12.6. https://github.com/mclear-tools/build-emacs-macos
tapesales · 2022-10-27 04:06
I would use the emacs-mac-app from MacPorts if I were you. Simple and effective.
treeblahh · 2022-10-27 14:58
This looks very promising, thank you! I’ll see what differences the author includes.
xenodium · 2022-10-27 15:11
https://xenodium.com/emacs-plus-with-native-comp/ brew tap d12frosted/emacs-plus brew install emacs-plus@28 --with-native-comp
treeblahh · 2022-10-27 15:37
Yeah this is what I use at work but I’m trying to build from source so I can learn more about the emacs internals.
belbox · 2022-11-25 15:02
I followed this path: [https://gist.github.com/mikroskeem/0a5c909c1880408adf732ceba6d3f9ab#1-gcc-with-libgccjit-enabled](https://gist.github.com/mikroskeem/0a5c909c1880408adf732ceba6d3f9ab#1-gcc-with-libgccjit-enabled) No problems so far