From 63be2a7990e939c5992d87f3849306b4d42d1f27 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Sun, 16 Aug 2026 01:18:45 -0400 Subject: [PATCH] [FIX] gcc: do not rewrite the libgccjit language list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PKGBUILD configures gcc twice: once for the compiler, once for libgccjit with --enable-languages=jit. The hook rewrote every occurrence, so the second tree built a compiler instead of a library and package() died on cp: cannot stat 'gcc/libgccjit.so*': No such file or directory after forty minutes of compiling -- the worst kind of failure, at the very end, from a patch that looked right. The sed now skips any line containing jit. A patch that rewrites "every occurrence" of anything in a PKGBUILD should be suspected by default: these files configure the same source tree several times, for different outputs. --- FR --- Le PKGBUILD configure gcc deux fois : une fois pour le compilateur, une fois pour libgccjit avec --enable-languages=jit. Le crochet reecrivait toutes les occurrences, si bien que le second arbre batissait un compilateur au lieu d une bibliotheque, et package() mourait sur cp: cannot stat 'gcc/libgccjit.so*': No such file or directory apres quarante minutes de compilation -- le pire genre d echec, tout a la fin, venu d un correctif qui semblait juste. Le sed ecarte desormais toute ligne contenant jit. Un correctif qui reecrit « toutes les occurrences » de quoi que ce soit dans un PKGBUILD doit etre suspecte d office : ces fichiers configurent plusieurs fois le meme arbre source, pour des sorties differentes. Assisted-by: Claude Opus 5 --- patches/pkgbuild/gcc.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/patches/pkgbuild/gcc.sh b/patches/pkgbuild/gcc.sh index 6b30c64..121bb43 100755 --- a/patches/pkgbuild/gcc.sh +++ b/patches/pkgbuild/gcc.sh @@ -26,7 +26,13 @@ # removals are permanent -- they are architectural. set -euo pipefail -sed -i 's/^\(\s*--enable-languages=\).*\\$/\1c,c++,fortran,lto,objc,obj-c++ \\/' PKGBUILD +# Only the MAIN build. The PKGBUILD configures gcc twice: once for the +# compiler, once for libgccjit with --enable-languages=jit. Rewriting +# every occurrence clobbered the second one, so the jit tree built a +# compiler instead of a library and package() died on +# cp: cannot stat 'gcc/libgccjit.so*': No such file or directory +# after forty minutes of compiling. Match the language list, never 'jit'. +sed -i '/--enable-languages=jit/!s/^\(\s*--enable-languages=\).*\\$/\1c,c++,fortran,lto,objc,obj-c++ \\/' PKGBUILD if grep -qE 'enable-languages=[^ ]*(ada|,d,|m2|cobol)' PKGBUILD; then echo "gcc: a self-hosted front end is still enabled" >&2; exit 1 fi