* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
@ 2021-04-15 2:50 Pankaj Jangid
2021-04-15 6:58 ` Eli Zaretskii
2021-04-15 7:09 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 2 replies; 16+ messages in thread
From: Pankaj Jangid @ 2021-04-15 2:50 UTC (permalink / raw)
To: 47783
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
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-04-15 2:50 bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver Pankaj Jangid
@ 2021-04-15 6:58 ` Eli Zaretskii
2021-04-15 12:56 ` Pankaj Jangid
2021-04-15 7:09 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2021-04-15 6:58 UTC (permalink / raw)
To: Pankaj Jangid; +Cc: 47783, Andrea Corallo
> From: Pankaj Jangid <pankaj@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?
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-04-15 6:58 ` Eli Zaretskii
@ 2021-04-15 12:56 ` Pankaj Jangid
2021-04-15 13:52 ` Eli Zaretskii
0 siblings, 1 reply; 16+ messages in thread
From: Pankaj Jangid @ 2021-04-15 12:56 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 47783, Andrea Corallo
Eli Zaretskii <eliz@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’.
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-04-15 12:56 ` Pankaj Jangid
@ 2021-04-15 13:52 ` Eli Zaretskii
2021-04-15 16:12 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2021-04-15 13:52 UTC (permalink / raw)
To: Pankaj Jangid; +Cc: 47783, akrl
> From: Pankaj Jangid <pankaj@codeisgreat.org>
> Cc: 47783@debbugs.gnu.org, Andrea Corallo <akrl@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.
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-04-15 13:52 ` Eli Zaretskii
@ 2021-04-15 16:12 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 0 replies; 16+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-04-15 16:12 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 47783, Pankaj Jangid
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Pankaj Jangid <pankaj@codeisgreat.org>
>> Cc: 47783@debbugs.gnu.org, Andrea Corallo <akrl@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
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-04-15 2:50 bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver Pankaj Jangid
2021-04-15 6:58 ` Eli Zaretskii
@ 2021-04-15 7:09 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-15 14:06 ` Pankaj Jangid
1 sibling, 1 reply; 16+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-04-15 7:09 UTC (permalink / raw)
To: 47783
Pankaj Jangid <pankaj@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
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-04-15 7:09 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-04-15 14:06 ` Pankaj Jangid
2021-04-15 16:17 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 16+ messages in thread
From: Pankaj Jangid @ 2021-04-15 14:06 UTC (permalink / raw)
To: 47783
Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@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
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-04-15 14:06 ` Pankaj Jangid
@ 2021-04-15 16:17 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-16 8:16 ` Pankaj Jangid
0 siblings, 1 reply; 16+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-04-15 16:17 UTC (permalink / raw)
To: Pankaj Jangid; +Cc: 47783
Pankaj Jangid <pankaj@codeisgreat.org> writes:
> Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs@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>
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-04-15 16:17 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-04-16 8:16 ` Pankaj Jangid
2021-04-16 9:25 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 16+ messages in thread
From: Pankaj Jangid @ 2021-04-16 8:16 UTC (permalink / raw)
To: 47783
Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@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.
\f
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.
\f
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.
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-04-16 8:16 ` Pankaj Jangid
@ 2021-04-16 9:25 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-17 16:57 ` Pankaj Jangid
0 siblings, 1 reply; 16+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-04-16 9:25 UTC (permalink / raw)
To: Pankaj Jangid; +Cc: 47783
Pankaj Jangid <pankaj@codeisgreat.org> writes:
> Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs@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.
> \f
>
> 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
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-04-16 9:25 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-04-17 16:57 ` Pankaj Jangid
2021-04-17 17:10 ` Eli Zaretskii
0 siblings, 1 reply; 16+ messages in thread
From: Pankaj Jangid @ 2021-04-17 16:57 UTC (permalink / raw)
To: 47783
Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@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
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-04-17 16:57 ` Pankaj Jangid
@ 2021-04-17 17:10 ` Eli Zaretskii
2021-04-17 17:33 ` Pankaj Jangid
0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2021-04-17 17:10 UTC (permalink / raw)
To: Pankaj Jangid; +Cc: 47783
> From: Pankaj Jangid <pankaj@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@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.
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-04-17 17:10 ` Eli Zaretskii
@ 2021-04-17 17:33 ` Pankaj Jangid
2021-04-17 18:49 ` Pankaj Jangid
0 siblings, 1 reply; 16+ messages in thread
From: Pankaj Jangid @ 2021-04-17 17:33 UTC (permalink / raw)
To: 47783
Eli Zaretskii <eliz@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.
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-04-17 17:33 ` Pankaj Jangid
@ 2021-04-17 18:49 ` Pankaj Jangid
2021-05-05 13:10 ` Lars Ingebrigtsen
0 siblings, 1 reply; 16+ messages in thread
From: Pankaj Jangid @ 2021-04-17 18:49 UTC (permalink / raw)
To: 47783
Pankaj Jangid <pankaj@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.
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-04-17 18:49 ` Pankaj Jangid
@ 2021-05-05 13:10 ` Lars Ingebrigtsen
2021-05-06 7:00 ` Pankaj Jangid
0 siblings, 1 reply; 16+ messages in thread
From: Lars Ingebrigtsen @ 2021-05-05 13:10 UTC (permalink / raw)
To: Pankaj Jangid; +Cc: 47783
Pankaj Jangid <pankaj@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
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver
2021-05-05 13:10 ` Lars Ingebrigtsen
@ 2021-05-06 7:00 ` Pankaj Jangid
0 siblings, 0 replies; 16+ messages in thread
From: Pankaj Jangid @ 2021-05-06 7:00 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 47783
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Pankaj Jangid <pankaj@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.
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2021-05-06 7:00 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-15 2:50 bug#47783: 28.0.50; [feature/native-comp] libgccjit.so: error: error invoking gcc driver Pankaj Jangid
2021-04-15 6:58 ` Eli Zaretskii
2021-04-15 12:56 ` Pankaj Jangid
2021-04-15 13:52 ` Eli Zaretskii
2021-04-15 16:12 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-15 7:09 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-15 14:06 ` Pankaj Jangid
2021-04-15 16:17 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-16 8:16 ` Pankaj Jangid
2021-04-16 9:25 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-17 16:57 ` Pankaj Jangid
2021-04-17 17:10 ` Eli Zaretskii
2021-04-17 17:33 ` Pankaj Jangid
2021-04-17 18:49 ` Pankaj Jangid
2021-05-05 13:10 ` Lars Ingebrigtsen
2021-05-06 7:00 ` Pankaj Jangid
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).