diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index da93c95d39..d91bdd6737 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -291,7 +291,11 @@ jobs: container: 'alpine:3.20' - name: Alpine MUSL c-ares https-rr - configure: --enable-debug --with-ssl --with-libssh2 --with-libidn2 --with-gssapi --enable-ldap --with-libpsl --disable-threaded-resolver --enable-ares --enable-httpsrr --disable-unity + configure: --enable-debug --with-ssl --with-libssh2 --with-libidn2 --with-gssapi --enable-ldap --with-libpsl --disable-threaded-resolver --enable-ares --enable-httpsrr --disable-werror + container: 'alpine:3.20' + + - name: Alpine MUSL c-ares https-rr !debug + configure: --enable-debug --with-ssl --with-libssh2 --with-libidn2 --with-gssapi --enable-ldap --with-libpsl --disable-threaded-resolver --enable-ares --enable-httpsrr --disable-werror --disable-debug container: 'alpine:3.20' steps: diff --git a/CMake/unix-cache.cmake b/CMake/unix-cache.cmake index e0e1d8f947..6ccd7b8377 100644 --- a/CMake/unix-cache.cmake +++ b/CMake/unix-cache.cmake @@ -309,3 +309,11 @@ if(CYGWIN) endif() set(STDC_HEADERS 1) set(USE_UNIX_SOCKETS 1) + +if(MUSL) + set(HAVE_GLIBC_STRERROR_R 0) + set(HAVE_LINUX_TCP_H 0) + set(HAVE_POSIX_STRERROR_R 1) + set(HAVE_STROPTS_H 1) + set(HAVE_TERMIOS_H 0) +endif() diff --git a/lib/easy_lock.h b/lib/easy_lock.h index ec324cfc81..a61df8365a 100644 --- a/lib/easy_lock.h +++ b/lib/easy_lock.h @@ -45,6 +45,12 @@ #elif defined(HAVE_ATOMIC) && defined(HAVE_STDATOMIC_H) #include #if defined(HAVE_SCHED_YIELD) +/* Hack for Unity mode. Avoid macro collisions with MUSL 1.25 and older */ +#ifdef HEADER_CURL_MEMDEBUG_H +#undef HEADER_CURL_MEMDEBUG_H +#undef calloc +#undef free +#endif #include #endif diff --git a/lib/memdebug.h b/lib/memdebug.h index f45d4925f6..8bb7df4fd2 100644 --- a/lib/memdebug.h +++ b/lib/memdebug.h @@ -33,6 +33,11 @@ #include #include "functypes.h" +/* Avoid double definitions/declarations, in case we include this header + again after a 'memdebug_reset.h'. */ +#ifndef HEADER_CURL_MEMDEBUG_H_DECL +#define HEADER_CURL_MEMDEBUG_H_DECL + #if defined(__GNUC__) && __GNUC__ >= 3 # define ALLOC_FUNC __attribute__((__malloc__)) # define ALLOC_SIZE(s) __attribute__((__alloc_size__(s))) @@ -108,6 +113,7 @@ CURL_EXTERN ALLOC_FUNC FILE *curl_dbg_fdopen(int filedes, const char *mode, int line, const char *source); CURL_EXTERN int curl_dbg_fclose(FILE *file, int line, const char *source); +#endif /* HEADER_CURL_MEMDEBUG_H_DECL */ #ifndef MEMDEBUG_NODEFINES