From f75e256d087c66ac5b098eafba9338c342e47cf4 Mon Sep 17 00:00:00 2001 From: sergio Date: Fri, 26 Jun 2026 00:48:38 -0400 Subject: [PATCH] =?UTF-8?q?Etapa=20G:=20git=20diferido=20en=20serio=20?= =?UTF-8?q?=E2=80=94=20diagn=C3=B3stico=20afinado=20(muro=20en=20libgit.a)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aislado: NO es curl/regex/-pie/libs externas (gcc -static -no-pie -lpcre2-8 -lz linkea OK). El muro es libgit.a (objetos propios de git) con relocación incompatible con -static -no-pie. Pase dedicado: V=1 + readelf -r del .o ofensor, o -static-pie. Se puede; es iteración cara. --- recipes/incoming/.deferred/git.toml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/recipes/incoming/.deferred/git.toml b/recipes/incoming/.deferred/git.toml index c099d4ee..c46ddb35 100644 --- a/recipes/incoming/.deferred/git.toml +++ b/recipes/incoming/.deferred/git.toml @@ -18,7 +18,7 @@ make -j"$(nproc)" prefix=/usr CC=gcc \ NO_GETTEXT=1 NO_TCLTK=1 NO_PYTHON=1 NO_PERL=1 NO_GITWEB=1 NO_SYS_POLL_H=1 NO_REGEX=NeedsStartEnd NO_CURL=1 NO_EXPAT=1 \ USE_LIBPCRE2=1 \ CFLAGS="-O2 -fno-pie" \ - LDFLAGS="-static -no-pie -L/usr/lib" \ + LDFLAGS="-static -no-pie -Wl,-z,norelro -L/usr/lib" \ all ''' install = ''' @@ -28,11 +28,12 @@ make prefix=/usr DESTDIR=/out NO_GETTEXT=1 NO_TCLTK=1 NO_PYTHON=1 NO_PERL=1 NO_G [deps] build = ["zlib", "openssl", "pcre2"] -# DEFERIDO (2026-06-26): git COMPILA entero (resueltos: REG_STARTEND via ./configure del lab que el -# campo configure NO debe pisar; -fno-pie; libs zlib/openssl/pcre2). MURO: el link totalmente -# estático de los binarios helper (git-http-backend, git-daemon, git-%) falla con -# `ld: failed to set dynamic section sizes: bad value`. NO es curl (NO_CURL=1 no lo arregla) ni regex. -# Hipótesis: gcc15/musl emite .note.gnu.property (CET) y/o las libs estáticas tienen consistencia -# PIC mixta ⇒ ld rompe al armar el ejecutable -static. Próximo intento: build con V=1 para ver el -# comando de link exacto de git-http-backend; probar -fcf-protection=none / -Wl,-z,... / rebuildar -# las libs con -fPIC consistente. El core `git` linkea antes del fallo (binario existe). + +# DEFERIDO EN SERIO (2026-06-26): git COMPILA entero. Muro = link -static de los binarios que usan +# libgit.a (git-http-backend/daemon/git-%): `ld: failed to set dynamic section sizes: bad value`. +# DIAGNÓSTICO AFINADO: NO es curl/regex/-pie/-z relro NI las libs externas — `gcc -static -no-pie +# -lpcre2-8 -lz` linkea OK en aislamiento. El culpable es libgit.a (objetos PROPIOS de git): algún +# .o tiene una relocación que rompe -static -no-pie (sospecha: PIC mixto / IFUNC / TLS bajo gcc15+musl, +# pese a CFLAGS=-fno-pie). PRÓXIMO PASE DEDICADO: build con V=1, identificar el .o ofensor (readelf +# -r), y/o probar -static-pie en vez de -static -no-pie, y/o forzar -fno-pic en TODOS los objetos. +# SE PUEDE (muchas distros static-linkean git); es iteración cara, no imposible.