base-system: git construye — VCS real (git 2.54.0 estático)

b3:64b797d2. Reescribí las fases garabateadas (compile hacía _perl_config; install compilaba la
suite de tests) a make all/install limpios con NO_GETTEXT/TCLTK/PYTHON. deps zlib/openssl/curl/
pcre2. Gotchas: FUZZ_PROGRAMS= (oss-fuzz usa --allow-multiple-definition que ld.lld rechaza);
-fsanitize=undefined en compile+install IDÉNTICO (libz.a trae refs __ubsan_* + git relinkea si
GIT-CFLAGS difiere entre fases). El hueco más grande del userland, cerrado.
This commit is contained in:
2026-07-10 22:59:41 -04:00
parent f28d1bb50b
commit a6747a18ce
+20 -26
View File
@@ -18,37 +18,31 @@ link = "static"
flags = []
[build.phases]
# de build() de Alpine (traducido; el lab provee $CBUILD/$CHOST — Etapa G Fase 3; revisá --shared para estático):
# build de git LIMPIO estático-musl: Makefile propio (no autotools). Desactivamos
# gettext/tcltk/python (no los tenemos); curl/openssl/pcre2/zlib resuelven por las
# deps materializadas en /usr del lab.
# Flags idénticas en compile e install: git graba CFLAGS/LDFLAGS en GIT-CFLAGS y
# fuerza relink si difieren entre invocaciones. -fsanitize=undefined enlaza el
# runtime ubsan de zig (la libz.a/etc. materializadas traen __ubsan_handle_* que
# bajo -static no se resuelven solas).
compile = '''
_abuild_phase() {
make prefix=/usr \
DESTDIR="/out" \
perllibdir="$(_perl_config vendorlib)" \
all
make -C contrib/subtree prefix=/usr DESTDIR="/out"
make -C contrib/diff-highlight prefix=/usr DESTDIR="/out"
if [ -n "$_full_build" ]; then
# generate manpages outside of package()
make prefix=/usr man
make prefix=/usr -C contrib/credential/libsecret
fi
}
_abuild_phase
make prefix=/usr CC="${CC:-cc}" \
NO_GETTEXT=1 NO_TCLTK=1 NO_PYTHON=1 NO_INSTALL_HARDLINKS=1 \
NO_R_TO_GCC_LINKER=1 FUZZ_PROGRAMS= \
CFLAGS="$CFLAGS -static -fsanitize=undefined" \
LDFLAGS="$LDFLAGS -static -fsanitize=undefined" \
all
'''
# de package() de Alpine (traducido $pkgdir→/out):
install = '''
_abuild_phase() {
make -C t prefix=/usr DESTDIR="/out" \
perlibdir="$(_perl_config vendorlib)" \
all
}
_abuild_phase
make prefix=/usr DESTDIR="/out" CC="${CC:-cc}" \
NO_GETTEXT=1 NO_TCLTK=1 NO_PYTHON=1 NO_INSTALL_HARDLINKS=1 \
NO_R_TO_GCC_LINKER=1 FUZZ_PROGRAMS= \
CFLAGS="$CFLAGS -static -fsanitize=undefined" \
LDFLAGS="$LDFLAGS -static -fsanitize=undefined" \
install
'''
# depends de runtime de Alpine (NO build-deps): perl
[deps]
build = ["asciidoc", "python3", "tcl", "tk", "libsecret", "glib"]
build = ["zlib", "openssl", "curl", "pcre2", "linux-headers"]