From 982e2e8c75f157940ef100f59dea94c4eb607058 Mon Sep 17 00:00:00 2001 From: Darren Banfi Date: Fri, 12 Jun 2026 12:12:06 +0100 Subject: [PATCH] AmigaOS: curl_setup.h avoid explicit_bzero with clib2 clib2 defines __NEWLIB__ after its system headers are included, but it does not provide explicit_bzero(). curl therefore selects the explicit_bzero() path and fails to build with m68k-amigaos-gcc: ``` ../lib/curl_setup.h:1650:35: error: implicit declaration of function 'explicit_bzero' [-Werror=implicit-function-declaration] 1650 | #define curlx_memzero(buf, size) explicit_bzero(buf, size) | ^~~~~~~~~~~~~~ curlx/strdup.c:115:5: note: in expansion of macro 'curlx_memzero' 115 | curlx_memzero(buf, size); | ^~~~~~~~~~~~~ ``` Excluding __CLIB2__ from the generic __NEWLIB__ branch makes curl use its existing portable curlx_memzero() fallback. The full AmigaOS build then completes successfully. I've tested the following on Amiga OS 3.2.3 with this patch and latest build. - HTTP and HTTPS transfers - AmiSSL certificate handling - redirects - downloads and file output - timeout handling with the expected exit code 28 - repeated execution with clean exits - no crashes or regressions observed Follow-up to 066478f6346a2d987a9ecc3bd3bf45764d69c1c4 #21598 Closes #21989 --- lib/curl_setup.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 0e49429819..3878503271 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -1641,7 +1641,8 @@ typedef struct sockaddr_un { #define curlx_memzero(buf, size) (void)memset_s(buf, size, 0, size) #elif defined(HAVE_MEMSET_EXPLICIT) #define curlx_memzero(buf, size) (void)memset_explicit(buf, 0, size) -#elif defined(__CYGWIN__) || defined(__NEWLIB__) || \ +#elif defined(__CYGWIN__) || \ + (defined(__NEWLIB__) && !defined(__CLIB2__)) || \ (defined(__GLIBC__) && \ (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 25))) || \ (defined(__DragonFly__) && __DragonFly_version >= 500600 /* v5.6+ */) || \