Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native comp doesn't work after update to MacOS 13.2.1 , ld: library not found for -lemutls_w #554

Open
slinkp opened this issue Feb 26, 2023 · 11 comments
Labels
native comp Issue is related to native compilation

Comments

@slinkp
Copy link

slinkp commented Feb 26, 2023

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 did brew update && brew upgrade.
Still could not load packages; I noticed straight was failing to fetch packages with git failures in *Warnings*. I realized my git auth was broken after the system update. Fixed that via gh auth setup-git.)

Still got many failures on startup, apparently during straight bootstrapping, like this:

ld: library not found for -lemutls_w
libgccjit.so: error: error invoking gcc driver

I noticed that emacs 28.2 was available, so I figured I'd try an upgrade and rebuild via:

brew uninstall emacs-plus@28
brew install emacs-plus@28 --with-native-comp --with-modern-papirus-icon

This apparently succeeded building, but when starting emacs, I saw the same errors.

ld: library not found for -lemutls_w
libgccjit.so: error: error invoking gcc driver

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:

emacs -nw

... This appears to complete native compilation successfully, and now I can start with the GUI as well.

Here is output of brew doctor -v:

==> Cask Environment Variables:
BUNDLE_PATH
CHRUBY_VERSION
GEM_HOME
GEM_PATH
HOMEBREW_CASK_OPTS
LC_ALL
PATH
RBENV_VERSION
RUBYLIB
RUBYOPT
RUBYPATH
SHELL
==> $LOAD_PATHS
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/warning-1.3.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/tapioca-0.7.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/yard-sorbet-0.6.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/yard-0.9.26/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/spoom-1.1.11/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/thor-1.2.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-static-and-runtime-0.5.10461/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-0.5.10461/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-static-0.5.10461-universal-darwin-21/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov-cobertura-2.1.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov-0.22.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.4/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov-html-0.12.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-macho-3.0.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.7.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.18.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rails-2.17.4/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.16.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-capybara-2.17.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-1.45.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/unicode-display_width-2.4.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.11.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-ast-1.26.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rspec_junit_formatter-0.6.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rspec-sorbet-1.9.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rspec-retry-0.6.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rspec-its-1.3.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rspec-github-2.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rspec-3.12.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rspec-mocks-3.12.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rspec-expectations-3.12.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rspec-core-3.12.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rspec-support-3.12.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ronn-0.7.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rexml-3.2.5/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rdiscount-2.2.7/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-21/2.6.0/rdiscount-2.2.7
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rbi-0.0.14/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/unparser-0.6.4/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rack-3.0.4.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/pry-0.14.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.6.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/patchelf-1.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/parlour-8.1.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rainbow-3.1.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/parser-3.2.1.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/parallel_tests-3.13.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/parallel-1.22.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/mustache-1.1.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/method_source-1.0.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/mechanize-2.8.5/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrobots-0.1.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/webrick-1.8.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubyntlm-0.6.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.13.10-x86_64-darwin/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/racc-1.6.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-21/2.6.0/racc-1.6.2
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/net-http-persistent-4.0.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/net-http-digest_auth-1.4.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/mime-types-3.4.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2022.0105/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/json_schemer-0.2.24/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/uri_template-0.7.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/json-2.6.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-21/2.6.0/json-2.6.3
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/http-cookie-1.0.5/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/hpricot-0.8.6/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-21/2.6.0/hpricot-0.8.6
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/hana-1.3.7/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/elftools-1.2.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ecma-re-validator-0.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/regexp_parser-2.7.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/unf-0.1.4/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.8.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-21/2.6.0/unf_ext-0.0.8.2
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/docile-1.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.5.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/did_you_mean-1.6.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/connection_pool-2.3.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/commander-4.6.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/highline-2.0.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/coderay-1.1.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/byebug-11.1.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-21/2.6.0/byebug-11.1.3
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.16.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-21/2.6.0/bootsnap-1.16.0
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/msgpack-1.6.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-21/2.6.0/msgpack-1.6.0
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bindata-2.4.15/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ast-2.4.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/addressable-2.8.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/public_suffix-5.0.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.7.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/tzinfo-2.0.6/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/minitest-5.17.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/i18n-1.12.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/concurrent-ruby-1.2.0/lib/concurrent-ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0/x86_64-darwin22
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0/universal-darwin22
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/x86_64-darwin22
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin22
/usr/local/Homebrew/Library/Homebrew
==> Homebrew Version
4.0.3
==> macOS
13.2.1
==> SIP
Enabled
==> Homebrew Cask Staging Location
/usr/local/Caskroom
==> Homebrew Cask Taps:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask (4168 casks)
PATH value was changed to:
/usr/local/opt/make/libexec/gnubin
/usr/local/opt/autoconf/libexec/gnubin
/usr/local/opt/gnu-sed/libexec/gnubin
/usr/local/opt/gnu-tar/libexec/gnubin
/usr/local/opt/awk/libexec/gnubin
/usr/local/opt/coreutils/libexec/gnubin
/usr/local/opt/pkg-config/libexec/gnubin
/usr/local/opt/texinfo/libexec/gnubin
/usr/local/opt/xz/libexec/gnubin
/usr/local/opt/gnutls/libexec/gnubin
/usr/local/opt/librsvg/libexec/gnubin
/usr/local/opt/little-cms2/libexec/gnubin
/usr/local/opt/jansson/libexec/gnubin
/usr/local/opt/imagemagick/libexec/gnubin
/usr/local/Cellar/dbus/1.14.6/libexec/gnubin
/usr/local/Cellar/mailutils/3.15_2/libexec/gnubin
/usr/local/opt/make/bin
/usr/local/opt/autoconf/bin
/usr/local/opt/gnu-sed/bin
/usr/local/opt/gnu-tar/bin
/usr/local/opt/awk/bin
/usr/local/opt/coreutils/bin
/usr/local/opt/pkg-config/bin
/usr/local/opt/texinfo/bin
/usr/local/opt/xz/bin
/usr/local/opt/gnutls/bin
/usr/local/opt/librsvg/bin
/usr/local/opt/little-cms2/bin
/usr/local/opt/jansson/bin
/usr/local/opt/imagemagick/bin
/usr/local/opt/dbus/bin
/usr/local/opt/mailutils/bin
/usr/local/Homebrew/Library/Homebrew/shims/shared
/usr/bin
/bin
/usr/sbin
/sbin
==> which tar
/usr/local/opt/gnu-tar/libexec/gnubin/tar
==> which ls
/usr/local/opt/coreutils/libexec/gnubin/ls
PATH value was changed to:
/usr/local/opt/make/libexec/gnubin
/usr/local/opt/autoconf/libexec/gnubin
/usr/local/opt/gnu-sed/libexec/gnubin
/usr/local/opt/gnu-tar/libexec/gnubin
/usr/local/opt/awk/libexec/gnubin
/usr/local/opt/coreutils/libexec/gnubin
/usr/local/opt/pkg-config/libexec/gnubin
/usr/local/opt/texinfo/libexec/gnubin
/usr/local/opt/xz/libexec/gnubin
/usr/local/opt/gnutls/libexec/gnubin
/usr/local/opt/librsvg/libexec/gnubin
/usr/local/opt/little-cms2/libexec/gnubin
/usr/local/opt/jansson/libexec/gnubin
/usr/local/opt/imagemagick/libexec/gnubin
/usr/local/Cellar/dbus/1.14.6/libexec/gnubin
/usr/local/Cellar/mailutils/3.15_2/libexec/gnubin
/usr/local/opt/make/bin
/usr/local/opt/autoconf/bin
/usr/local/opt/gnu-sed/bin
/usr/local/opt/gnu-tar/bin
/usr/local/opt/awk/bin
/usr/local/opt/coreutils/bin
/usr/local/opt/pkg-config/bin
/usr/local/opt/texinfo/bin
/usr/local/opt/xz/bin
/usr/local/opt/gnutls/bin
/usr/local/opt/librsvg/bin
/usr/local/opt/little-cms2/bin
/usr/local/opt/jansson/bin
/usr/local/opt/imagemagick/bin
/usr/local/opt/dbus/bin
/usr/local/opt/mailutils/bin
/usr/local/Homebrew/Library/Homebrew/shims/shared
/usr/bin
/bin
/usr/sbin
/sbin
==> which tar
/usr/local/opt/gnu-tar/libexec/gnubin/tar
==> which ls
/usr/local/opt/coreutils/libexec/gnubin/ls
Your system is ready to brew.

Here is output of brew info emacs-plus:

==> d12frosted/emacs-plus/emacs-plus@28: stable 28.2, HEAD
/usr/local/Cellar/emacs-plus@28/28.2 (4,412 files, 174.8MB) *
  Built from source on 2023-02-26 at 13:39:38 with: --with-native-comp --with-modern-papirus-icon
From: https://github.com/d12frosted/homebrew-emacs-plus/blob/HEAD/Formula/[email protected]
==> Dependencies
Build: make, autoconf, gnu-sed, gnu-tar, awk, coreutils, pkg-config, texinfo, xz
Required: gnutls, librsvg, little-cms2, jansson
Optional: imagemagick, dbus, mailutils
==> Options
--with-EmacsIcon1-icon
	Using Emacs EmacsIcon1 icon
--with-EmacsIcon2-icon
	Using Emacs EmacsIcon2 icon
--with-EmacsIcon3-icon
	Using Emacs EmacsIcon3 icon
--with-EmacsIcon4-icon
	Using Emacs EmacsIcon4 icon
--with-EmacsIcon5-icon
	Using Emacs EmacsIcon5 icon
--with-EmacsIcon6-icon
	Using Emacs EmacsIcon6 icon
--with-EmacsIcon7-icon
	Using Emacs EmacsIcon7 icon
--with-EmacsIcon8-icon
	Using Emacs EmacsIcon8 icon
--with-EmacsIcon9-icon
	Using Emacs EmacsIcon9 icon
--with-cacodemon-icon
	Using Emacs cacodemon icon
--with-ctags
	Don't remove the ctags executable that Emacs provides
--with-dbus
	Build with dbus support
--with-debug
	Build with debug symbols and debugger friendly optimizations
--with-dragon-icon
	Using Emacs dragon icon
--with-elrumo1-icon
	Using Emacs elrumo1 icon
--with-elrumo2-icon
	Using Emacs elrumo2 icon
--with-emacs-card-blue-deep-icon
	Using Emacs emacs-card-blue-deep icon
--with-emacs-card-british-racing-green-icon
	Using Emacs emacs-card-british-racing-green icon
--with-emacs-card-carmine-icon
	Using Emacs emacs-card-carmine icon
--with-emacs-card-green-icon
	Using Emacs emacs-card-green icon
--with-gnu-head-icon
	Using Emacs gnu-head icon
--with-imagemagick
	Build with imagemagick support
--with-mailutils
	Build with mailutils support
--with-memeplex-slim-icon
	Using Emacs memeplex-slim icon
--with-memeplex-wide-icon
	Using Emacs memeplex-wide icon
--with-modern-alecive-flatwoken-icon
	Using Emacs modern-alecive-flatwoken icon
--with-modern-asingh4242-icon
	Using Emacs modern-asingh4242 icon
--with-modern-azhilin-icon
	Using Emacs modern-azhilin icon
--with-modern-bananxan-icon
	Using Emacs modern-bananxan icon
--with-modern-black-dragon-icon
	Using Emacs modern-black-dragon icon
--with-modern-black-gnu-head-icon
	Using Emacs modern-black-gnu-head icon
--with-modern-black-variant-icon
	Using Emacs modern-black-variant icon
--with-modern-bokehlicia-captiva-icon
	Using Emacs modern-bokehlicia-captiva icon
--with-modern-cg433n-icon
	Using Emacs modern-cg433n icon
--with-modern-doom-icon
	Using Emacs modern-doom icon
--with-modern-doom3-icon
	Using Emacs modern-doom3 icon
--with-modern-icon
	Using Emacs modern icon
--with-modern-mzaplotnik-icon
	Using Emacs modern-mzaplotnik icon
--with-modern-nuvola-icon
	Using Emacs modern-nuvola icon
--with-modern-orange-icon
	Using Emacs modern-orange icon
--with-modern-paper-icon
	Using Emacs modern-paper icon
--with-modern-papirus-icon
	Using Emacs modern-papirus icon
--with-modern-pen-3d-icon
	Using Emacs modern-pen-3d icon
--with-modern-pen-black-icon
	Using Emacs modern-pen-black icon
--with-modern-pen-icon
	Using Emacs modern-pen icon
--with-modern-pen-lds56-icon
	Using Emacs modern-pen-lds56 icon
--with-modern-purple-flat-icon
	Using Emacs modern-purple-flat icon
--with-modern-sexy-v1-icon
	Using Emacs modern-sexy-v1 icon
--with-modern-sexy-v2-icon
	Using Emacs modern-sexy-v2 icon
--with-modern-sjrmanning-icon
	Using Emacs modern-sjrmanning icon
--with-modern-vscode-icon
	Using Emacs modern-vscode icon
--with-modern-yellow-icon
	Using Emacs modern-yellow icon
--with-native-comp
	Build with native compilation
--with-no-frame-refocus
	Disables frame re-focus (ie. closing one frame does not refocus another one)
--with-no-titlebar
	Experimental: build without titlebar
--with-no-titlebar-and-round-corners
	Experimental: build without titlebar and round coners
--with-nobu417-big-sur-icon
	Using Emacs nobu417-big-sur icon
--with-retro-emacs-logo-icon
	Using Emacs retro-emacs-logo icon
--with-retro-gnu-meditate-levitate-icon
	Using Emacs retro-gnu-meditate-levitate icon
--with-retro-sink-bw-icon
	Using Emacs retro-sink-bw icon
--with-retro-sink-icon
	Using Emacs retro-sink icon
--with-spacemacs-icon
	Using Emacs spacemacs icon
--with-x11
	Experimental: build with x11 support
--with-xwidgets
	Experimental: build with xwidgets support
--without-cocoa
	Build a non-Cocoa version of Emacs
--HEAD
	Install HEAD version
==> Caveats
Emacs.app was installed to:
  /usr/local/opt/emacs-plus@28

To link the application to default Homebrew App location:
  ln -s /usr/local/opt/emacs-plus@28/Emacs.app /Applications

Your PATH value was injected into Emacs.app/Contents/Info.plist

Report any issues to http://github.com/d12frosted/homebrew-emacs-plus

To restart d12frosted/emacs-plus/emacs-plus@28 after an upgrade:
  brew services restart d12frosted/emacs-plus/emacs-plus@28
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/emacs-plus@28/bin/emacs --fg-daemon

@slinkp
Copy link
Author

slinkp commented Feb 26, 2023

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.

@schrenker
Copy link

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")
`

@appetrosyan
Copy link

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.

@mikepjb
Copy link

mikepjb commented Mar 26, 2023

@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!

@MorpheusMXML
Copy link

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!

@rudolf-adamkovic
Copy link

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")
	 ":"))

@slinkp
Copy link
Author

slinkp commented Jun 21, 2023

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")
         ":"))

@dertuxmalwieder
Copy link

I have noticed that a few of these issues can be fixed by reinstalling the formula. (It also updates your branch.)

@bklebe
Copy link

bklebe commented Nov 3, 2023

I had a similar issue except I couldn't build emacs-plus@29 at all on Sonoma 14.1. brew reinstall gcc fixed it.

@allen-liaoo
Copy link

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.

@d12frosted d12frosted added the native comp Issue is related to native compilation label Aug 25, 2024
@slinkp
Copy link
Author

slinkp commented Oct 21, 2024

Got this problem again today after upgrading MacOS from 14 to 15 and updating xcode-utils.
Workaround:

brew update && brew upgrade
brew reinstall libgccjit
brew reinstall emacs-plus@29 --with-native-comp
# Not sure if necessary, but this forces native recompile on next emacs restart
rm -rf ~/.emacs.d/eln-cache/*  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
native comp Issue is related to native compilation
Projects
None yet
Development

No branches or pull requests

10 participants