Commit graph

10 commits

Author SHA1 Message Date
6eb83c91c3 [ADD] gcc: make libgccjit optional, strip the remaining lib32 work
Arch configures and compiles the whole gcc tree a SECOND time just for
libgccjit, because it needs --enable-host-shared and applying that to
the main compiler would slow it down. That pass is about half of gcc's
build time -- twenty minutes per attempt on this hardware -- and
nothing in the bootstrap or in ERPLibre uses it.

It is now skipped by default and restored with:

    EL_GCC_JIT=1 bash scripts/build-stage1.sh

Verified both ways: off leaves zero libgccjit references in the
PKGBUILD, on leaves the ten upstream ones untouched, including the
--enable-languages=jit line the main-build sed deliberately avoids.

package_gcc() still manipulated the 32-bit tree in several places, and
each fails once multilib is off because usr/lib32 never exists:

  'usr/lib/gcc/s390x-ibm-linux-gnu/16/libatomic.so' -> '../../../libatomic.so'
  ln: No such file or directory

The link named in that error is the one that SUCCEEDED; the failure is
the usr/lib32 line right after it in the same loop. Read alone, it
sends you hunting for a missing libatomic that is in fact present. The
same loop also linked the D runtimes, gone with the D front end.

--- FR ---

Arch configure et compile l arbre gcc entier une SECONDE fois pour le
seul libgccjit, qui reclame --enable-host-shared -- appliquer cette
option au compilateur principal le ralentirait. Cette passe represente
environ la moitie du temps de compilation de gcc, soit vingt minutes
par tentative sur cette machine, et rien dans l amorcage ni dans
ERPLibre ne s en sert.

Elle est desormais ecartee par defaut et se retablit par :

    EL_GCC_JIT=1 bash scripts/build-stage1.sh

Verifie dans les deux sens : desactive, il ne reste aucune reference a
libgccjit dans le PKGBUILD ; active, les dix references amont restent
intactes, y compris la ligne --enable-languages=jit que le sed du
build principal evite deliberement.

package_gcc() manipulait encore l arbre 32 bits en plusieurs endroits,
et chacun echoue une fois le multilib retire, puisque usr/lib32
n existe jamais :

  'usr/lib/gcc/s390x-ibm-linux-gnu/16/libatomic.so' -> '../../../libatomic.so'
  ln: No such file or directory

Le lien nomme dans cette erreur est celui qui a REUSSI ; l echec est la
ligne usr/lib32 juste apres, dans la meme boucle. Lue seule, elle fait
chercher un libatomic manquant qui est pourtant bien la. La meme boucle
liait aussi les runtimes D, partis avec le frontal D.

Assisted-by: Claude Opus 5
2026-08-16 01:54:13 -04:00
63be2a7990 [FIX] gcc: do not rewrite the libgccjit language list
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
2026-08-16 01:18:45 -04:00
a61890d83a [FIX] canonical CHOST, and a reachable libassuan source
CHOST was the Debian-style triplet. gcc -dumpmachine reports
s390x-linux-gnu on this host, but config.sub canonicalises that to
s390x-ibm-linux-gnu and GCC builds its tree under the canonical name.

Arch PKGBUILDs assume the canonical form -- theirs is
x86_64-pc-linux-gnu, vendor field present -- so gcc's own PKGBUILD
looked for $CHOST/libstdc++-v3/doc and found nothing:

  make: *** s390x-linux-gnu/libstdc++-v3/doc: No such file or directory

while the build had created s390x-ibm-linux-gnu/libstdc++-v3/doc. This
is a port-wide setting, not a gcc quirk: every PKGBUILD that derives a
path from CHOST was pointing one directory sideways.

libassuan fetches from dev.gnupg.org, which is unreachable from this
build host -- measured HTTP 000, while github.com/gpg/libassuan.git and
gnupg.org/ftp both answer. That is a network fact, not a port problem,
so only the transport changes: the pinned tag is untouched and what
gets built is what Arch specifies.

Host dependencies again: doxygen for xz, libunistring for libpsl,
systemd-dev for util-linux. Every one of them was invisible until a
build stopped on it, because --nodeps means pacman never checks
makedepends.

--- FR ---

CHOST portait le triplet de style Debian. Sur cet hote, gcc
-dumpmachine rend s390x-linux-gnu, mais config.sub le canonise en
s390x-ibm-linux-gnu, et GCC batit son arbre sous le nom canonique.

Les PKGBUILD d Arch supposent la forme canonique -- la leur est
x86_64-pc-linux-gnu, champ constructeur present -- si bien que le
PKGBUILD de gcc cherchait $CHOST/libstdc++-v3/doc sans rien trouver :

  make: *** s390x-linux-gnu/libstdc++-v3/doc: No such file or directory

alors que la compilation avait cree s390x-ibm-linux-gnu/libstdc++-v3/doc.
C est un reglage de portage, pas une bizarrerie de gcc : tout PKGBUILD
derivant un chemin de CHOST visait un repertoire a cote.

libassuan se telecharge depuis dev.gnupg.org, injoignable depuis cet
hote -- mesure : HTTP 000, quand github.com/gpg/libassuan.git et
gnupg.org/ftp repondent tous deux. C est un fait de reseau, pas un
probleme de portage : seul le transport change, l etiquette epinglee
reste intacte et ce qui se batit est ce qu Arch specifie.

Dependances d hote, encore : doxygen pour xz, libunistring pour libpsl,
systemd-dev pour util-linux. Chacune est restee invisible jusqu a ce
qu une compilation s y arrete, parce que --nodeps interdit a pacman de
verifier les makedepends.

Assisted-by: Claude Opus 5
2026-08-16 00:45:50 -04:00
c9cc17bd01 [ADD] devtools stand-ins, and lib32 removal for glibc and gcc
The same x86 assumption keeps returning in a different disguise: a
32-bit multilib split package. libtool had it, and so do glibc and gcc.
On x86_64 multilib means i686 and Arch wants it; on Z it means the
31-bit ESA/390 ABI that GCC is actively removing:

  configure: error: Support for -m31 is deprecated and will be removed.

glibc is the clearest case. The whole compile SUCCEEDS and the glibc
package is written -- then makepkg aborts in package_lib32-glibc() with
"No rule to make target install", because the 32-bit tree was never
configured. The work was done; only the packaging of a tree nobody
built failed.

gcc needed three cuts: front ends written in themselves (Ada, D,
Modula-2, COBOL have no bootstrap compiler here), multilib, and every
lib32 reference including the _pick lines that split out usr/lib32.

arch-meson and arch-cmake are provided as stand-ins. Several PKGBUILDs
call them, they ship in devtools, and devtools is itself an Arch
package -- so during a bootstrap they cannot exist yet and every
PKGBUILD using them stops on "command not found".

A verification lesson, learned twice: grepping a whole PKGBUILD for
"lib32" declares false failures, because the string survives in
comments and in functions that are never called. Only the pkgname array
matters, since that is what makepkg iterates.

--- FR ---

La meme hypothese x86 revient sans cesse sous un autre deguisement : un
paquet scinde multilib 32 bits. libtool l avait, glibc et gcc aussi.
Sur x86_64 le multilib signifie i686 et Arch le veut ; sur Z il designe
l ABI 31 bits ESA/390 que GCC est en train de retirer.

glibc est le cas le plus net. Toute la compilation REUSSIT et le paquet
glibc est ecrit -- puis makepkg abandonne dans package_lib32-glibc()
sur « No rule to make target install », parce que l arbre 32 bits n a
jamais ete configure. Le travail etait fait ; seul l empaquetage d un
arbre que personne n avait bati a echoue.

gcc demandait trois coupes : les frontaux ecrits en eux-memes (Ada, D,
Modula-2 et COBOL n ont ici aucun compilateur d amorcage), le multilib,
et toute reference a lib32 y compris les lignes _pick qui extraient
usr/lib32.

arch-meson et arch-cmake sont fournis en substituts. Plusieurs PKGBUILD
les appellent, ils vivent dans devtools, et devtools est lui-meme un
paquet Arch -- pendant un amorcage ils ne peuvent donc pas exister, et
chaque PKGBUILD qui les utilise s arrete sur « command not found ».

Une lecon de verification, apprise deux fois : chercher « lib32 » dans
tout un PKGBUILD declare de faux echecs, car la chaine survit dans les
commentaires et dans des fonctions jamais appelees. Seul le tableau
pkgname compte, puisque c est lui que makepkg parcourt.

Assisted-by: Claude Opus 5
2026-08-15 21:15:01 -04:00
f87502622a [ADD] port patches: gcc front ends, binutils gold, libtool multilib
Three more upstream PKGBUILDs assume x86_64, each in a different way,
and each is dropped rather than repaired because the thing being
dropped is architecture-specific by nature.

gcc: Ada and D are written in themselves and need an existing compiler
of the same language. Ubuntu ships gnat, but not one GCC 15 accepts,
and there is no D bootstrap compiler here at all. Modula-2 and COBOL
have the same shape. Front ends reduced to c, c++, fortran, lto, objc
and obj-c++, which is everything this port and ERPLibre compile.

binutils: gold is x86-centric, deprecated upstream since 2.44, and
built by no distribution that ships s390x. ld.bfd is the linker on Z.
binutils builds once gold is disabled -- measured.

libtool: the lib32-libltdl split package is i686-on-x86_64 multilib.
Its build step is already guarded by CARCH, but prepare() copies the
tree to src/libtool32 unconditionally and the package function then
packages a tree nobody built.

Two host-layout bridges were also needed. Ubuntu multiarch puts asm/,
bits/, gnu/ and sys/sdt.h under /usr/include/s390x-linux-gnu, while
glibc builds with -nostdinc and expects the classic layout:

  fatal error: asm/errno.h: No such file or directory
  fatal error: sys/sdt.h: No such file or directory

Symlinks make the host look like Arch for those paths. sys/ needed the
files linked, not the directory, since /usr/include/sys already exists.

--- FR ---

Trois PKGBUILD amont de plus supposent x86_64, chacun a sa maniere, et
chacun est retire plutot que repare : ce qu on retire est par nature
propre a une architecture.

gcc : Ada et D sont ecrits en eux-memes et reclament un compilateur
existant du meme langage. Ubuntu livre gnat, mais pas une version que
GCC 15 accepte, et il n y a ici aucun compilateur D d amorcage.
Modula-2 et COBOL posent le meme probleme. Les frontaux se reduisent a
c, c++, fortran, lto, objc et obj-c++, ce qui couvre tout ce que ce
portage et ERPLibre compilent.

binutils : gold est centre sur x86, abandonne en amont depuis 2.44, et
construit par aucune distribution livrant s390x. Sur Z, l editeur de
liens est ld.bfd. binutils se construit des que gold est desactive --
mesure.

libtool : le paquet scinde lib32-libltdl est du multilib i686 sur
x86_64. Son etape de compilation est deja gardee par CARCH, mais
prepare() copie l arbre vers src/libtool32 sans condition, et la
fonction de paquet empaquette ensuite un arbre que personne n a bati.

Deux ponts de disposition d hote etaient aussi necessaires. Le
multiarch d Ubuntu place asm/, bits/, gnu/ et sys/sdt.h sous
/usr/include/s390x-linux-gnu, quand glibc compile avec -nostdinc et
attend la disposition classique :

  fatal error: asm/errno.h: No such file or directory
  fatal error: sys/sdt.h: No such file or directory

Des liens symboliques donnent a l hote l allure d Arch pour ces
chemins. Pour sys/ il faut lier les fichiers et non le repertoire,
puisque /usr/include/sys existe deja.

Assisted-by: Claude Opus 5
2026-08-15 21:01:18 -04:00
b29ac89e7a [FIX] trust artefacts, not exit codes; add a PKGBUILD patch mechanism
A run reported "51 built, 0 failed" while glibc, gcc, coreutils and
pacman had all failed. The cause is a bash rule that is easy to forget:
callers invoke build_package inside an "if", and "if" DISABLES set -e
for the whole function body. A failing makepkg fell through to
repo-add, whose success became the function exit status.

build_package now returns explicitly on failure and, more importantly,
verifies that a package file actually exists. An exit code is not
proof; only the artefact is. Measured before the fix: 23 files in the
repository where a hundred were claimed.

First real port patch, applied through a per-package hook rather than
by hand: the glibc PKGBUILD passes --enable-sframe, and s390x has no
SFrame at all -- configure refuses outright. Hooks re-clone cleanly, so
an upstream change is never silently discarded.

--nocheck for stage 1: these test suites run against the HOST
libraries, not the Arch ones, so their verdict says nothing about the
port. acl failed its check step on a sound build. Stage 2 runs them for
real.

The remaining failures were host makedepends that --nodeps hides: po4a,
gnat, debuginfod and jansson are now installed up front.

--- FR ---

Une execution annoncait « 51 built, 0 failed » alors que glibc, gcc,
coreutils et pacman avaient tous echoue. La cause est une regle de bash
qu on oublie : build_package est appelee dans un « if », et « if »
DESACTIVE set -e pour tout le corps de la fonction. Un makepkg en echec
poursuivait jusqu a repo-add, dont la reussite devenait le code de
sortie.

build_package rend desormais la main explicitement en cas d echec et,
surtout, verifie qu un fichier de paquet existe vraiment. Un code de
sortie ne prouve rien ; seul l artefact prouve. Mesure avant
correction : 23 fichiers dans le depot la ou cent etaient annonces.

Premier vrai correctif de portage, applique par crochet et non a la
main : le PKGBUILD de glibc passe --enable-sframe, et s390x n a aucun
SFrame -- configure refuse net. Les crochets survivent a un reclonage,
donc une evolution amont n est jamais perdue en silence.

--nocheck pour l etage 1 : ces suites s executent contre les
bibliotheques de l HOTE, pas celles d Arch, et leur verdict ne dit rien
du portage. acl echouait a son etape check sur une compilation saine.
L etage 2 les executera pour de vrai.

Les autres echecs etaient des makedepends d hote que --nodeps masque :
po4a, gnat, debuginfod et jansson sont poses d entree.

Assisted-by: Claude Opus 5
2026-08-15 20:41:10 -04:00
Josephine Pfeiffer
0e3a4c4dd5
full boot with systemd 2025-06-05 12:32:34 +02:00
Josephine Pfeiffer
8b704b3189
rearchitechted things 2025-06-02 19:01:23 +02:00
Josephine Pfeiffer
a7a7a6160b
fix ci & cleanup mkintcpio patching 2025-06-01 19:22:10 +02:00
Josephine Pfeiffer
6831b3fa5c
mvp bootable system 2025-06-01 11:53:38 +02:00