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

From: Andrea Corallo <[email-masked]>
Date: Thu, 15 Apr 2021 16:17:06 +0000

Pankaj Jangid <[email-masked]> writes:

> Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <[email-masked]> 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>