GNU bug report logs - #47783
28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver

Previous Next

Package: emacs;

Reported by: Pankaj Jangid <pankaj <at> codeisgreat.org>

Date: Thu, 15 Apr 2021 02:51:02 UTC

Severity: normal

Merged with 48370

Found in version 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47783 in the body.
You can then email your comments to 47783 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Thu, 15 Apr 2021 02:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pankaj Jangid <pankaj <at> codeisgreat.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 15 Apr 2021 02:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pankaj Jangid <pankaj <at> codeisgreat.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking
 gcc driver
Date: Thu, 15 Apr 2021 08:20:26 +0530
I am on macos and after launching Emacs, I get this libgccjit
error. Is this something that I can ignore for now?

--8<---------------cut here---------------start------------->8---
Warning (comp): libgccjit.so: error: error invoking gcc driver Disable showing Disable logging
Warning (comp):
/Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/cl-lib.el.gz:
Error: Internal native compiler error failed to compile Disable
showing Disable logging
--8<---------------cut here---------------end--------------->8---

Further, there are lots of compiler warnings from different package, as
I use Emacs. That means the native compilation is definitely working
asynchronously. One observation here is that every time this happens the
CPU goes 99% for a short time.

I am not using ‘gcc’. I have yet to successfully build Emacs with
‘gcc-10’ on macos. I did this to build Emacs:

git clone ...
./autogen.sh
CC=/usr/bin/clang ./configure --with-native-compilation
make -j8 # I have 4 core, hyperthreading enabled system

Probably ‘clang’ and ‘libgccjit’ has a problem working together.


In GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin20.3.0, NS appkit-2022.30 Version 11.2.3 (Build 20D91))
 of 2021-04-15 built on mb2.local
Repository revision: 686259e65aa7121683c0c65e45ce48adb08ddb58
Repository branch: feature/native-comp
Windowing system distributor 'Apple', version 10.3.2022
System Description:  macOS 11.2.3

Configured using:
 'configure --with-native-compilation'

Configured features:
ACL DBUS GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY KQUEUE NS PDUMPER PNG RSVG THREADS TIFF TOOLKIT_SCROLL_BARS XIM
ZLIB

Important settings:
  value of $LANG: en_US
  locale-coding-system: utf-8-unix

Major mode: Summary

Minor modes in effect:
  hl-line-mode: t
  savehist-mode: t
  desktop-save-mode: t
  direnv-mode: t
  shell-dirtrack-mode: t
  which-key-mode: t
  TeX-PDF-mode: t
  override-global-mode: t
  show-paren-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow flyspell ispell emacsbug gnus-html help-fns radix-tree url-cache
sort smiley gnus-cite mail-extr gnus-async gnus-bcklg qp gnus-ml hl-line
disp-table nndraft nnmh utf-7 nnml nnfolder epa-file gnutls
network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual
nntp gnus-cache .gnus diary-lib diary-loaddefs ol-eww ol-rmail ol-mhe
ol-irc ol-info ol-gnus nnselect gnus-search ol-docview doc-view
jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m dired-aux
ebdb-message sendmail ebdb-gnus gnus-msg gnus-art mm-uu mml2015 mm-view
mml-smime smime dig gnus-sum gnus-group gnus-undo gnus-start gnus-dbus
dbus gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec
gnus-int gnus-range message rmc dired dired-loaddefs rfc822 mml mml-sec
epa epg epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231
gmm-utils mailheader gnus-win flymake-proc flymake vc-git mhtml-mode
elec-pair display-line-numbers css-mode smie eww xdg url-queue shr
kinsoku svg xml puny mm-url gnus nnheader gnus-util rmail rmail-loaddefs
rfc2047 rfc2045 ietf-drums mail-utils wid-edit mm-util mail-prsvr js
sgml-mode facemenu dom init savehist desktop frameset ob-plantuml ob-sql
ob-css ob-js ob-java ob-C cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs ob-python python ob-R
modus-operandi-theme modus-themes ebdb-mua ebdb-com ebdb-format ebdb
mailabbrev eieio-opt speedbar ezimage dframe eieio-base pcase timezone
direnv diff-mode dash po-mode cider tramp-sh cider-debug cider-browse-ns
cider-mode cider-inspector cider-completion cider-profile cider-eval
compile text-property-search cider-repl-history pulse derived cider-repl
cider-resolve cider-test cider-overlays cider-stacktrace cider-doc
cider-browse-spec cider-clojuredocs cider-eldoc cider-client
cider-common etags fileloop xref project cider-connection cider-util
color cider-popup sesman-browser nrepl-client tramp tramp-loaddefs
trampver tramp-integration files-x tramp-compat shell parse-time iso8601
ls-lisp queue nrepl-dict cider-compat spinner parseedn parseclj-parser
parseclj-lex a sesman vc vc-dispatcher edmacro kmacro clojure-mode
lisp-mnt align imenu rust-mode thingatpt org-mime ox-org ox-odt rng-loc
rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns
nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html table ox-ascii
ox-publish ox org-element avl-tree generator org ob ob-tangle ob-ref
ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint
org-pcomplete pcomplete comint ansi-color ring org-list org-faces
org-entities time-date org-version ob-emacs-lisp ob-core ob-eval
org-table ol org-keys org-compat org-macs org-loaddefs format-spec
find-func cal-menu calendar cal-loaddefs noutline outline which-key
advice delight hideshow tex crm texmathp finder-inf use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core server avoid
paren cus-start cus-load tex-site info early-init package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap url-handlers url-parse auth-source eieio
eieio-core eieio-loaddefs password-cache json map url-vars comp
comp-cstr warnings subr-x rx cl-seq cl-macs cl-extra help-mode seq
byte-opt gv cl-loaddefs cl-lib bytecomp byte-compile cconv iso-transl
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar
mouse jit-lock font-lock syntax font-core term/tty-colors frame
minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite charscript charprop case-table epa-hook jka-cmpr-hook help
simple abbrev obarray cl-preloaded nadvice button loaddefs faces
cus-face macroexp files window text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind kqueue cocoa ns lcms2 multi-tty
make-network-process nativecomp emacs)

Memory information:
((conses 16 863875 44320)
 (symbols 48 46941 1)
 (strings 32 213402 17021)
 (string-bytes 1 7034681)
 (vectors 16 85059)
 (vector-slots 8 1328330 122166)
 (floats 8 565 232)
 (intervals 56 2247 77)
 (buffers 992 50))

-- 
Regards,
Pankaj Jangid

GnuPG Fingerprint: 0B62 7424 3B26 A911 052A DDE6 7C95 6E6F F858 7689




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Thu, 15 Apr 2021 07:00:02 GMT) Full text and rfc822 format available.

Message #8 received at 47783 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pankaj Jangid <pankaj <at> codeisgreat.org>
Cc: 47783 <at> debbugs.gnu.org, Andrea Corallo <akrl <at> sdf.org>
Subject: Re: bug#47783: 28.0.50;
 [feature/native-comp] libgccjit.so: error: error invoking gcc driver
Date: Thu, 15 Apr 2021 09:58:48 +0300
> From: Pankaj Jangid <pankaj <at> codeisgreat.org>
> Date: Thu, 15 Apr 2021 08:20:26 +0530
> 
> 
> I am on macos and after launching Emacs, I get this libgccjit
> error. Is this something that I can ignore for now?
> 
> --8<---------------cut here---------------start------------->8---
> Warning (comp): libgccjit.so: error: error invoking gcc driver Disable showing Disable logging
> Warning (comp):
> /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/cl-lib.el.gz:
> Error: Internal native compiler error failed to compile Disable
> showing Disable logging
> --8<---------------cut here---------------end--------------->8---
> 
> Further, there are lots of compiler warnings from different package, as
> I use Emacs. That means the native compilation is definitely working
> asynchronously. One observation here is that every time this happens the
> CPU goes 99% for a short time.
> 
> I am not using ‘gcc’. I have yet to successfully build Emacs with
> ‘gcc-10’ on macos. I did this to build Emacs:
> 
> git clone ...
> ./autogen.sh
> CC=/usr/bin/clang ./configure --with-native-compilation
> make -j8 # I have 4 core, hyperthreading enabled system
> 
> Probably ‘clang’ and ‘libgccjit’ has a problem working together.

So if you don't use GCC, where and how did you get libgccjit, and what
version of GCC does it belong to?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Thu, 15 Apr 2021 07:10:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error:
 error invoking gcc driver
Date: Thu, 15 Apr 2021 07:09:27 +0000
Pankaj Jangid <pankaj <at> codeisgreat.org> writes:

> I am on macos and after launching Emacs, I get this libgccjit
> error. Is this something that I can ignore for now?
>
> Warning (comp): libgccjit.so: error: error invoking gcc driver Disable showing Disable logging
> Warning (comp):
> /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/cl-lib.el.gz:
> Error: Internal native compiler error failed to compile Disable
> showing Disable logging

Hi Pankaj,

this look like an env misconfiguration that prevents libgccjit for
finding the driver.

Could you please report the full error in the
*Async-native-compile-log* buffer?

Also have already you tried invoking "emacs -Q"?

Thanks

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Thu, 15 Apr 2021 12:57:01 GMT) Full text and rfc822 format available.

Message #14 received at 47783 <at> debbugs.gnu.org (full text, mbox):

From: Pankaj Jangid <pankaj <at> codeisgreat.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 47783 <at> debbugs.gnu.org, Andrea Corallo <akrl <at> sdf.org>
Subject: Re: bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error:
 error invoking gcc driver
Date: Thu, 15 Apr 2021 18:26:04 +0530
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Probably ‘clang’ and ‘libgccjit’ has a problem working together.
>
> So if you don't use GCC, where and how did you get libgccjit, and what
> version of GCC does it belong to?

The configure script gave error about not finding ‘libgccjit’. So I
installed it using ‘Homebrew’. The version info as reported by brew
command is - ‘libgccjit: stable 10.2.0’.

After installing ‘libgccjit’, the configure script worked and Emacs
compiled without any errors.

I thought there is no ABI issue so went ahead. Are they incompatible?
‘clang’ and ‘libgccjit’.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Thu, 15 Apr 2021 13:53:02 GMT) Full text and rfc822 format available.

Message #17 received at 47783 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pankaj Jangid <pankaj <at> codeisgreat.org>
Cc: 47783 <at> debbugs.gnu.org, akrl <at> sdf.org
Subject: Re: bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error:
 error invoking gcc driver
Date: Thu, 15 Apr 2021 16:52:31 +0300
> From: Pankaj Jangid <pankaj <at> codeisgreat.org>
> Cc: 47783 <at> debbugs.gnu.org,  Andrea Corallo <akrl <at> sdf.org>
> Date: Thu, 15 Apr 2021 18:26:04 +0530
> 
> I thought there is no ABI issue so went ahead. Are they incompatible?
> ‘clang’ and ‘libgccjit’.

I don't know, but maybe Andrea does.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Thu, 15 Apr 2021 15:01:01 GMT) Full text and rfc822 format available.

Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pankaj Jangid <pankaj <at> codeisgreat.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#47783: 28.0.50;
 [feature/native-comp] libgccjit.so: error: error invoking gcc driver
Date: Thu, 15 Apr 2021 19:36:10 +0530
Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

>> I am on macos and after launching Emacs, I get this libgccjit
>> error. Is this something that I can ignore for now?
>>
>> Warning (comp): libgccjit.so: error: error invoking gcc driver Disable showing Disable logging
>> Warning (comp):
>> /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/cl-lib.el.gz:
>> Error: Internal native compiler error failed to compile Disable
>> showing Disable logging
>
> this look like an env misconfiguration that prevents libgccjit for
> finding the driver.
>
> Could you please report the full error in the
> *Async-native-compile-log* buffer?
>
> Also have already you tried invoking "emacs -Q"?

I usually launch ‘Emacs.app’ from GUI (Launchpad on macos). But when I
have to pass argument e.g. ‘-Q’ I use command-line. After your above
message I tried ‘emacs -Q’ and it worked without any error.

And you are right, it was environment related problem. Following is the
snippet from ‘*Async-native-compile-log*’:

--8<---------------cut here---------------start------------->8---
Compiling /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/cl-lib.el.gz...
uncompressing cl-lib.el.gz...
uncompressing cl-lib.el.gz...done
ld: library not found for -lgcc_ext.10.5
libgccjit.so: error: error invoking gcc driver
/Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/cl-lib.el.gz: Error: Internal native compiler error failed to compile
Compiling /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/seq.el.gz...
uncompressing seq.el.gz...
uncompressing seq.el.gz...done
--8<---------------cut here---------------end--------------->8---

But now I am puzzled at one more thing. Now I am not getting the error
even when I start from GUI. Does it save the location of ‘libgccjit’
somewhere, once it is found?

--
Regards
Pankaj





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Thu, 15 Apr 2021 16:14:01 GMT) Full text and rfc822 format available.

Message #23 received at 47783 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 47783 <at> debbugs.gnu.org, Pankaj Jangid <pankaj <at> codeisgreat.org>
Subject: Re: bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error:
 error invoking gcc driver
Date: Thu, 15 Apr 2021 16:12:57 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Pankaj Jangid <pankaj <at> codeisgreat.org>
>> Cc: 47783 <at> debbugs.gnu.org,  Andrea Corallo <akrl <at> sdf.org>
>> Date: Thu, 15 Apr 2021 18:26:04 +0530
>> 
>> I thought there is no ABI issue so went ahead. Are they incompatible?
>> ‘clang’ and ‘libgccjit’.
>
> I don't know, but maybe Andrea does.

AFAIK this configuration should work.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Thu, 15 Apr 2021 16:18:01 GMT) Full text and rfc822 format available.

Message #26 received at 47783 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Pankaj Jangid <pankaj <at> codeisgreat.org>
Cc: 47783 <at> debbugs.gnu.org
Subject: Re: bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error:
 error invoking gcc driver
Date: Thu, 15 Apr 2021 16:17:06 +0000
Pankaj Jangid <pankaj <at> codeisgreat.org> writes:

> Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs <at> gnu.org> writes:
>
>>> I am on macos and after launching Emacs, I get this libgccjit
>>> error. Is this something that I can ignore for now?
>>>
>>> Warning (comp): libgccjit.so: error: error invoking gcc driver Disable showing Disable logging
>>> Warning (comp):
>>> /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/cl-lib.el.gz:
>>> Error: Internal native compiler error failed to compile Disable
>>> showing Disable logging
>>
>> this look like an env misconfiguration that prevents libgccjit for
>> finding the driver.
>>
>> Could you please report the full error in the
>> *Async-native-compile-log* buffer?
>>
>> Also have already you tried invoking "emacs -Q"?
>
> I usually launch ‘Emacs.app’ from GUI (Launchpad on macos). But when I
> have to pass argument e.g. ‘-Q’ I use command-line. After your above
> message I tried ‘emacs -Q’ and it worked without any error.
>
> And you are right, it was environment related problem. Following is the
> snippet from ‘*Async-native-compile-log*’:
>
> Compiling /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/cl-lib.el.gz...
> uncompressing cl-lib.el.gz...
> uncompressing cl-lib.el.gz...done
> ld: library not found for -lgcc_ext.10.5
> libgccjit.so: error: error invoking gcc driver
> /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/cl-lib.el.gz: Error: Internal native compiler error failed to compile
> Compiling /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/seq.el.gz...
> uncompressing seq.el.gz...
> uncompressing seq.el.gz...done
>
> But now I am puzzled at one more thing. Now I am not getting the error
> even when I start from GUI. Does it save the location of ‘libgccjit’
> somewhere, once it is found?

AFAIK no,

I don't know what happened here but I bet has to do with the value of
one of these three env vars [1] and most likely PATH.

  Andrea

[1] <https://gcc.gnu.org/onlinedocs/jit/internals/index.html#environment-variables>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Fri, 16 Apr 2021 08:17:02 GMT) Full text and rfc822 format available.

Message #29 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pankaj Jangid <pankaj <at> codeisgreat.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#47783: 28.0.50;
 [feature/native-comp] libgccjit.so: error: error invoking gcc driver
Date: Fri, 16 Apr 2021 13:46:35 +0530
Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

> I don't know what happened here but I bet has to do with the value of
> one of these three env vars [1] and most likely PATH.
>
> [1] <https://gcc.gnu.org/onlinedocs/jit/internals/index.html#environment-variables>
>

I am working with pre-built version of ‘gcc’ and ‘libgccjit’ from
Homebrew. So I tried to set the following environment
variables. Experimented with various permutation combinations of these.

#+begin_src elisp
(add-to-list 'exec-path
             "/usr/local/opt/gcc/bin")
(setenv "PATH" (mapconcat 'identity exec-path ":"))        
(setenv "LD_LIBRARY_PATH"
        "/usr/local/opt/libgccjit/lib/gcc/10:/usr/local/opt/gcc/lib/gcc/10")
(setenv "LIBRARY_PATH"
        "/usr/local/opt/libgccjit/lib/gcc/10:/usr/local/opt/gcc/lib/gcc/10")
#end_src

The above are standard location of ‘gcc’ and ’libgccjit’ artifacts.

The exec-path configuration above crashes my Emacs at startup. So I had
to comment that out.


Is there a way in Emacs to get all the environment variables in one go?
I want to compare the vars from two invocations - GUI and CLI. As I
reported earlier that CLI invocation works without any error.


More facts:

The error comes only at the beginning. As you can see in the following
log (*Async-native-compilation-log) that compilation is working fine
later on.

--8<---------------cut here---------------start------------->8---
Compiling /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/cl-lib.el.gz...
uncompressing cl-lib.el.gz...
uncompressing cl-lib.el.gz...done
ld: library not found for -lgcc_ext.10.5
libgccjit.so: error: error invoking gcc driver
/Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/cl-lib.el.gz: Error: Internal native compiler error failed to compile
Compiling /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/crm.el.gz...
uncompressing crm.el.gz...
uncompressing crm.el.gz...done
Compiling /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/progmodes/hideshow.el.gz...
uncompressing hideshow.el.gz...
uncompressing hideshow.el.gz...done
Compiling /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/advice.el.gz...
uncompressing advice.el.gz...
uncompressing advice.el.gz...done
Compiling /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/outline.el.gz...
uncompressing outline.el.gz...
uncompressing outline.el.gz...done
Compiling /Users/pankaj/Applications/Emacs.app/Contents/Resources/lisp/calendar/cal-menu.el.gz...
uncompressing cal-menu.el.gz...
uncompressing cal-menu.el.gz...done
--8<---------------cut here---------------end--------------->8---

And when all the compilation is done the error goes away; it does not
appear in further sessions.






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Fri, 16 Apr 2021 09:26:02 GMT) Full text and rfc822 format available.

Message #32 received at 47783 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Pankaj Jangid <pankaj <at> codeisgreat.org>
Cc: 47783 <at> debbugs.gnu.org
Subject: Re: bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error:
 error invoking gcc driver
Date: Fri, 16 Apr 2021 09:25:40 +0000
Pankaj Jangid <pankaj <at> codeisgreat.org> writes:

> Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs <at> gnu.org> writes:
>
>> I don't know what happened here but I bet has to do with the value of
>> one of these three env vars [1] and most likely PATH.
>>
>> [1] <https://gcc.gnu.org/onlinedocs/jit/internals/index.html#environment-variables>
>>
>
> I am working with pre-built version of ‘gcc’ and ‘libgccjit’ from
> Homebrew. So I tried to set the following environment
> variables. Experimented with various permutation combinations of these.
>
> #+begin_src elisp
> (add-to-list 'exec-path
>              "/usr/local/opt/gcc/bin")
> (setenv "PATH" (mapconcat 'identity exec-path ":"))        
> (setenv "LD_LIBRARY_PATH"
>         "/usr/local/opt/libgccjit/lib/gcc/10:/usr/local/opt/gcc/lib/gcc/10")
> (setenv "LIBRARY_PATH"
>         "/usr/local/opt/libgccjit/lib/gcc/10:/usr/local/opt/gcc/lib/gcc/10")
> #end_src
>
> The above are standard location of ‘gcc’ and ’libgccjit’ artifacts.
>
> The exec-path configuration above crashes my Emacs at startup. So I had
> to comment that out.
> 
>
> Is there a way in Emacs to get all the environment variables in one
> go?

One can use the `process-environment' variable. Also might be useful for
you `initial-environment'.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Sat, 17 Apr 2021 16:59:02 GMT) Full text and rfc822 format available.

Message #35 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pankaj Jangid <pankaj <at> codeisgreat.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#47783: 28.0.50;
 [feature/native-comp] libgccjit.so: error: error invoking gcc driver
Date: Sat, 17 Apr 2021 22:27:53 +0530
Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

>> Is there a way in Emacs to get all the environment variables in one
>> go?
>
> One can use the `process-environment' variable. Also might be useful for
> you `initial-environment'.

Finally, as you pointed out, PATH env is the root cause. When I start
from GUI the PATH is set to:

     "/usr/bin:/bin:/usr/sbin:/sbin"

But when I start from CLI, the Bash init files are executed and hence
the PATH is:

    "/Users/pankaj/.sdkman/candidates/kotlin/current/bin:/Users/pankaj/.sdkman/candidates/groovy/current/bin:/Users/pankaj/.sdkman/candidates/gradle/current/bin:/Users/pankaj/.sdkman/candidates/ant/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin:/Users/pankaj/Applications/Emacs.app/Contents/MacOS:/Users/pankaj/Applications/Emacs.app/Contents/MacOS/bin:/Users/pankaj/go/bin:/Users/pankaj/.cargo/bin"

There are lots of things. But the PATH, which we are interested in, is
the location of compiler; and that is "/usr/local/bin". So I hard-coded
PATH in a CLI session:

   export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

And then launched ‘Emacs’ from there. Worked perfectly fine.

So, my question is - is there a way to adjust the ‘initial-environment’
variable? The docstring says that it is inherited from the parent
process. So that makes it kind-of read-only.

Other solution could be to hold-on the compilation till full
‘~/emacs.d/init.el’ (or whichever is the init file) is
evaluated. Because users configure the environment variables during that
process.

--
Regards
Pankaj





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Sat, 17 Apr 2021 17:11:01 GMT) Full text and rfc822 format available.

Message #38 received at 47783 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pankaj Jangid <pankaj <at> codeisgreat.org>
Cc: 47783 <at> debbugs.gnu.org
Subject: Re: bug#47783: 28.0.50;
 [feature/native-comp] libgccjit.so: error: error invoking gcc driver
Date: Sat, 17 Apr 2021 20:10:06 +0300
> From: Pankaj Jangid <pankaj <at> codeisgreat.org>
> Date: Sat, 17 Apr 2021 22:27:53 +0530
> 
> Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs <at> gnu.org> writes:
> 
> >> Is there a way in Emacs to get all the environment variables in one
> >> go?
> >
> > One can use the `process-environment' variable. Also might be useful for
> > you `initial-environment'.
> 
> Finally, as you pointed out, PATH env is the root cause. When I start
> from GUI the PATH is set to:
> 
>      "/usr/bin:/bin:/usr/sbin:/sbin"
> 
> But when I start from CLI, the Bash init files are executed and hence
> the PATH is:
> 
>     "/Users/pankaj/.sdkman/candidates/kotlin/current/bin:/Users/pankaj/.sdkman/candidates/groovy/current/bin:/Users/pankaj/.sdkman/candidates/gradle/current/bin:/Users/pankaj/.sdkman/candidates/ant/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin:/Users/pankaj/Applications/Emacs.app/Contents/MacOS:/Users/pankaj/Applications/Emacs.app/Contents/MacOS/bin:/Users/pankaj/go/bin:/Users/pankaj/.cargo/bin"
> 
> There are lots of things. But the PATH, which we are interested in, is
> the location of compiler; and that is "/usr/local/bin". So I hard-coded
> PATH in a CLI session:
> 
>    export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
> 
> And then launched ‘Emacs’ from there. Worked perfectly fine.

But the problem is not when Emacs is run from CLI, it's when it's run
from GUI, right?  Because /usr/local/bin is not in PATH then.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Sat, 17 Apr 2021 17:34:02 GMT) Full text and rfc822 format available.

Message #41 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pankaj Jangid <pankaj <at> codeisgreat.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#47783: 28.0.50;
 [feature/native-comp] libgccjit.so: error: error invoking gcc driver
Date: Sat, 17 Apr 2021 23:03:40 +0530
Eli Zaretskii <eliz <at> gnu.org> writes:

>> 
>>    export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
>> 
>> And then launched ‘Emacs’ from there. Worked perfectly fine.
>
> But the problem is not when Emacs is run from CLI, it's when it's run
> from GUI, right?  Because /usr/local/bin is not in PATH then.

I think I need to do at least one more experiment. Launch ‘emacs’ from a
wrapper script ... launched from GUI.

Wrapper scripts sets PATH and launch ‘emacs’. Let me do it and report in
a while.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Sat, 17 Apr 2021 18:50:02 GMT) Full text and rfc822 format available.

Message #44 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pankaj Jangid <pankaj <at> codeisgreat.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#47783: 28.0.50;
 [feature/native-comp] libgccjit.so: error: error invoking gcc driver
Date: Sun, 18 Apr 2021 00:19:41 +0530
Pankaj Jangid <pankaj <at> codeisgreat.org> writes:

>>>    export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
>>> 
>>> And then launched ‘Emacs’ from there. Worked perfectly fine.
>>
>> But the problem is not when Emacs is run from CLI, it's when it's run
>> from GUI, right?  Because /usr/local/bin is not in PATH then.
>
> I think I need to do at least one more experiment. Launch ‘emacs’ from a
> wrapper script ... launched from GUI.
>
> Wrapper scripts sets PATH and launch ‘emacs’. Let me do it and report in
> a while.

I have yet to find a way to set the environment variable PATH in macos
so that the GUI apps find it. It appears that it is not straightforward.

Anyway, this is not a blocker for merging into master.

I’ll update here once I am done with the PATH settings.






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Wed, 05 May 2021 13:11:02 GMT) Full text and rfc822 format available.

Message #47 received at 47783 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Pankaj Jangid <pankaj <at> codeisgreat.org>
Cc: 47783 <at> debbugs.gnu.org
Subject: Re: bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error:
 error invoking gcc driver
Date: Wed, 05 May 2021 15:10:40 +0200
Pankaj Jangid <pankaj <at> codeisgreat.org> writes:

> I’ll update here once I am done with the PATH settings.

This was a couple of weeks ago -- skimming this thread, it's unclear to
me whether there's anything more to do in this bug report.  Did you
resolve this issue?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 05 May 2021 13:11:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47783; Package emacs. (Thu, 06 May 2021 07:01:02 GMT) Full text and rfc822 format available.

Message #52 received at 47783 <at> debbugs.gnu.org (full text, mbox):

From: Pankaj Jangid <pankaj <at> codeisgreat.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 47783 <at> debbugs.gnu.org
Subject: Re: bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error:
 error invoking gcc driver
Date: Thu, 06 May 2021 12:30:13 +0530
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Pankaj Jangid <pankaj <at> codeisgreat.org> writes:
>
>> I’ll update here once I am done with the PATH settings.
>
> This was a couple of weeks ago -- skimming this thread, it's unclear to
> me whether there's anything more to do in this bug report.  Did you
> resolve this issue?

While this was easy to test on Linux. I have not yet done on MacOS. But
I am 100% sure now that this is environment related issue. I’ll post my
finidngs when done. But this is not a blocker in any way. Workaround is
to launch from commandline if users face the issue.





Merged 47783 48370. Request was from Andrea Corallo <akrl <at> sdf.org> to control <at> debbugs.gnu.org. (Wed, 12 May 2021 12:56:02 GMT) Full text and rfc822 format available.

Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 10 Jun 2021 07:21:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 48370 <at> debbugs.gnu.org and Konrad Podczeck <konrad.podczeck <at> univie.ac.at> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 11 Jul 2022 14:35:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 09 Aug 2022 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 254 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.