BUILD-YIELD C MEDIDO (no especulacion): 6/8 de la tanda construyen+corren como ELF estatico musl. Promovidos: file 5.47, gawk 5.3.2, gzip 1.14, tar 1.35, tree 2.3.2, which 2.23 (+ sus parches musl de Alpine). Texture honesta del tier-2 C (la friccion que el tier-1 Rust no tiene): - gawk/tar/tree/which: zig-cc directo, sin tocar nada. - file: zig-cc MISCOMPILA -> el `file` recien hecho segfaultea generando magic.mgc (mismo sintoma que binutils). Escape compiler="gcc" -> construye. - gzip: (1) configure "C compiler cannot create executables" con zig-cc -> compiler="gcc"; (2) luego el install fallaba por `local i;` de la package() de Alpine. - jq (oniguruma), sed (perl): NO build-friction sino dep faltante en el corpus (completitud) -> quedan pendientes hasta importar esas libs. Fix generico que destrabo gzip (y futuros): el importador Alpine ENVUELVE el cuerpo de build()/package() en una funcion shell. abuild los corre COMO funciones (donde `local` es valido); el lab corre la fase plana bajo sh -c, donde `local` fuera de funcion es error. Envolver restaura el contexto de abuild sin tocar el sandbox ni las fases planas del corpus (solo lo importado). test translate_wraps_body_in_function_for_local. Confirmado: los 6 binarios corren (--version). file/gzip llevan compiler="gcc" en su receta (escape declarativo, gueto conocido). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
45 lines
1.5 KiB
Diff
45 lines
1.5 KiB
Diff
Patch-Source: https://lists.gnu.org/archive/html/which-bugs/2025-03/msg00000.html
|
|
---
|
|
From 16a1647fc26953fab659de5f55d4c0defdfb894f Mon Sep 17 00:00:00 2001
|
|
From: Khem Raj <raj.khem@gmail.com>
|
|
Date: Sat, 22 Mar 2025 17:56:19 -0700
|
|
Subject: [PATCH] getopt: Fix signature of getenv function
|
|
|
|
This happens on musl systems using GCC 15
|
|
|
|
../which-2.21/getopt.h:106:12: error: conflicting types for 'getopt'; have
|
|
'int(void)'
|
|
106 | extern int getopt ();
|
|
| ^~~~~~
|
|
---
|
|
getopt.c | 2 +-
|
|
getopt.h | 2 +-
|
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/getopt.c b/getopt.c
|
|
index 9ac2ed6..7e14270 100644
|
|
--- a/getopt.c
|
|
+++ b/getopt.c
|
|
@@ -205,7 +205,7 @@ static char *posixly_correct;
|
|
/* Avoid depending on library functions or files
|
|
whose names are inconsistent. */
|
|
|
|
-char *getenv();
|
|
+char *getenv(const char*);
|
|
|
|
static char *my_index(str, chr) const char *str;
|
|
int chr;
|
|
diff --git a/getopt.h b/getopt.h
|
|
index f080053..635fc46 100644
|
|
--- a/getopt.h
|
|
+++ b/getopt.h
|
|
@@ -102,7 +102,7 @@ struct option {
|
|
errors, only prototype getopt for the GNU C library. */
|
|
extern int getopt(int argc, char *const *argv, const char *shortopts);
|
|
#else /* not __GNU_LIBRARY__ */
|
|
-extern int getopt();
|
|
+extern int getopt(int, char * const [], const char *);
|
|
#endif /* __GNU_LIBRARY__ */
|
|
extern int getopt_long(int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind);
|
|
extern int getopt_long_only(int argc, char *const *argv, const char *shortopts, const struct option *longopts,
|