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

Internal native compiler error upon launching emacsGcc with emacs config #151

Closed
matthew-piziak opened this issue May 14, 2021 · 4 comments

Comments

@matthew-piziak
Copy link

Sorry that the description here is a bit thin, but maybe someone has run into the same issue.

I can compile emacsGcc fine, and emacs --no-init-file runs fine, but when I try to install a package with use-package (e.g. delight) I get internal compilation errors.

Upon launch:

Warning (comp): collect2: error: ld returned 1 exit status Disable showing Disable logging
Warning (comp): libgccjit.so: error: error invoking gcc driver Disable showing Disable logging
Warning (comp): /nix/store/22swvj2scz8vxirl09phjp2ij7kcj5mb-emacs-gcc-20210510.0/share/emacs/28.0.50/lisp/emacs-lisp/seq.el.gz: Error: Internal native compiler error failed to compile Disable showing Disable logging

Here's what I get when I run emacs --debug-init, when it hits a use-package git-timemachine form:

Debugger entered--Lisp error: (native-compiler-error (lambda (&optional) (let ((f #'abort-recursive-edit)) (funcall f))) "Loading /nix/store/22swvj2scz8vxirl09phjp2ij7kcj5m...")
  signal(native-compiler-error ((lambda (&optional) (let ((f #'abort-recursive-edit)) (funcall f))) "Loading /nix/store/22swvj2scz8vxirl09phjp2ij7kcj5m..."))
  comp--native-compile((lambda (&optional) (let ((f #'abort-recursive-edit)) (funcall f))) nil "/home/matt/.emacs.d/eln-cache/28.0.50-7b14f512/sub...")
  comp-trampoline-compile(abort-recursive-edit)
  comp-subr-trampoline-install(abort-recursive-edit)
  advice--add-function(:before (#f(compiled-function () #<bytecode 0x32e14019df7e91>) . #f(compiled-function (gv--val) #<bytecode 0x9f608bbba7cb3c2>)) transient--abort-edebug nil)
  advice-add(abort-recursive-edit :before transient--abort-edebug)
  byte-code("\300\301\302\303#\210\300\304\302\303#\207" [advice-add abort-recursive-edit :before transient--abort-edebug top-level] 4)
  require(transient)
  load-with-code-conversion("/home/matt/.emacs.d/straight/build/git-timemachine..." "/home/matt/.emacs.d/straight/build/git-timemachine..." t t)
  require(git-timemachine nil t)

Deleting the eln cache does not help. Deleting the whole .emacs.d directory does not help.

The line libgccjit.so: error: error invoking gcc driver is concerning.

I have no problem with the emacsUnstable derivation.

@leungbk
Copy link
Member

leungbk commented May 15, 2021

This looks similar to #148. If you use the nixos-unstable channel, you should be able to get everything to work.

@matthew-piziak
Copy link
Author

Thanks @leungbk! Weird, when I try nixos-unstable I get attribute 'emacsGcc' missing.

@chuwy
Copy link

chuwy commented May 28, 2021

A similar problem on nixpkgs-20.09-darwin:

> Installing straight...
> Building straight...  > Cloning use-package...
Native compiler error: (lambda (arg32 &rest arg33) (let ((f #'message)) (apply f arg32 arg33))), "Loading /nix/store/xn2c5msnad54ijryngnyylmja0g1lc9r-emacs-gcc-20210522.0/share/emacs/site-lisp/site-start.el (source)...
Compiling /Users/antonparkhomenko/.emacs.d/.local/cache/eln/28.0.50-a8d10e3a/subr--trampoline-6d657373616765_message_0.eln...
ld: library not found for -lgcc_ext.10.5
libgccjit.so: error: error invoking gcc driver
Debugger entered--Lisp error: (native-ice \"failed to compile\" \"/Users/antonparkhomenko/.emacs.d/.local/cache/eln/...\" \"error invoking gcc driver\")
  comp--compile-ctxt-to-file(\"/Users/antonparkhomenko/.emacs.d/.local/cache/eln/...\")
  comp-compile-ctxt-to-file(\"/Users/antonparkhomenko/.emacs.d/.local/cache/eln/...\")
  comp-final1()
  load-with-code-conversion(\"/var/folders/k7/v1rr45_12xxb2w7jc9bxxv600000gp/T/e...\" \"/var/folders/k7/v1rr45_12xxb2w7jc9bxxv600000gp/T/e...\" nil t)
  command-line-1((\"-l\" \"/var/folders/k7/v1rr45_12xxb2w7jc9bxxv600000gp/T/e...\"))
  command-line()
  normal-top-level()
❯ gcc --version    # Installed via nixpkgs.gcc10
gcc (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Snapshot from around a month ago worked fine.

UPD: One of those cases where a solution arises right after posting the problem on bugtracker. Installing libgccjit solved the problem.

@adisbladis
Copy link
Member

Since this issue seems to stem from running incorrect channels I think we can close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants