swm_version: 1 base: distro_version: dev pins: {} mutations: - type: source_patch tarball: https://sourceforge.net/projects/procps-ng/files/Production/procps-ng-4.0.6.tar.xz/download sha256: 67bea6fbc3a42a535a0230c9e891e5ddfb4d9d39422d46565a2990d1ace15216 patches: - "--- a/Makefile.am\t2025-11-25 18:32:31.829279209 +0000\n+++ b/Makefile.am\t2025-11-25 18:33:52.519524988 +0000\n@@ -411,7 +411,6 @@\n # Test programs not used by dejagnu but run directly\n TESTS = \\\n \tlibrary/tests/test_escape \\\n-\tlibrary/tests/test_pids \\\n \tlibrary/tests/test_uptime \\\n \tlibrary/tests/test_sysinfo \\\n \tlibrary/tests/test_version \\\n" build: compiler: zig-cc target: x86_64-linux-musl link: static flags: [] phases: configure: "# El parche toca un .am ⇒ make cree que debe regenerar con automake (ausente del corpus).\n# Reordenamos timestamps (fuentes viejas < aclocal < *.in < configure) para saltar la regen.\nfind . \\( -name '*.am' -o -name '*.m4' -o -name 'configure.ac' -o -name '*.in.in' \\) -exec touch -t 200001010000 {} +\nfind . -name 'aclocal.m4' -exec touch -t 200001020000 {} +\nfind . \\( -name '*.in' -o -name 'config.h.in' \\) -exec touch -t 200001030000 {} +\nfind . -name 'configure' -exec touch -t 200001040000 {} +\n# ncurses del corpus es static (no-PIE); sus reubicaciones R_X86_64_32 (_nc_globals) NO\n# entran en un binario PIE. El lab linka static-PIE por defecto ⇒ apagamos PIE.\nexport CFLAGS=\"${CFLAGS:-} -fno-pie -fno-PIE -fno-sanitize=undefined\"\nexport LDFLAGS=\"${LDFLAGS:-} -no-pie\"\n# -fno-sanitize=undefined (patrón de libarchive/dwarves): zig-cc activa UBSan por defecto (el lab\n# no pasa -O ⇒ modo debug) y procps-ng tiene UB benigno de C viejo ⇒ los binarios ABORTABAN en\n# runtime donde gcc no. Medido: `ps -eo pid,comm --sort=-rss` →\n# \"panic: applying non-zero offset 1 to null pointer\" en src/ps/sortformat.c:421 long_sort_parse,\n# que es `walk = sep_loc + 1;` con sep_loc=NULL (strpbrk no halla separador en el ÚLTIMO ítem);\n# el valor queda muerto porque el while(items--) termina ⇒ inocuo, gcc lo computa y sigue.\n# Apagamos UBSan (no fixeamos el UB upstream: sería whack-a-mole en paths no ejercitados).\n# AC_FUNC_REALLOC (matar-gcc 2026-07-16). MEDIDO en el sandbox: la musl que zig bundlea,\n# enlazada ESTÁTICA, devuelve NULL para realloc(p,0) y realloc(0,0) (la musl de Alpine+gcc\n# devuelve no-NULL; por eso con gcc esto no saltaba). No es un falso negativo: el test de\n# autoconf acierta. Pero al concluir \"realloc no GNU-compatible\" hace `#define realloc\n# rpl_realloc`… y procps-ng NO trae esa función: su configure pide realloc.o vía AC_LIBOBJ\n# (LIBOBJS='${LIBOBJDIR}realloc$U.o') pero ningún Makefile.am usa @LIBOBJS@ ni existe\n# realloc.c en el árbol ⇒ `undefined symbol: rpl_realloc` al linkar (sysctl/pwdx/watch).\n# procps-ng NO necesita la semántica GNU: su xrealloc() ya guarda `if (!ret && size)`\n# (local/xalloc.h) ⇒ tolera NULL cuando size==0. Suprimimos sólo el renombrado.\n# OJO: NO afirmamos que realloc(p,0) sea no-NULL acá — afirmamos que procps no depende de eso.\nexport ac_cv_func_realloc_0_nonnull=yes\nexport ac_cv_func_malloc_0_nonnull=yes\nexport NCURSES_CFLAGS=\"$(pkg-config --cflags ncursesw)\"\nexport NCURSES_LIBS=\"-lncursesw\"\n./configure \\\n\t--build=$CBUILD \\\n\t--host=$CHOST \\\n\t--prefix=/usr \\\n\t--bindir=/bin \\\n\t--sbindir=/sbin \\\n\t--mandir=/usr/share/man \\\n\t--sysconfdir=/etc \\\n\t--localstatedir=/var \\\n\t--datarootdir=/usr/share \\\n\t--disable-nls \\\n\t--without-systemd \\\n\t--disable-shared \\\n\t--enable-static \\\n\t--disable-w-from \\\n\t--disable-rpath \\\n\t--with-ncurses\n" compile: make LDFLAGS="-all-static -no-pie" -j"$(nproc)" install: | make -j1 DESTDIR="/out" install="install -D" LDFLAGS="-all-static -no-pie" install # pkill es idéntico a pgrep. ln -sf pgrep "/out"/bin/pkill 2>/dev/null || true target_bin: /usr/bin/procps-ng expected_hash: b3:6a8ebd6a53beafbc54792128466919d14ee7e8cab58507c2372be0f7f3e028ff deps: build: - ncurses - linux-headers - pkgconf - make runtime: []