public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: StrawberryTea <look@strawberrytea.xyz>, jit@gcc.gnu.org
Subject: Re: lto1: internal compiler error: original not compressed with zstd
Date: Tue, 19 Mar 2024 16:43:11 -0400	[thread overview]
Message-ID: <fb1c6d439ee9fac7fbddc0acda71366af59185b7.camel@redhat.com> (raw)
In-Reply-To: <87cyrsbfd9.fsf@strawberrytea.xyz>

On Sun, 2024-03-17 at 18:36 -0500, StrawberryTea wrote:
> Hello GCC libjit people,

Hi StrawberryTea

I'm the author/maintainer of libgccjit.  I confess that I don't think
I've ever tried using LTO with libgccjit, but rustc_codegen_gcc appears
to, given:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8415bceea9d3ca86adc00ae8ad92deaec0457dd1

> 
> Whenever I try to compile Elisp packages with GCC libjit and -flto, I
> get "lto1: internal compiler error: original not compressed with
> zstd".

FWIW that message appears in the sources in gcc/lto-compress.cc's
lto_uncompression_zstd here:
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/lto-compress.cc;#l162

but I'm unfamiliar with that part of the compiler.


> I have an Emacs bug report on
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69689 and a Gentoo bug
> report on https://bugs.gentoo.org/926953 but nobody has been able to
> resolve this. There are hints that this might be related to the way
> Gentoo builds GCC, but I'm not sure.

I suspect that debugging this further would be very hard, due to it
involving a large amount of non-trivial code and interactions between
gcc, the linker, emacs C, the emacs AOT compilation code, and how
gentoo packages all of these.  You'd need to turn on debug logging from
libgccjit which I don't know how to do from Emacs [2], and that might
give clues as to what's going wrong (or might not!)

Do you know if the Emacs native compilation project has tried turning
on LTO? [1]  What does that actually mean?  (e.g. LTO between compiled
Emacs lisp modules?  Or between a compiled Emacs lisp module and Emacs
C code?  Are both built using the same GCC version? etc)

The simplest fix is probably to turn off LTO.

Sorry not to be of more help
Dave

[1] https://www.emacswiki.org/emacs/GccEmacs
[2] FWIW, from C you'd do it with gcc_jit_context_set_logfile:
https://gcc.gnu.org/onlinedocs/jit/topics/contexts.html#c.gcc_jit_context_set_logfile


      reply	other threads:[~2024-03-19 20:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-17 23:36 StrawberryTea
2024-03-19 20:43 ` David Malcolm [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb1c6d439ee9fac7fbddc0acda71366af59185b7.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=jit@gcc.gnu.org \
    --cc=look@strawberrytea.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).