Created attachment 2066456 [details] build.log, s390x Description of problem: Package emacs fails to build from source with GCC 15 on most platforms. Version-Release number of selected component (if applicable): 29.4-47.fc42 Steps to Reproduce: koji build --scratch f42 emacs-29.4-47.fc42.src.rpm Additional info: This package is tracked by Koschei. See: https://koschei.fedoraproject.org/package/emacs On aarch64 and ppc64le, the error is: libgccjit.so: <built-in>:0:0: error: in jit_langhook_pushdecl, at jit/dummy-frontend.cc:1375 On s390x, the error is: Unknown type: <integer_type 0x3ffb74109d8 TI size <integer_cst 0x3ffb7402990 type <integer_type 0x3ffb74100a8 bitsizetype> constant 128> unit-size <integer_cst 0x3ffb74029a8 type <integer_type 0x3ffb7410000 sizetype> constant 16> align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x3ffb74109d8 precision:128 min <integer_cst 0x3ffb7403540 -170141183460469231731687303715884105728> max <integer_cst 0x3ffb7403560 170141183460469231731687303715884105727>> libgccjit.so: <built-in>:0:0: error: in tree_type_to_jit_type, at jit/dummy-frontend.cc:1305 On x86_64 and i686, this issue is not encountered.
Created attachment 2066457 [details] build.log, ppc64le
Looks like the same problem as bug 2336714.
Feels like at least related to https://gcc.gnu.org/PR117886
*** Bug 2339739 has been marked as a duplicate of this bug. ***
I was able to reproduce this on a mock build of emacspeak on aarch64, with a crash in the in-memory compiler: libgccjit.so: <built-in>:0:0: error: in jit_langhook_pushdecl, at jit/dummy-frontend.cc:1375 I copied in a build of libgccjit.so.0.0.1 with the fix from upstream commit https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=27470f9a818538fadb0e458a272358c7141fcd8c and it gets *much* further: the in-memory "compile" seems to have succeeded, and it's failing running the driver (to turn the .s file into a .so) with: Error: error ("Eager macro-expansion failure: (native-compiler-error (lambda (arg0 &rest arg1) (let ((f #'funcall-interactively)) (apply f arg0 arg1))) \"Compiling /builddir/.emacs.d/eln-cache/29.4-70b1d7ab/subr--trampoline-66756e63616c6c2d696e7465726163746976656c79_funcall_interactively_0.eln... /usr/bin/ld: cannot find crtbeginS.o: No such file or directory /usr/bin/ld: cannot find -lgcc: No such file or directory /usr/bin/ld: cannot find -lgcc_s: No such file or directory libgccjit.so: error: error invoking gcc driver Internal native compiler error: \\\"failed to compile\\\", \\\"/builddir/.emacs.d/eln-cache/29.4-70b1d7ab/subr--trampoline-66756e63616c6c2d696e7465726163746976656c79_funcall_interactively_0.eln\\\", \\\"error invoking gcc driver\\\" presumably due to me using a libgccjit.so with totally wrong configure settings (or maybe I've messed up my chroot). So this may well be fixed by that upstream commit; i.e. r15-7126-g27470f9a818538. I'm wondering if there's any info from the emacs side on how to tweak libgccjit's debugging/logging options to better see what's going on internally? (there are a bunch of such options inside libgccjit, but I'm not sure how they're wired up in emacs, if at all; see https://gcc.gnu.org/onlinedocs/jit/topics/contexts.html#debugging from the libgccjit C API side)
(In reply to Dave Malcolm from comment #5) > I was able to reproduce this on a mock build of emacspeak on aarch64, with a > crash in the in-memory compiler: > > libgccjit.so: <built-in>:0:0: error: in jit_langhook_pushdecl, at > jit/dummy-frontend.cc:1375 > > I copied in a build of libgccjit.so.0.0.1 with the fix from upstream commit > https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff; > h=27470f9a818538fadb0e458a272358c7141fcd8c > > and it gets *much* further: the in-memory "compile" seems to have succeeded, > and it's failing running the driver (to turn the .s file into a .so) with: > > Error: error ("Eager macro-expansion failure: (native-compiler-error (lambda > (arg0 &rest arg1) (let ((f #'funcall-interactively)) (apply f arg0 arg1))) > \"Compiling > /builddir/.emacs.d/eln-cache/29.4-70b1d7ab/subr--trampoline- > 66756e63616c6c2d696e7465726163746976656c79_funcall_interactively_0.eln... > /usr/bin/ld: cannot find crtbeginS.o: No such file or directory > /usr/bin/ld: cannot find -lgcc: No such file or directory > /usr/bin/ld: cannot find -lgcc_s: No such file or directory > libgccjit.so: error: error invoking gcc driver > Internal native compiler error: \\\"failed to compile\\\", > \\\"/builddir/.emacs.d/eln-cache/29.4-70b1d7ab/subr--trampoline- > 66756e63616c6c2d696e7465726163746976656c79_funcall_interactively_0.eln\\\", > \\\"error invoking gcc driver\\\" > > presumably due to me using a libgccjit.so with totally wrong configure > settings (or maybe I've messed up my chroot). Aha: if I run: LIBRARY_PATH=/usr/lib/gcc/aarch64-redhat-linux/15/ make emacspeak with my hacked up libgccjit.so.0.0.1 it seems to be building the .el files successfully: emacspeak-loaddefs.el outloud-voices.el espeak-voices.el mac-voices.el voice-setup.el voice-defs.el emacspeak-pronounce.el emacspeak-speak.el emacspeak-sounds.el emacspeak.el emacspeak-setup.el emacspeak-keymap.el In end of data: emacspeak-2048.el:155:7: Warning: the function ‘2048-init-tile’ is not known to be defined. emacspeak-2048.el:94:8: Warning: the function ‘2048-print-board’ is not known to be defined. amixer.el emacspeak-2048.el emacspeak-abc-mode.el emacspeak-add-log.el emacspeak-analog.el emacspeak-annotate.el [...etc...; hasn't finished yet] So it looks like we need a gcc build with upstream commit r15-7126-g27470f9a818538 to fix emacs compilation on non-x86_64 archs.
Though I see that the s390x failure is a different one; taking a closer look...
*** Bug 2340119 has been marked as a duplicate of this bug. ***
gcc-15.0.1-0.4.fc42 in rawhide should have the various libgccjit fixes in it (it is r15-7207 based).
Emacs builds successfully on all architectures with the GCC now in rawhide. Thanks.