Yesterday I wrote:
> +      dnl Among the platforms where $(LIBPTHREAD) is empty and
> +      dnl $(LIBPMULTITHREAD) is non-empty, namely
> +      dnl   musl libc, macOS, FreeBSD, NetBSD, Solaris, Cygwin, Haiku, 
> Android,
> +      dnl $(LIBPMULTITHREAD) is necessary only on FreeBSD.

Oops, this broke on older glibc systems. This patch fixes it.


2025-09-21  Bruno Haible  <[email protected]>

        pthread-once: Fix link error on glibc < 2.34 systems (regr. yesterday).
        * m4/pthread-once.m4 (gl_PTHREAD_ONCE): Use $LIBPMULTITHREAD also on
        glibc systems.

diff --git a/m4/pthread-once.m4 b/m4/pthread-once.m4
index 6978bcb563..f384df49a0 100644
--- a/m4/pthread-once.m4
+++ b/m4/pthread-once.m4
@@ -1,5 +1,5 @@
 # pthread-once.m4
-# serial 4
+# serial 5
 dnl Copyright (C) 2019-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -37,10 +37,11 @@ AC_DEFUN([gl_PTHREAD_ONCE]
       esac
       dnl Among the platforms where $(LIBPTHREAD) is empty and
       dnl $(LIBPMULTITHREAD) is non-empty, namely
-      dnl   musl libc, macOS, FreeBSD, NetBSD, Solaris, Cygwin, Haiku, Android,
-      dnl $(LIBPMULTITHREAD) is necessary only on FreeBSD.
+      dnl   glibc < 2.34, musl libc, macOS, FreeBSD, NetBSD, Solaris, Cygwin,
+      dnl   Haiku, Android,
+      dnl $(LIBPMULTITHREAD) is necessary only on glibc and FreeBSD.
       case "$host_os" in
-        freebsd* | dragonfly* | midnightbsd*)
+        *-gnu* | gnu* | freebsd* | dragonfly* | midnightbsd*)
           PTHREAD_ONCE_LIB="$LIBPMULTITHREAD" ;;
         *)
           PTHREAD_ONCE_LIB="$LIBPTHREAD" ;;




Reply via email to