GNU bug report logs - #55657
libgccjit is unusable

Previous Next

Package: guix;

Reported by: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Date: Thu, 26 May 2022 13:08:01 UTC

Severity: normal

Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: John Kehayias <john.kehayias <at> protonmail.com>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: Andrew Whatson <whatson <at> gmail.com>, Tobias Geerinckx-Rice <me <at> tobias.gr>,
 "remco <at> remworks.net" <remco <at> remworks.net>,
 "55657 <at> debbugs.gnu.org" <55657 <at> debbugs.gnu.org>
Subject: Re: libgccjit is unusable
Date: Wed, 03 Aug 2022 21:13:35 +0000
Hi everyone,

Found out some useful info and a work around for the original reported issue of the simple "hello world" of gccjit not working.


------- Original Message -------
On Tuesday, June 28th, 2022 at 1:16 AM, John Kehayias wrote:

> Hi,
>
> ------- Original Message -------
> On Tuesday, June 28th, 2022 at 12:17 AM, Liliana Marie Prikler wrote:
>
> > Keyword here is "has worked for emacs". I've tried porting the logic
> > from flatwhatson's channel over, but regardless of what I do, it
> > already fails in the configure step of Emacs (in a manner that's
> > reproducible outside as well). Thus, I think this is a bug in
> > libgccjit (or perhaps our packaging of it) that simply happened to be
> > ignored during development of Emacs 28, but no longer in the release.
>
>
> Sorry, I should be extra clear that I mean has in the past and continues to work for Emacs. I've been using emacs-pgtk-native-comp through the flatwhatson channel from well before v28 was released. Currently I'm using emacs-pgtk-native-comp-28.1.50-223.3ddccb5. Everything has built, installed, and run fine for as long as I have been using it. Just in case that was in question, and as a point of reference.
>
> Anyway, I'll try to reproduce when I can (tomorrow likely) what you reported in the first message using this setup, if that is of use.
>

I was able to reproduce the original error, though I used the libgccjit package from the flatwhatson channel, at v11.3.0 (along with GCC at that version). For good measure, I also used the tutorial at that version, just in case https://gcc.gnu.org/onlinedocs/gcc-11.3.0/jit/intro/tutorial01.html  I chose this version since that is what emacs-native-comp from that channel is built with.

Searching for these error messages of missing libraries/files, I found

https://ref.strikr.io/jit/internals/index.html#environment-variables

and a bug report at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87808

I didn't dive into the details and I'm not expert here, but it gave me the clues to work around it. Seems that where gccjit looks for things has some assumptions (bugs?) which we can fix at runtime with:

LIBRARY_PATH=$GUIX_ENVIRONMENT/lib/gcc/x86_64-unknown-linux-gnu/11.3.0:$LIBRARY_PATH ./gccjittest

The errors reported before were solved with this LIBRARY_PATH addition of the lib/gcc subdirectory. So, the test program runs in

guix shell gcc-toolchain <at> 11 libgccjit <at> 11 --pure

where I compiled to gccjittest following the tutorial directions (no change to LIBRARY_PATH).

So, looking at the emacs-native-comp definition in flatwhatson, we can see that a phase is used to set LIBRARY_PATH before configure just as I did here: https://github.com/flatwhatson/guix-channel/blob/master/flat/packages/emacs.scm#L65

Hope this is helpful and unblocks libgccjit and emacs-native-comp for Guix!

John




This bug report was last modified 2 years and 284 days ago.

Previous Next


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