Subject: bug#55657: closed ([PATCH 0/6] Add native compilation to Emacs)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 09 Aug 2022 18:45:03 +0000

Your bug report

#55657: libgccjit is unusable

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
55657: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55657
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: [PATCH 0/6] Add native compilation to Emacs
From: Liliana Marie Prikler <[email-masked]>
To: [email-masked]
Date: Tue, 9 Aug 2022 20:37:43 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Guix,

at long last the following patch set should enable native compilation
for both Emacs and emacs-build-system.  I tested emacs-dash and at the
very least native code is generated, though I haven't yet checked
whether it is also loaded.

As with any shiny new Emacs feature, please verify that the Emacs
portion of your manifests/home configurations build and report any
related errors *before* I push this and curse your configuration.

Cheers

Liliana Marie Prikler (6):
  gnu: Parameterize libgccjit.
  gnu: libgccjit: Build with bootstrapped gcc.
  gnu: libgccjit: Build multiple versions.
  gnu: emacs: Build with native compilation.
  guix: emacs-utils: Add emacs-compile-directory.
  build-system: emacs: Use native compilation.

 gnu/packages/emacs.scm            | 64 ++++++++++++++++++++++++++++++-
 gnu/packages/gcc.scm              | 53 +++++++++++++++++--------
 guix/build/emacs-build-system.scm |  5 ++-
 guix/build/emacs-utils.scm        | 26 +++++++++++++
 4 files changed, 128 insertions(+), 20 deletions(-)

-- 
2.37.0

Subject: libgccjit is unusable
From: Liliana Marie Prikler <[email-masked]>
To: [email-masked]
Date: Thu, 26 May 2022 15:07:06 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Guix,

with the release of Emacs 28.1, there has been some demand to enable
native-compilation.  While trying to set that up, I've come to realize
that no matter how I slice it, I can't make libgccjit usable.

My test:

$ cd /tmp
$ # fetch the "Hello World" [1] and insert it into gccjit-test.c
$ guix shell --pure gcc-toolchain@9 libgccjit@9 -- \
  gcc gccjit-test.c -o gccjit-test -lgccjit
$ ./gccjit-test
x86_64-unknown-linux-gnu-gcc-9.4.0: fatal error: cannot execute 'as':
execvp: No such file or directory
compilation terminated.

Welp, okay, so maybe testing gccjit outside of its installation does
not work.  What if we try it inside the shell (we can always propagate
libgccjit, no?)

guix shell gcc-toolchain@9 libgccjit@9 -- ./gccjit-test            
ld: cannot find crtbeginS.o: Datei oder Verzeichnis nicht gefunden
ld: cannot find -lgcc
ld: cannot find -lgcc
collect2: Fehler: ld gab 1 als Ende-Status zurück
libgccjit.so: error: error invoking gcc driver
NULL result

For the record, Emacs 28 fails with a different error during
configuration, though interestingly they use a smaller program and
appear to omit -lgccjit.
./conftest: error while loading shared libraries: libgccjit.so.0:
cannot open shared object file: No such file or directory

I'm at a loss.  Is there any way to make libgccjit actually usable?

[1] https://gcc.gnu.org/onlinedocs/jit/intro/tutorial01.html