diff --git a/recipes/file.toml b/recipes/file.toml index a661fa31..58381f57 100644 --- a/recipes/file.toml +++ b/recipes/file.toml @@ -21,23 +21,16 @@ flags = [] build = ["make"] [build.phases] -# de build() de Alpine (traducido; el lab provee $CBUILD/$CHOST — Etapa G Fase 3; revisá --shared para estático): -compile = ''' -_abuild_phase() { -./configure \ - --build=$CBUILD \ - --host=$CHOST \ - --prefix=/usr \ - --datadir=/usr/share \ - --enable-static - make -} -_abuild_phase -''' -# de package() de Alpine (traducido $pkgdir→/out): -install = ''' -_abuild_phase() { -make DESTDIR="/out" install -} -_abuild_phase -''' +# De build()/package() de Alpine (el lab provee $CBUILD/$CHOST — Etapa G Fase 3). +# +# POR QUÉ `-all-static` y por qué en compile Y en install: `link = "static"` hace que el lab +# exporte `LDFLAGS=-static`, pero file enlaza con **libtool**, y libtool lee ese `-static` como +# "preferí mis .a", NO como flag al linker ⇒ el `file` salía DINÁMICO (`NEEDED: libc.so`) jurando +# ser estático. Ese `libc.so` es la musl que el toolchain bundlea: en el host son 255B de linker +# script ⇒ el artefacto NO corría fuera del sandbox. El único flag de libtool para un binario 100% +# estático es `-all-static`, y hay que repetirlo en `install` porque libtool RELINKEA al instalar +# (sólo en compile: se instala la versión dinámica y el fix se pierde en silencio). +# NUNCA en configure: rompe los tests de link de autotools. +configure = './configure --build=$CBUILD --host=$CHOST --prefix=/usr --datadir=/usr/share --disable-shared --enable-static' +compile = 'make LDFLAGS="-all-static -no-pie" -j"$(nproc)"' +install = 'make DESTDIR=/out install LDFLAGS="-all-static -no-pie"' diff --git a/recipes/libgcrypt.toml b/recipes/libgcrypt.toml index 1c89be0c..1afa659c 100644 --- a/recipes/libgcrypt.toml +++ b/recipes/libgcrypt.toml @@ -13,9 +13,17 @@ link = "static" flags = [] [build.phases] +# POR QUÉ `-all-static` y por qué en compile Y en install: `link = "static"` hace que el lab +# exporte `LDFLAGS=-static`, pero libgcrypt enlaza con **libtool**, y libtool lee ese `-static` +# como "preferí mis .a", NO como flag al linker ⇒ los binarios (hmac256, dumpsexp, mpicalc) salían +# DINÁMICOS (`NEEDED: libc.so`) jurando ser estáticos. Ese `libc.so` es la musl que el toolchain +# bundlea: en el host son 255B de linker script ⇒ el artefacto NO corría fuera del sandbox. El +# único flag de libtool para un binario 100% estático es `-all-static`, y hay que repetirlo en +# `install` porque libtool RELINKEA al instalar (sólo en compile: se instala la versión dinámica y +# el fix se pierde en silencio). NUNCA en configure: rompe los tests de link de autotools. configure = './configure --build=$CBUILD --host=$CHOST --prefix=/usr --disable-shared --enable-static --with-libgpg-error-prefix=/usr --disable-doc' -compile = 'make' -install = 'make DESTDIR=/out install' +compile = 'make LDFLAGS="-all-static -no-pie" -j"$(nproc)"' +install = 'make DESTDIR=/out install LDFLAGS="-all-static -no-pie"' [deps]