homebrew-emacs-plus: warning - libgccjit.so: error: error invoking gcc driver
What you were trying to do
I have installed Emacs on macOS Big Sur using following command
brew install emacs-plus@28 --with-native-comp
What happened (include command output)
$ brew install emacs-plus [OPTIONS]
Command output
Warning (comp): libgccjit.so: error: error invoking gcc driver Disable showing Disable logging Warning (comp): /usr/local/Cellar/emacs-plus@28/28.0.50/share/emacs/28.0.50/lisp/emacs-lisp/cl-lib.el.gz: Error: Internal native compiler error failed to compile Disable showing Disable logging
Output of brew config
$ brew config HOMEBREW_VERSION: 3.0.8-32-g9a355b0 ORIGIN: https://github.com/Homebrew/brew HEAD: 9a355b07c3706d9c0477827009ae817c8749261d Last commit: 21 minutes ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: 5f905845a19ef0d32641a3e0db131cd5a991b1ff Core tap last commit: 34 minutes ago Core tap branch: master HOMEBREW_PREFIX: /usr/local HOMEBREW_CASK_OPTS: [] HOMEBREW_DISPLAY: 192.168.59.3:0 HOMEBREW_GITHUB_API_TOKEN: set HOMEBREW_MAKE_JOBS: 8 Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby CPU: octa-core 64-bit kabylake Clang: 12.0 build 1200 Git: 2.31.0 => /usr/local/bin/git Curl: 7.64.1 => /usr/bin/curl macOS: 11.2.3-x86_64 CLT: 12.4.0.0.1.1610135815 Xcode: 12.4
Output of brew doctor
$ brew doctor Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks! Warning: Some installed formulae are deprecated or disabled. You should find replacements for the following formulae: guile@2 Warning: Unbrewed dylibs were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected dylibs: /usr/local/lib/libwkhtmltox.0.12.6.dylib Warning: Unbrewed header files were found in /usr/local/include. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected header files: /usr/local/include/wkhtmltox/image.h /usr/local/include/wkhtmltox/pdf.h Warning: You have uncommitted modifications to Homebrew/homebrew-core. If this is a surprise to you, then you should stash these modifications. Stashing returns Homebrew to a pristine state but can be undone should you later need to do so for some reason. cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core && git stash && git clean -d -f Uncommitted files: M Formula/wxmac.rb
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 24 (6 by maintainers)
for anyone else running into this, i also fixed this by simply running
xcode-select --install.Putting following in early-init.el fixed the issue
Please note, I have installed gcc and libgccjit without flag
--force --build-from-sourcewith homebrew. I didn’t try building from source as it was taking a lot of time (More than 20 mins)I still see this warning though
Here are some more warnings captured https://gist.github.com/8aa802fa01c6adee206cf1a6d64f711e
Is there any function or way which tells that gccemacs is perfectly working fine? As Emacs seems working fine from usability perspective.
@anildigital You can use
M-x describe-function [RET] <func-name>to see if a specific function is natively compiled or not. For example doing so withibuffershould yield this:However, if it’s a auto-loaded function that hasn’t been loaded yet, it will not mention native comp, for example, this is the output for
M-x describe-function [RET] tramp-versionfor me before tramp is loaded:And this is after tramp is loaded:
And sure enough the workaround broke with gcc going to version 12, new line:
I just had this issue as well and followed this suggestion you linked earlier in the thread @d12frosted to get it working, though I have no idea why that worked.
Worked for me on MacOs Sur with below entry in early-init.el as metioned above:
I had encountered the same issue and fixed by the following steps (not needed setenv):
@anildigital in that case everything should be fine. I imagine it wasn’t showing before you hadn’t run
magit-statussince you launched Emacs. If you had, then ¯\_(ツ)_/¯Well, modifying
LIBRARY_PATHis a workaround, dirty one, not future-proof, but still a workaround. Not sure what’s wrong with your env though and why it doesn’t work for you. I will clean install soon to see the process from the beginning (I’ve been medling with my env so much during my attempts to introduce--with-native-compoption) 😸AFAIK, there is no tool to check this. If it works, it works 😸 Those warnings are totally fine to see.
That’s because when you start applications from finder (or spotlight), environment is very different. There are many ways of dealing with this (one of the viable solutions is to use exec-path-from-shell). But in this particular case I would avoid messing with
LIBRARY_PATHand rather reinstalllibgccjitand try again (afaik, no need to build from sources):Hope that helps.