From: Theo Buehler Subject: Re: pgpool still broken; needs strchrnul() [Re: CVS: cvs.openbsd.org: ports] To: Landry Breuil , ports@openbsd.org Date: Sat, 6 Jun 2026 14:51:22 +0200 On Sat, Jun 06, 2026 at 01:14:44PM +0100, Stuart Henderson wrote: > On 2026/06/05 02:24, Landry Breuil wrote: > > CVSROOT: /cvs > > Module name: ports > > Changes by: landry@cvs.openbsd.org 2026/06/05 02:24:15 > > > > Modified files: > > databases/pgpool: Makefile distinfo > > Removed files: > > databases/pgpool/patches: patch-src_include_utils_fe_ports_h > > patch-src_include_watchdog_wd_utils_h > > patch-src_utils_json_writer_c > > patch-src_utils_ssl_utils_c > > patch-src_watchdog_wd_escalation_c > > > > Log message: > > databases/pgpool: update to 4.6.7 and unbreak with llvm 22 > > > > this wants strchrnul() which we don't have - an implementation is > available from Crystal though; > https://research.exoticsilicon.com/downloads/strchrnul_patchset_7.8.sig) There's a compat impl in src/parse/snprintf.c. I suggest we copy a fixed version of that dance. Upstream should likely move all this into the appropriate compat header. (I discussed this with landry, not sure if he missed a cvs add) The port could also use a CFLAGS += -Wno-unknown-warning-option... diff --git a/databases/pgpool/patches/patch-src_utils_pool_process_reporting_c b/databases/pgpool/patches/patch-src_utils_pool_process_reporting_c new file mode 100644 index 0000000000..a11f42dc8d --- /dev/null +++ b/databases/pgpool/patches/patch-src_utils_pool_process_reporting_c @@ -0,0 +1,46 @@ +Index: src/utils/pool_process_reporting.c +--- src/utils/pool_process_reporting.c.orig ++++ src/utils/pool_process_reporting.c +@@ -45,6 +45,42 @@ static void write_one_field_v2(POOL_CONNECTION * front + static char *db_node_status(int node); + static char *db_node_role(int node); + ++/* ++ * XXX - taken from src/parser/snprintf.c ++ * This really belongs into a header. That the snprintf version isn't ++ * const correct is also not the greatest of ideas. ++ */ ++/* ++ * If strchrnul exists (it's a glibc-ism), it's a good bit faster than the ++ * equivalent manual loop. If it doesn't exist, provide a replacement. ++ * ++ * Note: glibc declares this as returning "char *", but that would require ++ * casting away const internally, so we don't follow that detail. ++ */ ++#ifndef HAVE_STRCHRNUL ++ ++static inline char * ++strchrnul(const char *s, int c) ++{ ++ while (*s != '\0' && *s != (char)c) ++ s++; ++ return (char *)s; ++} ++ ++#else ++ ++/* ++ * glibc's declares strchrnul only if _GNU_SOURCE is defined. ++ * While we typically use that on glibc platforms, configure will set ++ * HAVE_STRCHRNUL whether it's used or not. Fill in the missing declaration ++ * so that this file will compile cleanly with or without _GNU_SOURCE. ++ */ ++#ifndef _GNU_SOURCE ++extern char *strchrnul(const char *s, int c); ++#endif ++ ++#endif /* HAVE_STRCHRNUL */ ++ + void + send_row_description(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, + short num_fields, char **field_names)